diff -ruN cfengine-2.1.14-old/src/cfrun.c cfengine-2.1.14/src/cfrun.c --- cfengine-2.1.14-old/src/cfrun.c 2005-02-08 12:50:01.000000000 +0100 +++ cfengine-2.1.14/src/cfrun.c 2005-06-07 15:56:22.000000000 +0200 @@ -52,6 +52,7 @@ int TRUSTALL = false; enum fileoutputlevels OUTPUTLEVEL = fopl_normal; char OUTPUTDIR[CF_BUFSIZE]; +char INCLUDEFILE[CF_BUFSIZE]; struct Item *VCFRUNCLASSES = NULL; struct Item *VCFRUNOPTIONHOSTS = NULL; @@ -70,7 +71,7 @@ void SendClassData ARGLIST((int sd, char *sendbuffer)); void CheckAccess ARGLIST((char *users)); void cfrunSyntax ARGLIST((void)); -void ReadCfrunConf ARGLIST((void)); +void ReadCfrunConf ARGLIST((char* cfg_fic)); int ParseHostname ARGLIST((char *hostname, char *new_hostname)); void FileOutput ARGLIST((FILE *fp, enum fileoutputlevels level, char *message)); @@ -245,7 +246,7 @@ } } - ReadCfrunConf(); + ReadCfrunConf(VCFRUNHOSTS); GetNameInfo(); @@ -553,8 +554,7 @@ /* Level 2 */ /********************************************************************/ -void ReadCfrunConf() - +void ReadCfrunConf(char* cfg_fic) { char filename[CF_BUFSIZE], *sp; char buffer[CF_MAXVARSIZE], options[CF_BUFSIZE], line[CF_BUFSIZE]; FILE *fp; @@ -578,7 +578,7 @@ } } -strcat(filename,VCFRUNHOSTS); +strcat(filename,cfg_fic); if ((fp = fopen(filename,"r")) == NULL) /* Open root file */ { @@ -669,6 +669,14 @@ continue; } + if (strncmp(line,"include", strlen("include")) == 0) + { + sscanf(line,"include = %295[^# \n]", INCLUDEFILE); + Verbose("cfrun: include = %s\n", INCLUDEFILE); + ReadCfrunConf(INCLUDEFILE); + continue; + } + if (strncmp(line,"access",6) == 0) { for (sp = line; (*sp != '=') && (*sp != '\0'); sp++) @@ -695,6 +703,7 @@ { continue; } + if (VCFRUNOPTIONHOSTS != NULL && !IsItemIn(VCFRUNOPTIONHOSTS,buffer)) @@ -888,6 +897,7 @@ printf(" cfrun -v -- -k -- solaris Local verbose, all solaris, but no copy\n\n"); printf("cfrun.hosts file syntax:\n"); printf("# starts a comment\n"); + printf("include = [file]\t# External cfrun.hosts file to include.\n"); printf("domain = [domain]\t# Domain to use for connection(s).\n"); printf("maxchild = [num]\t# Maximum number of children to spawn during run.\n"); printf("outputdir = [dir]\t# Directory where to put host output files.\n");