diff -u cvs-1.10.8_dist/src/cvs.h cvs-1.10.8/src/cvs.h --- cvs-1.10.8_dist/src/cvs.h Mon Jan 3 21:49:12 2000 +++ cvs-1.10.8/src/cvs.h Fri Oct 20 13:56:11 2000 @@ -453,6 +453,7 @@ void set_local_cvsroot PROTO((char *dir)); void Create_Root PROTO((char *dir, char *rootdir)); void root_allow_add PROTO ((char *)); +int root_allow_add_file PROTO ((char *)); void root_allow_free PROTO ((void)); int root_allow_ok PROTO ((char *)); diff -u cvs-1.10.8_dist/src/main.c cvs-1.10.8/src/main.c --- cvs-1.10.8_dist/src/main.c Tue Aug 17 19:16:25 1999 +++ cvs-1.10.8/src/main.c Fri Oct 20 14:24:57 2000 @@ -426,6 +426,7 @@ {"help-synonyms", 0, NULL, 2}, {"help-options", 0, NULL, 4}, {"allow-root", required_argument, NULL, 3}, + {"allow-root-file", required_argument, NULL, 5}, {0, 0, 0, 0} }; /* `getopt_long' stores the option index here, but right now we @@ -529,6 +530,11 @@ case 3: /* --allow-root */ root_allow_add (optarg); + break; + case 5: + /* --allow-root-file */ + if ( root_allow_add_file(optarg) != 0) + exit(1); break; case 'Q': really_quiet = 1; diff -u cvs-1.10.8_dist/src/root.c cvs-1.10.8/src/root.c --- cvs-1.10.8_dist/src/root.c Sun Mar 7 21:17:02 1999 +++ cvs-1.10.8/src/root.c Fri Oct 20 14:32:34 2000 @@ -229,6 +229,61 @@ root_allow_vector[root_allow_count++] = p; } +int +root_allow_add_file (fname) + char *fname; +{ + char *linebuf = NULL; + int num_red = 0; + size_t linebuf_len = 0; + FILE *fp; + + fp = fopen (fname, "r"); + + if (fp == NULL) + { + if (existence_error (errno)) + { + /* The file containing allowed roots cannot open */ + error (0, errno, "cannot open %s", fname); + return(1); + } + } + else /* successfully opened allowed root file */ + { + while ((num_red = getline (&linebuf, &linebuf_len, fp)) >= 0) + { + /* Hmmm, is it worth importing my own readline + library into CVS? It takes care of chopping + leading and trailing whitespace, "#" comments, and + newlines automatically when so requested. Would + save some code here... -kff */ + + /* Chop newline by hand before passing argument to root_allow_add . */ + if (linebuf[num_red - 1] == '\n') + linebuf[num_red - 1] = '\0'; + + if (strlen(linebuf)> 0) + root_allow_add(linebuf); + + } + + if (num_red < 0 && !feof (fp)) { + error (0, errno, "cannot read %s", fname); + return(1); + } + + if (fclose (fp) < 0) { + error (0, errno, "cannot close %s", fname); + return(1); + } + + } + + return(0); +} + + void root_allow_free () {