Module Name: src Committed By: christos Date: Fri Jul 29 18:47:11 UTC 2011
Modified Files: src/external/gpl2/xcvs/dist/src: mkmodules.c Log Message: Allow init for new repository construction! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/mkmodules.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl2/xcvs/dist/src/mkmodules.c diff -u src/external/gpl2/xcvs/dist/src/mkmodules.c:1.3 src/external/gpl2/xcvs/dist/src/mkmodules.c:1.4 --- src/external/gpl2/xcvs/dist/src/mkmodules.c:1.3 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/mkmodules.c Fri Jul 29 14:47:11 2011 @@ -1154,15 +1154,12 @@ char *info_v; /* Exit status. */ int err = 0; + struct stat st; const struct admin_file *fileptr; umask (cvsumask); - if (!admin_group_member ()) - error (1, 0, "usage is restricted to members of the group %s", - config->UserAdminGroup); - if (argc == -1 || argc > 1) usage (init_usage); @@ -1177,6 +1174,11 @@ } #endif /* CLIENT_SUPPORT */ + if (stat (current_parsed_root->directory, &st) != -1) + if (!admin_group_member ()) + error (1, 0, "init to an existing repository is restricted to" + " members of the group %s", config->UserAdminGroup); + /* Note: we do *not* create parent directories as needed like the old cvsinit.sh script did. Few utilities do that, and a non-existent parent directory is as likely to be a typo as something