CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Sat Jan 5 00:27:58 UTC 2019 Modified Files: src/external/gpl2/xcvs/dist/src: tag.c Log Message: When we we fail to remove tags, print an error message since we are going to be exiting with an error anyway. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/tag.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/tag.c diff -u src/external/gpl2/xcvs/dist/src/tag.c:1.4 src/external/gpl2/xcvs/dist/src/tag.c:1.5 --- src/external/gpl2/xcvs/dist/src/tag.c:1.4 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/tag.c Fri Jan 4 19:27:58 2019 @@ -17,7 +17,7 @@ * the modules database, if necessary. */ #include -__RCSID("$NetBSD: tag.c,v 1.4 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: tag.c,v 1.5 2019/01/05 00:27:58 christos Exp $"); #include "cvs.h" #include @@ -1189,7 +1189,7 @@ rtag_delete (RCSNode *rcsfile) if ((isbranch && !disturb_branch_tags) || (!isbranch && disturb_branch_tags)) { - if (!quiet) + if (!really_quiet) error (0, 0, "Not removing %s tag `%s' from `%s'%s.", isbranch ? "branch" : "non-branch", @@ -1200,7 +1200,7 @@ rtag_delete (RCSNode *rcsfile) if ((retcode = RCS_deltag(rcsfile, symtag)) != 0) { - if (!quiet) + if (!really_quiet) error (0, retcode == -1 ? errno : 0, "failed to remove tag `%s' from `%s'", symtag, rcsfile->path); @@ -1275,7 +1275,7 @@ tag_fileproc (void *callerdat, struct fi if ((isbranch && !disturb_branch_tags) || (!isbranch && disturb_branch_tags)) { - if (!quiet) + if (!really_quiet) error(0, 0, "Not removing %s tag `%s' from `%s'%s.", isbranch ? "branch" : "non-branch", @@ -1287,7 +1287,7 @@ tag_fileproc (void *callerdat, struct fi if ((retcode = RCS_deltag (vers->srcfile, symtag)) != 0) { - if (!quiet) + if (!really_quiet) error (0, retcode == -1 ? errno : 0, "failed to remove tag %s from %s", symtag, vers->srcfile->path);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Tue Aug 21 15:37:34 UTC 2018 Modified Files: src/external/gpl2/xcvs/dist/src: main.c run.c Log Message: support SIGINFO To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/main.c cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/run.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/main.c diff -u src/external/gpl2/xcvs/dist/src/main.c:1.6 src/external/gpl2/xcvs/dist/src/main.c:1.7 --- src/external/gpl2/xcvs/dist/src/main.c:1.6 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/main.c Tue Aug 21 11:37:33 2018 @@ -17,7 +17,7 @@ * */ #include -__RCSID("$NetBSD: main.c,v 1.6 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: main.c,v 1.7 2018/08/21 15:37:33 christos Exp $"); #include "cvs.h" @@ -498,6 +498,32 @@ divide_by (unsigned char buf[COMMITID_RA return carry; } +#ifdef SIGINFO +#include + +static void +show_status (int n) +{ + char wd[PATH_MAX]; + char buf[2048]; + static int ttyfd = -2; + + if (ttyfd == -2) + ttyfd = open(_PATH_TTY, O_RDWR, O_CLOEXEC); + + if (ttyfd == -1) + return; + + if (getcwd(wd, sizeof(wd)) == NULL) + return; + n = snprintf(buf, sizeof(buf), "%s[%d]: working in %s\n", getprogname(), + (int)getpid(), wd); + if (n <= 0) + return; + write(ttyfd, buf, (size_t)n); +} +#endif + static void convert (char const input[COMMITID_RAW_SIZE], char *output) { @@ -967,6 +993,9 @@ cause intermittent sandbox corruption.") /* make sure we clean up on error */ signals_register (main_cleanup); +#ifdef SIGINFO + signal (SIGINFO, show_status); +#endif #ifdef KLUDGE_FOR_WNT_TESTSUITE /* Probably the need for this will go away at some point once Index: src/external/gpl2/xcvs/dist/src/run.c diff -u src/external/gpl2/xcvs/dist/src/run.c:1.3 src/external/gpl2/xcvs/dist/src/run.c:1.4 --- src/external/gpl2/xcvs/dist/src/run.c:1.3 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/run.c Tue Aug 21 11:37:33 2018 @@ -12,7 +12,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -__RCSID("$NetBSD: run.c,v 1.3 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: run.c,v 1.4 2018/08/21 15:37:33 christos Exp $"); #include "cvs.h" @@ -239,6 +239,9 @@ run_exec (const char *stin, const char * #endif if (pid == 0) { +#ifdef SIGINFO + signal (SIGINFO, SIG_DFL); +#endif #ifdef SETXID_SUPPORT if (flags & RUN_UNSETXID) { (void) setgid (getgid ()); @@ -570,6 +573,9 @@ piped_child (char *const *command, int * error (1, errno, "cannot fork"); if (pid == 0) { +#ifdef SIGINFO + signal (SIGINFO, SIG_DFL); +#endif if (dup2 (to_child_pipe[0], STDIN_FILENO) < 0) error (1, errno, "cannot dup2 pipe"); if (close (to_child_pipe[1]) < 0)
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Sun Apr 29 15:47:01 UTC 2018 Modified Files: src/external/gpl2/xcvs/dist/src: create_adm.c Log Message: keep going if there is a CVS directory already, but warn To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/create_adm.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/create_adm.c diff -u src/external/gpl2/xcvs/dist/src/create_adm.c:1.2 src/external/gpl2/xcvs/dist/src/create_adm.c:1.3 --- src/external/gpl2/xcvs/dist/src/create_adm.c:1.2 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/create_adm.c Sun Apr 29 11:47:01 2018 @@ -16,7 +16,7 @@ * "Entries" file is prefilled from the "initrecord" argument. */ #include -__RCSID("$NetBSD: create_adm.c,v 1.2 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: create_adm.c,v 1.3 2018/04/29 15:47:01 christos Exp $"); #include "cvs.h" @@ -49,7 +49,9 @@ Create_Admin (const char *dir, const cha tmp = Xasprintf ("%s/%s", dir, CVSADM); if (isfile (tmp)) - error (1, 0, "there is a version in %s already", update_dir); +{ + error (0, 0, "there is a version in %s already", update_dir); +} if (CVS_MKDIR (tmp, 0777) < 0) {
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Fri Sep 15 21:03:26 UTC 2017 Modified Files: src/external/gpl2/xcvs/dist/src: cvs.h filesubr.c find_names.c import.c rcs.c subr.c update.c vers_ts.c Log Message: 1/2 the number of {l,s}stat(2) calls by exposing the stat data found when calling islink()! To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/cvs.h \ src/external/gpl2/xcvs/dist/src/subr.c cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/src/filesubr.c cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/find_names.c cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/xcvs/dist/src/import.c cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/rcs.c cvs rdiff -u -r1.11 -r1.12 src/external/gpl2/xcvs/dist/src/update.c cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/vers_ts.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/cvs.h diff -u src/external/gpl2/xcvs/dist/src/cvs.h:1.4 src/external/gpl2/xcvs/dist/src/cvs.h:1.5 --- src/external/gpl2/xcvs/dist/src/cvs.h:1.4 Thu Mar 8 15:50:26 2012 +++ src/external/gpl2/xcvs/dist/src/cvs.h Fri Sep 15 17:03:26 2017 @@ -516,7 +516,7 @@ typedef RETSIGTYPE (*SIGCLEANUPPROC) (in int SIG_register (int sig, SIGCLEANUPPROC sigcleanup); bool isdir (const char *file); bool isfile (const char *file); -ssize_t islink (const char *file); +ssize_t islink (const char *file, struct stat *stp); bool isdevice (const char *file); bool isreadable (const char *file); bool iswritable (const char *file); Index: src/external/gpl2/xcvs/dist/src/subr.c diff -u src/external/gpl2/xcvs/dist/src/subr.c:1.4 src/external/gpl2/xcvs/dist/src/subr.c:1.5 --- src/external/gpl2/xcvs/dist/src/subr.c:1.4 Mon May 30 13:49:51 2016 +++ src/external/gpl2/xcvs/dist/src/subr.c Fri Sep 15 17:03:26 2017 @@ -13,7 +13,7 @@ * Various useful functions for the CVS support code. */ #include -__RCSID("$NetBSD: subr.c,v 1.4 2016/05/30 17:49:51 christos Exp $"); +__RCSID("$NetBSD: subr.c,v 1.5 2017/09/15 21:03:26 christos Exp $"); #include "cvs.h" @@ -719,7 +719,7 @@ resolve_symlink (char **filename) if (filename == NULL || *filename == NULL) return; -while ((rsize = islink (*filename)) > 0) +while ((rsize = islink (*filename, NULL)) > 0) { #ifdef HAVE_READLINK /* The clean thing to do is probably to have each filesubr.c Index: src/external/gpl2/xcvs/dist/src/filesubr.c diff -u src/external/gpl2/xcvs/dist/src/filesubr.c:1.5 src/external/gpl2/xcvs/dist/src/filesubr.c:1.6 --- src/external/gpl2/xcvs/dist/src/filesubr.c:1.5 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/filesubr.c Fri Sep 15 17:03:26 2017 @@ -13,7 +13,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -__RCSID("$NetBSD: filesubr.c,v 1.5 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: filesubr.c,v 1.6 2017/09/15 21:03:26 christos Exp $"); /* These functions were moved out of subr.c because they need different definitions under operating systems (like, say, Windows NT) with different @@ -25,6 +25,13 @@ __RCSID("$NetBSD: filesubr.c,v 1.5 2016/ #include "xsize.h" static int deep_remove_dir (const char *path); +#ifndef S_ISBLK +#define S_ISBLK(a) 0 +#endif +#ifndef S_ISCHR +#define S_ISCHR(a) 0 +#endif +#define IS_DEVICE(sbp) (S_ISBLK((sbp)->st_mode) || S_ISCHR((sbp)->st_mode)) /* * Copies "from" to "to". @@ -44,7 +51,7 @@ copy_file (const char *from, const char /* If the file to be copied is a link or a device, then just create the new link or device appropriately. */ -if ((rsize = islink (from)) > 0) +if ((rsize = islink (from, )) > 0) { char *source = Xreadlink (from, rsize); if (symlink (source, to) == -1) @@ -53,11 +60,9 @@ copy_file (const char *from, const char return; } -if (isdevice (from)) +if (sb.st_ino != -1 && IS_DEVICE ()) { #if defined(HAVE_MKNOD) && defined(HAVE_STRUCT_STAT_ST_RDEV) - if (stat (from, ) < 0) - error (1, errno, "cannot stat %s", from); mknod (to, sb.st_mode, sb.st_rdev); #else error (1, 0, "cannot copy device files on this system (%s)", from); @@ -136,14 +141,22 @@ isdir (const char *file) * Returns size of the link if it is a symbolic link. */ ssize_t -islink (const char *file) +islink (const char *file, struct stat *sbp) { ssize_t retsize = 0; #ifdef S_ISLNK struct stat sb; +if (sbp == NULL) + sbp = -if ((lstat (file, ) >= 0) && S_ISLNK (sb.st_mode)) - retsize = sb.st_size; +if (lstat (file, sbp) < 0) { + sbp->st_ino = -1; + return 0; +} +if (S_ISLNK (sbp->st_mode)) + retsize = sbp->st_size; +#else +sbp->st_ino = -1; #endif return retsize; } @@ -161,15 +174,7 @@ isdevice (const char *file) if (lstat (file, ) < 0) return false;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Tue Aug 22 10:06:57 UTC 2017 Modified Files: src/external/gpl2/xcvs/dist/src: rsh-client.c Log Message: Fix for CVE-2017-12836; (cvs command injection) from MirBSD. XXX: pullup-8 To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/rsh-client.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/rsh-client.c diff -u src/external/gpl2/xcvs/dist/src/rsh-client.c:1.2 src/external/gpl2/xcvs/dist/src/rsh-client.c:1.3 --- src/external/gpl2/xcvs/dist/src/rsh-client.c:1.2 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/rsh-client.c Tue Aug 22 06:06:57 2017 @@ -10,7 +10,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ #include -__RCSID("$NetBSD: rsh-client.c,v 1.2 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: rsh-client.c,v 1.3 2017/08/22 10:06:57 christos Exp $"); #include @@ -55,11 +55,11 @@ start_rsh_server (cvsroot_t *root, struc char *cvs_server = (root->cvs_server != NULL ? root->cvs_server : getenv ("CVS_SERVER")); int i = 0; -/* This needs to fit "rsh", "-b", "-l", "USER", "host", +/* This needs to fit "rsh", "-b", "-l", "USER", "--", "host", "cmd (w/ args)", and NULL. We leave some room to grow. */ -char *rsh_argv[10]; +char *rsh_argv[16]; -if (!cvs_rsh) +if (!cvs_rsh || !*cvs_rsh) /* People sometimes suggest or assume that this should default to "remsh" on systems like HPUX in which that is the system-supplied name for the rsh program. However, that @@ -99,6 +99,9 @@ start_rsh_server (cvsroot_t *root, struc rsh_argv[i++] = root->username; } +/* Only non-option arguments from here. (CVE-2017-12836) */ +rsh_argv[i++] = "--"; + rsh_argv[i++] = root->hostname; rsh_argv[i++] = cvs_server; rsh_argv[i++] = "server"; @@ -159,7 +162,7 @@ start_rsh_server (cvsroot_t *root, struc command = Xasprintf ("%s server", cvs_server); { -char *argv[10]; +char *argv[16]; char **p = argv; *p++ = cvs_rsh; @@ -173,6 +176,8 @@ start_rsh_server (cvsroot_t *root, struc *p++ = root->username; } + *p++ = "--"; + *p++ = root->hostname; *p++ = command; *p++ = NULL;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Wed Jan 4 16:11:20 UTC 2017 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: only preserve timestamps on specific revisions if we've been asked to. found by martin@ To generate a diff of this commit: cvs rdiff -u -r1.10 -r1.11 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.10 src/external/gpl2/xcvs/dist/src/update.c:1.11 --- src/external/gpl2/xcvs/dist/src/update.c:1.10 Mon Dec 19 12:31:47 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Wed Jan 4 11:11:20 2017 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.10 2016/12/19 17:31:47 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.11 2017/01/04 16:11:20 christos Exp $"); #include "cvs.h" #include @@ -1382,7 +1382,6 @@ VERS: ", 0); xvers_ts = Version_TS (finfo, options, tag, date, force_tag_match, set_time); - if (strcmp (xvers_ts->options, "-V4") == 0) xvers_ts->options[0] = '\0'; @@ -1777,7 +1776,7 @@ patch_file (struct file_info *finfo, Ver /* This stuff is just copied blindly from checkout_file. I don't really know what it does. */ xvers_ts = Version_TS (finfo, options, tag, date, - force_tag_match, 1); + force_tag_match, preserve_timestamps_on_update); if (strcmp (xvers_ts->options, "-V4") == 0) xvers_ts->options[0] = '\0';
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Dec 19 17:31:47 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: fix the usage message To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.9 src/external/gpl2/xcvs/dist/src/update.c:1.10 --- src/external/gpl2/xcvs/dist/src/update.c:1.9 Sun Dec 18 23:54:49 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Mon Dec 19 12:31:47 2016 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.9 2016/12/19 04:54:49 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.10 2016/12/19 17:31:47 christos Exp $"); #include "cvs.h" #include @@ -127,12 +127,12 @@ static const char *const update_usage[] "\t-l\tLocal directory only, no recursion.\n", "\t-R\tProcess directories recursively.\n", "\t-p\tSend updates to standard output (avoids stickiness).\n", +"\t-t\tPreserve timestamps on update.\n", "\t-k kopt\tUse RCS kopt -k option on checkout. (is sticky)\n", "\t-r rev\tUpdate using specified revision/tag (is sticky).\n", "\t-D date\tSet date to update from (is sticky).\n", "\t-j rev\tMerge in changes made between current revision and rev.\n", "\t-I ign\tMore files to ignore (! to reset).\n", -"\t-t Preserve timestamps on update.\n", "\t-W spec\tWrappers specification line.\n", "(Specify the --help global option for a list of other help options)\n", NULL
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Dec 19 04:54:49 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: remove obsolete comment, flip polarity. To generate a diff of this commit: cvs rdiff -u -r1.8 -r1.9 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.8 src/external/gpl2/xcvs/dist/src/update.c:1.9 --- src/external/gpl2/xcvs/dist/src/update.c:1.8 Sun Dec 18 23:44:35 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Sun Dec 18 23:54:49 2016 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.8 2016/12/19 04:44:35 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.9 2016/12/19 04:54:49 christos Exp $"); #include "cvs.h" #include @@ -1373,11 +1373,7 @@ VERS: ", 0); /* set the time from the RCS file iff it was unknown before */ set_time = (!noexec - /* - * always pass the time to the client, and let it decide - * if it is going to set the time - */ - && (!preserve_timestamps_on_update || + && (preserve_timestamps_on_update || vers_ts->vn_user == NULL || strncmp (vers_ts->ts_rcs, "Initial", 7) == 0) && !file_is_dead);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Dec 19 04:44:35 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: fix reversed logic To generate a diff of this commit: cvs rdiff -u -r1.7 -r1.8 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.7 src/external/gpl2/xcvs/dist/src/update.c:1.8 --- src/external/gpl2/xcvs/dist/src/update.c:1.7 Sun Dec 18 23:37:13 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Sun Dec 18 23:44:35 2016 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.7 2016/12/19 04:37:13 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.8 2016/12/19 04:44:35 christos Exp $"); #include "cvs.h" #include @@ -1377,7 +1377,7 @@ VERS: ", 0); * always pass the time to the client, and let it decide * if it is going to set the time */ - && (preserve_timestamps_on_update || + && (!preserve_timestamps_on_update || vers_ts->vn_user == NULL || strncmp (vers_ts->ts_rcs, "Initial", 7) == 0) && !file_is_dead);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Dec 19 04:37:13 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: add -t to preserve timestamps. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.6 src/external/gpl2/xcvs/dist/src/update.c:1.7 --- src/external/gpl2/xcvs/dist/src/update.c:1.6 Sun Dec 18 22:15:31 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Sun Dec 18 23:37:13 2016 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.6 2016/12/19 03:15:31 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.7 2016/12/19 04:37:13 christos Exp $"); #include "cvs.h" #include @@ -106,6 +106,7 @@ static int toss_local_changes = 0; static int force_tag_match = 1; static int update_build_dirs = 0; static int update_prune_dirs = 0; +static int preserve_timestamps_on_update = 0; static int pipeout = 0; static int dotemplate = 0; #ifdef SERVER_SUPPORT @@ -131,6 +132,7 @@ static const char *const update_usage[] "\t-D date\tSet date to update from (is sticky).\n", "\t-j rev\tMerge in changes made between current revision and rev.\n", "\t-I ign\tMore files to ignore (! to reset).\n", +"\t-t Preserve timestamps on update.\n", "\t-W spec\tWrappers specification line.\n", "(Specify the --help global option for a list of other help options)\n", NULL @@ -162,7 +164,7 @@ update (int argc, char **argv) /* parse the args */ getoptreset (); -while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:D:j:I:W:")) != -1) +while ((c = getopt (argc, argv, "+ApCPflRQqduk:r:tD:j:I:W:")) != -1) { switch (c) { @@ -218,6 +220,9 @@ update (int argc, char **argv) pipeout = 1; noexec = 1; /* so no locks will be created */ break; + case 't': + preserve_timestamps_on_update = 1; + break; case 'j': if (join_orig2) error (1, 0, "only two -j options can be specified"); @@ -281,6 +286,8 @@ update (int argc, char **argv) send_arg("-C"); if (update_prune_dirs) send_arg("-P"); + if (preserve_timestamps_on_update) + send_arg("-t"); client_prune_dirs = update_prune_dirs; option_with_arg ("-r", tag); if (options && options[0] != '\0') @@ -1366,18 +1373,20 @@ VERS: ", 0); /* set the time from the RCS file iff it was unknown before */ set_time = (!noexec -#if 0 /* * always pass the time to the client, and let it decide * if it is going to set the time */ - && (vers_ts->vn_user == NULL || + && (preserve_timestamps_on_update || + vers_ts->vn_user == NULL || strncmp (vers_ts->ts_rcs, "Initial", 7) == 0) -#endif && !file_is_dead); + wrap_fromcvs_process_file (finfo->file); + xvers_ts = Version_TS (finfo, options, tag, date, force_tag_match, set_time); + if (strcmp (xvers_ts->options, "-V4") == 0) xvers_ts->options[0] = '\0';
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Dec 19 03:15:31 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: Always pass the modification time of the file to the client and let it decide if it is going to use it to set the time. This makes update work like checkout with respect to time setting. The time of the updated file is set to the repository modification time of the file as opposed to the the time that the file was checked out. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.5 src/external/gpl2/xcvs/dist/src/update.c:1.6 --- src/external/gpl2/xcvs/dist/src/update.c:1.5 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/update.c Sun Dec 18 22:15:31 2016 @@ -38,7 +38,7 @@ * as well. */ #include -__RCSID("$NetBSD: update.c,v 1.5 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: update.c,v 1.6 2016/12/19 03:15:31 christos Exp $"); #include "cvs.h" #include @@ -1366,12 +1366,16 @@ VERS: ", 0); /* set the time from the RCS file iff it was unknown before */ set_time = (!noexec +#if 0 + /* + * always pass the time to the client, and let it decide + * if it is going to set the time + */ && (vers_ts->vn_user == NULL || strncmp (vers_ts->ts_rcs, "Initial", 7) == 0) +#endif && !file_is_dead); - wrap_fromcvs_process_file (finfo->file); - xvers_ts = Version_TS (finfo, options, tag, date, force_tag_match, set_time); if (strcmp (xvers_ts->options, "-V4") == 0) @@ -1768,7 +1772,7 @@ patch_file (struct file_info *finfo, Ver /* This stuff is just copied blindly from checkout_file. I don't really know what it does. */ xvers_ts = Version_TS (finfo, options, tag, date, - force_tag_match, 0); + force_tag_match, 1); if (strcmp (xvers_ts->options, "-V4") == 0) xvers_ts->options[0] = '\0';
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon May 30 17:49:51 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: import.c subr.c Log Message: Make sure that all messages end in '\n' in make_message_rcsvalid() and compensate for it in add_rcs_file(). To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/import.c cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/subr.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/import.c diff -u src/external/gpl2/xcvs/dist/src/import.c:1.6 src/external/gpl2/xcvs/dist/src/import.c:1.7 --- src/external/gpl2/xcvs/dist/src/import.c:1.6 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/import.c Mon May 30 13:49:51 2016 @@ -21,7 +21,7 @@ * Additional arguments specify more Vendor Release Tags. */ #include -__RCSID("$NetBSD: import.c,v 1.6 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: import.c,v 1.7 2016/05/30 17:49:51 christos Exp $"); #include "cvs.h" #include "lstat.h" @@ -1409,7 +1409,7 @@ add_rcs_file (const char *message, const /* We are going to put the log message in the revision on the branch. So putting it here too seems kind of redundant, I guess (and that is what CVS has always done, anyway). */ - if (fprintf (fprcs, "Initial revision") < 0) + if (fprintf (fprcs, "Initial revision\n") < 0) goto write_error; } else @@ -1417,7 +1417,7 @@ add_rcs_file (const char *message, const if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0) goto write_error; } - if (fprintf (fprcs, "\012@\012") < 0 || + if (fprintf (fprcs, "@\012") < 0 || fprintf (fprcs, "text\012@") < 0) { goto write_error; @@ -1443,7 +1443,7 @@ add_rcs_file (const char *message, const fprintf (fprcs, "log\012@") < 0 || expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 || - fprintf (fprcs, "\012@\012text\012") < 0 || + fprintf (fprcs, "@\012text\012") < 0 || fprintf (fprcs, "@@\012") < 0) goto write_error; } Index: src/external/gpl2/xcvs/dist/src/subr.c diff -u src/external/gpl2/xcvs/dist/src/subr.c:1.3 src/external/gpl2/xcvs/dist/src/subr.c:1.4 --- src/external/gpl2/xcvs/dist/src/subr.c:1.3 Tue May 17 10:00:09 2016 +++ src/external/gpl2/xcvs/dist/src/subr.c Mon May 30 13:49:51 2016 @@ -13,7 +13,7 @@ * Various useful functions for the CVS support code. */ #include -__RCSID("$NetBSD: subr.c,v 1.3 2016/05/17 14:00:09 christos Exp $"); +__RCSID("$NetBSD: subr.c,v 1.4 2016/05/30 17:49:51 christos Exp $"); #include "cvs.h" @@ -542,7 +542,8 @@ make_message_rcsvalid (const char *messa if (message == NULL) message = ""; /* Strip whitespace from end of lines and end of string. */ -dp = dst = (char *) xmalloc (strlen (message) + 1); +/* One for NUL, one for \n */ +dp = dst = xmalloc (strlen (message) + 2); for (mp = message; *mp != '\0'; ++mp) { if (*mp == '\n') @@ -564,7 +565,12 @@ make_message_rcsvalid (const char *messa if (*dst == '\0') { free (dst); - dst = xstrdup ("*** empty log message ***"); + dst = xstrdup ("*** empty log message ***\n"); +} +else if (dp > dst && dp[-1] != '\n') +{ + *dp++ = '\n'; + *dp++ = '\0'; } return dst;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Sun Feb 21 00:56:44 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: import.c Log Message: Handle the last newline in the "special" import for new file like RCS does. I.e. make_message_rcsvalid() removes it, and we put it back. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/import.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/import.c diff -u src/external/gpl2/xcvs/dist/src/import.c:1.4 src/external/gpl2/xcvs/dist/src/import.c:1.5 --- src/external/gpl2/xcvs/dist/src/import.c:1.4 Sat Jan 30 11:21:47 2016 +++ src/external/gpl2/xcvs/dist/src/import.c Sat Feb 20 19:56:44 2016 @@ -1407,7 +1407,7 @@ add_rcs_file (const char *message, const /* We are going to put the log message in the revision on the branch. So putting it here too seems kind of redundant, I guess (and that is what CVS has always done, anyway). */ - if (fprintf (fprcs, "Initial revision\012") < 0) + if (fprintf (fprcs, "Initial revision") < 0) goto write_error; } else @@ -1415,7 +1415,7 @@ add_rcs_file (const char *message, const if (expand_at_signs (message, (off_t) strlen (message), fprcs) < 0) goto write_error; } - if (fprintf (fprcs, "@\012") < 0 || + if (fprintf (fprcs, "\012@\012") < 0 || fprintf (fprcs, "text\012@") < 0) { goto write_error; @@ -1441,7 +1441,7 @@ add_rcs_file (const char *message, const fprintf (fprcs, "log\012@") < 0 || expand_at_signs (message, (off_t) strlen (message), fprcs) < 0 || - fprintf (fprcs, "@\012text\012") < 0 || + fprintf (fprcs, "\012@\012text\012") < 0 || fprintf (fprcs, "@@\012") < 0) goto write_error; }
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Sat Jan 30 16:21:47 UTC 2016 Modified Files: src/external/gpl2/xcvs/dist/src: import.c Log Message: Remove trailing whitespace from imported messages when adding now files. This is done in RCS_checkin() but we have a "fast path" for new files here that does not do it. Hooray for specialized code. XXX: pullup 6, 7 To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/import.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/import.c diff -u src/external/gpl2/xcvs/dist/src/import.c:1.3 src/external/gpl2/xcvs/dist/src/import.c:1.4 --- src/external/gpl2/xcvs/dist/src/import.c:1.3 Thu Mar 8 15:47:45 2012 +++ src/external/gpl2/xcvs/dist/src/import.c Sat Jan 30 11:21:47 2016 @@ -579,7 +579,7 @@ static int process_import_file (char *message, char *vfile, char *vtag, int targc, char **targv) { -char *rcs; +char *rcs, *cleanmessage; int inattic = 0; rcs = Xasprintf ("%s/%s%s", repository, vfile, RCSEXT); @@ -654,13 +654,14 @@ process_import_file (char *message, char Entries_Close (entries); } #endif - - retval = add_rcs_file (message, rcs, vfile, vhead, our_opt, + cleanmessage = make_message_rcsvalid (message); + retval = add_rcs_file (cleanmessage, rcs, vfile, vhead, our_opt, vbranch, vtag, targc, targv, NULL, 0, logfp, killnew); if (free_opt != NULL) free (free_opt); free (rcs); + free (cleanmessage); return retval; } free (attic_name);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: tls Date: Sun Aug 10 07:09:51 UTC 2014 Modified Files: src/external/gpl2/xcvs/dist/src: server.c Log Message: Relax arbitrary limit of 10,000 changed files per commit idiotically introduced in CVS 1.11.17. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/src/server.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/server.c diff -u src/external/gpl2/xcvs/dist/src/server.c:1.5 src/external/gpl2/xcvs/dist/src/server.c:1.6 --- src/external/gpl2/xcvs/dist/src/server.c:1.5 Thu Sep 13 17:45:07 2012 +++ src/external/gpl2/xcvs/dist/src/server.c Sun Aug 10 07:09:51 2014 @@ -1130,7 +1130,7 @@ serve_max_dotdot (char *arg) if (proxy_log) return; #endif /* PROXY_SUPPORT */ -if (lim 0 || lim 1) +if (lim 0 || lim 100) return; p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10); if (p == NULL) @@ -2989,7 +2989,7 @@ serve_argument (char *arg) if (error_pending()) return; -if (argument_count = 1) +if (argument_count = 100) { if (alloc_pending (80)) sprintf (pending_error_text,
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: apb Date: Sun Aug 10 07:33:37 UTC 2014 Modified Files: src/external/gpl2/xcvs/dist/src: server.c Log Message: Move the arbitrary limit on number of files per commit into #define MAXARGS. The limit used to be 1, but was changed to 100 earlier today. To generate a diff of this commit: cvs rdiff -u -r1.6 -r1.7 src/external/gpl2/xcvs/dist/src/server.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/server.c diff -u src/external/gpl2/xcvs/dist/src/server.c:1.6 src/external/gpl2/xcvs/dist/src/server.c:1.7 --- src/external/gpl2/xcvs/dist/src/server.c:1.6 Sun Aug 10 07:09:51 2014 +++ src/external/gpl2/xcvs/dist/src/server.c Sun Aug 10 07:33:37 2014 @@ -153,6 +153,8 @@ static int argument_count; static char **argument_vector; static int argument_vector_size; +#define MAXARGS 100 /* arbitrary limit */ + /* * This is where we stash stuff we are going to use. Format string * which expects a single directory within it, starting with a slash. @@ -1130,7 +1132,7 @@ serve_max_dotdot (char *arg) if (proxy_log) return; #endif /* PROXY_SUPPORT */ -if (lim 0 || lim 100) +if (lim 0 || lim MAXARGS) return; p = xmalloc (strlen (server_temp_dir) + 2 * lim + 10); if (p == NULL) @@ -2989,7 +2991,7 @@ serve_argument (char *arg) if (error_pending()) return; -if (argument_count = 100) +if (argument_count = MAXARGS) { if (alloc_pending (80)) sprintf (pending_error_text,
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Nov 7 20:09:55 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: exithandle.c Log Message: Don't use SIG_register to register a SIG_IGN handler. It thinks it registers a fucntion, but then it ends up calling (*1)(13) with all signals blocked so cvs spins (with all signal blocked, getting SEGV). Use plain signal instead To reproduce: cvs log file | less and quit. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/exithandle.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/exithandle.c diff -u src/external/gpl2/xcvs/dist/src/exithandle.c:1.2 src/external/gpl2/xcvs/dist/src/exithandle.c:1.3 --- src/external/gpl2/xcvs/dist/src/exithandle.c:1.2 Wed Oct 30 10:25:47 2013 +++ src/external/gpl2/xcvs/dist/src/exithandle.c Thu Nov 7 15:09:55 2013 @@ -30,7 +30,7 @@ signals_register (RETSIGTYPE (*handler)( (void) SIG_register (SIGQUIT, handler); #endif #ifdef SIGPIPE - (void) SIG_register (SIGPIPE, SIG_IGN); + (void) signal (SIGPIPE, SIG_IGN); #endif #ifdef SIGTERM (void) SIG_register (SIGTERM, handler);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Wed Oct 30 14:25:47 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: exithandle.c Log Message: Ignore SIGPIPE; this is silly, we are getting EOF from a client, then while processing the error SIGPIPE comes because the client closed the connection, and then we end up calling error() while processing the error which prints silly messages on the console because it logs with LOG_EMERG. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/exithandle.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/exithandle.c diff -u src/external/gpl2/xcvs/dist/src/exithandle.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/exithandle.c:1.2 --- src/external/gpl2/xcvs/dist/src/exithandle.c:1.1.1.1 Tue Apr 7 18:10:26 2009 +++ src/external/gpl2/xcvs/dist/src/exithandle.c Wed Oct 30 10:25:47 2013 @@ -30,7 +30,7 @@ signals_register (RETSIGTYPE (*handler)( (void) SIG_register (SIGQUIT, handler); #endif #ifdef SIGPIPE - (void) SIG_register (SIGPIPE, handler); + (void) SIG_register (SIGPIPE, SIG_IGN); #endif #ifdef SIGTERM (void) SIG_register (SIGTERM, handler);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu May 9 15:25:44 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: acl.c Log Message: When checking for membership in the system group file don't forget to check the primary group of the user. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/acl.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/acl.c diff -u src/external/gpl2/xcvs/dist/src/acl.c:1.4 src/external/gpl2/xcvs/dist/src/acl.c:1.5 --- src/external/gpl2/xcvs/dist/src/acl.c:1.4 Wed Oct 3 18:28:20 2012 +++ src/external/gpl2/xcvs/dist/src/acl.c Thu May 9 11:25:44 2013 @@ -30,6 +30,7 @@ */ #include cvs.h #include getline.h +#include pwd.h #include grp.h static int acl_fileproc (void *callerdat, struct file_info *finfo); @@ -556,18 +557,24 @@ check_default: if (debug) fprintf (stderr, usesystemgroups=%d\n, use_system_groups); if (use_system_groups) { struct group *griter; + struct passwd *pwd; + gid_t gid = (pwd = getpwnam(username)) != NULL ? pwd-pw_gid : -1; setgrent (); while (griter = getgrent ()) { - char **users=griter-gr_mem; - int index = 0; - char *userchk = users [index++]; - while(userchk != NULL) { - if(strcmp (userchk, username) == 0) - break; - userchk = users[index++]; + char *userchk; + if (gid == griter-gr_gid) { + userchk = username; + } else { + char **users = griter-gr_mem; + int index = 0; + userchk = users [index++]; + while(userchk != NULL) { + if(strcmp (userchk, username) == 0) + break; + userchk = users[index++]; + } } - if (debug) fprintf (stderr, usercheck=%s\n, userchk); if (userchk != NULL) { char *grp; if ((grp = findusername (part_perms, griter-gr_name)))
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: jakllsch Date: Sun Apr 21 19:34:14 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: error.c Log Message: Use LOG_ERR instead of LOG_EMERG, as LOG_EMERG causes syslogd to tell all ttys. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/error.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/error.c diff -u src/external/gpl2/xcvs/dist/src/error.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/error.c:1.2 --- src/external/gpl2/xcvs/dist/src/error.c:1.1.1.1 Tue Apr 7 22:10:26 2009 +++ src/external/gpl2/xcvs/dist/src/error.c Sun Apr 21 19:34:13 2013 @@ -208,7 +208,7 @@ memerror: * with the message here. */ #if HAVE_SYSLOG_H -syslog (LOG_DAEMON | LOG_EMERG, Memory exhausted. Aborting.); +syslog (LOG_DAEMON | LOG_ERR, Memory exhausted. Aborting.); #endif /* HAVE_SYSLOG_H */ goto sidestep_done; @@ -219,18 +219,18 @@ recursion_error: * error while attempting to send the last error message to the client. */ -syslog (LOG_DAEMON | LOG_EMERG, +syslog (LOG_DAEMON | LOG_ERR, error (%d, %d) called recursively. Original message was:, last_status, last_errnum); -syslog (LOG_DAEMON | LOG_EMERG, %s, last_message); +syslog (LOG_DAEMON | LOG_ERR, %s, last_message); -syslog (LOG_DAEMON | LOG_EMERG, +syslog (LOG_DAEMON | LOG_ERR, error (%d, %d) called recursively. Second message was:, status, errnum); -syslog (LOG_DAEMON | LOG_EMERG, %s, buf2); +syslog (LOG_DAEMON | LOG_ERR, %s, buf2); -syslog (LOG_DAEMON | LOG_EMERG, Aborting.); +syslog (LOG_DAEMON | LOG_ERR, Aborting.); #endif /* HAVE_SYSLOG_H */ sidestep_done:
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Wed Mar 27 18:15:13 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: lock.c Log Message: Don't abort with an assertion when a directory cannot be found in a repository. This could happen when someone copies from one directory to another CVS files or when things get corrupted. Provide an explanatory error message instead. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/lock.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/lock.c diff -u src/external/gpl2/xcvs/dist/src/lock.c:1.2 src/external/gpl2/xcvs/dist/src/lock.c:1.3 --- src/external/gpl2/xcvs/dist/src/lock.c:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/lock.c Wed Mar 27 14:15:13 2013 @@ -230,6 +230,9 @@ lock_name (const char *repository, const * might have symlinks present */ len = find_root(repository, current_parsed_root-directory); + if (len == -1) + error (1, 0, %s not found in %s, + repository, current_parsed_root-directory); assert(len != -1); short_repos = repository + len + 1;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Wed Mar 27 19:23:28 UTC 2013 Modified Files: src/external/gpl2/xcvs/dist/src: lock.c Log Message: delete the assert as we'll never get there anyway. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/lock.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/lock.c diff -u src/external/gpl2/xcvs/dist/src/lock.c:1.3 src/external/gpl2/xcvs/dist/src/lock.c:1.4 --- src/external/gpl2/xcvs/dist/src/lock.c:1.3 Wed Mar 27 14:15:13 2013 +++ src/external/gpl2/xcvs/dist/src/lock.c Wed Mar 27 15:23:28 2013 @@ -233,7 +233,6 @@ lock_name (const char *repository, const if (len == -1) error (1, 0, %s not found in %s, repository, current_parsed_root-directory); - assert(len != -1); short_repos = repository + len + 1; if (strcmp (repository, current_parsed_root-directory) == 0)
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Wed Oct 3 22:28:20 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: acl.c Log Message: - add more debugging - don't return memory we did not allocate, which the caller will then free! To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/acl.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/acl.c diff -u src/external/gpl2/xcvs/dist/src/acl.c:1.3 src/external/gpl2/xcvs/dist/src/acl.c:1.4 --- src/external/gpl2/xcvs/dist/src/acl.c:1.3 Fri Mar 9 10:24:34 2012 +++ src/external/gpl2/xcvs/dist/src/acl.c Wed Oct 3 18:28:20 2012 @@ -279,16 +279,26 @@ access_allowed (const char *file, const if (debug) fprintf(stderr, perm %d\n, perm); if (valid_perm (part_perms, perm)) { +if (debug) fprintf(stderr, signlevel=%d + x=%d, aclconfig_default_used=%d\n, +signlevel, x, aclconfig_default_used); if (signlevel == x) { if (strcmp(part_tag, ALL) != 0 - !aclconfig_default_used) + !aclconfig_default_used) { retval = 1; + if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); +} } else if (!aclconfig_default_used) { signlevel = x; retval = 1; +if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); } else { /* nothing... */ @@ -299,13 +309,20 @@ access_allowed (const char *file, const if (signlevel == x) { if (strcmp(part_tag, ALL) != 0 - !aclconfig_default_used) + !aclconfig_default_used) { retval = 0; + if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); +} } else if (!aclconfig_default_used) { signlevel = x; retval = 0; +if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); if (strncmp (part_type, f, 1) == 0) founddeniedfile = 1; @@ -334,11 +351,18 @@ access_allowed (const char *file, const if (valid_perm (part_perms, perm)) { retval = 1; + if (debug) fprintf(stderr, +%s, %d: %d\n, __FILE__, __LINE__, +retval); if (perm == 8) dadmin = 1; } - else + else { retval = 0; + if (debug) fprintf(stderr, +%s, %d: %d\n, __FILE__, __LINE__, +retval); + } } } @@ -353,10 +377,17 @@ access_allowed (const char *file, const { if (debug) fprintf(stderr, not found line\n); /* DEFAULT */ - if (valid_perm (NULL, perm)) + if (valid_perm (NULL, perm)) { retval = 1; - else + if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); + } else { retval = 0; + if (debug) fprintf(stderr, + %s, %d: %d\n, __FILE__, __LINE__, + retval); + } } /* acl admin rigths 'p' */ @@ -491,7 +522,7 @@ get_perms (const char *part_perms) aclconfig_default_used = 1; if (debug) fprintf (stderr, default %s\n, cvs_acl_default_permissions); - return (cvs_acl_default_permissions); + return xstrdup(cvs_acl_default_permissions); } else { if (debug) fprintf (stderr, early %s\n, xperms);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Sep 13 17:45:07 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: server.c Log Message: Don't fail if we don't have a current_parsed_root, makes: 'echo version | cvs server' work again. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/server.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/server.c diff -u src/external/gpl2/xcvs/dist/src/server.c:1.4 src/external/gpl2/xcvs/dist/src/server.c:1.5 --- src/external/gpl2/xcvs/dist/src/server.c:1.4 Thu Mar 8 15:41:48 2012 +++ src/external/gpl2/xcvs/dist/src/server.c Thu Sep 13 13:45:07 2012 @@ -582,8 +582,6 @@ supported_response (char *name) static inline bool isProxyServer (void) { -assert (current_parsed_root); - /*** *** The following is done as a series of if/return combinations an an *** optimization. @@ -595,7 +593,7 @@ isProxyServer (void) if (!config || !config-PrimaryServer) return false; /* The directory must not match for all methods. */ -if (!isSamePath (config-PrimaryServer-directory, +if (current_parsed_root !isSamePath (config-PrimaryServer-directory, current_parsed_root-directory)) return true;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 22 20:49:55 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: sanity.sh Log Message: From Garo Taft: - Add a -w flag which will make the sanity script sleep for a second before and after checkouts, commits, and updates. - Fix expected output to look for the right default action on empty log message. It's now abort. - Add new requests Checkin-prog and Update-prog to expectation values. - Add new access�and group files to CVSROOT admin database expectation values. - All tests pass except client-20, which hangs. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/sanity.sh 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/sanity.sh diff -u src/external/gpl2/xcvs/dist/src/sanity.sh:1.2 src/external/gpl2/xcvs/dist/src/sanity.sh:1.3 --- src/external/gpl2/xcvs/dist/src/sanity.sh:1.2 Thu Mar 8 15:42:21 2012 +++ src/external/gpl2/xcvs/dist/src/sanity.sh Thu Mar 22 16:49:53 2012 @@ -22,7 +22,7 @@ usage () { echo Usage: `basename $0` --help -echo Usage: `basename $0` [--eklr] [-c CONFIG-FILE] [-f FROM-TEST] \\ +echo Usage: `basename $0` [--eklrw] [-c CONFIG-FILE] [-f FROM-TEST] \\ echo [-h HOSTNAME] [-s CVS-FOR-CVS-SERVER] CVS-TO-TEST \\ echo [TESTS-TO-RUN...] } @@ -69,6 +69,11 @@ exit_help () echo -p|--proxy test a secondary/primary CVS server (writeproxy) echo configuration (implies --remote). echo -r|--remote test client/server, as opposed to local, CVS +echo -w|--wait automatically sleep for a second before and after +echo checkouts, commits, and updates. Use this option +echo if you have fast cores and a slow disk. (For example, +echo you may need this flag if you see tests fail because +echo they think they have nothing to commit.) echo -s CVS-FOR-CVS-SERVER echo --server=CVS-FOR-CVS-SERVER echo use CVS-FOR-CVS-SERVER as the path to the CVS SERVER @@ -132,7 +137,8 @@ proxy=false remote=false servercvs=false skipfail=false -while getopts Hc:ef:h:klnprs:-: option ; do +waitforslowdisk=false +while getopts Hc:ef:h:klnprs:w-: option ; do # convert the long opts to short opts if test x$option = x-; then # remove any argument @@ -198,6 +204,10 @@ while getopts Hc:ef:h:klnprs:-: option ; option=e OPTARG= ;; + w|wa|wai|wait) + option=w + OPTARG= + ;; *) option=\? OPTARG= @@ -250,6 +260,9 @@ while getopts Hc:ef:h:klnprs:-: option ; servercvs=$OPTARG remote=: ;; + w) + waitforslowdisk=: + ;; \?) exit_usage ;; @@ -1488,6 +1501,17 @@ run_filter () fi } +maybe_sleep_if_ci_co_or_up () +{ + if $waitforslowdisk; then +case $@ in +* ci *|* ci|* commit *|* commit) sleep 1;; +* co *|* co|* checkout *|* checkout) sleep 1;; +* up *|* up|* update *|* update) sleep 1;; +esac + fi +} + # Usage: # dotest TESTNAME COMMAND OUTPUT [OUTPUT2] # TESTNAME is the name used in the log to identify the test. @@ -1503,6 +1527,7 @@ run_filter () # lack \|). dotest () { + maybe_sleep_if_ci_co_or_up $2 rm -f $TESTDIR/dotest.ex? 21 eval $2 $TESTDIR/dotest.tmp 21 status=$? @@ -1512,12 +1537,14 @@ dotest () echo exit status was $status ${LOGFILE} fail $1 fi + maybe_sleep_if_ci_co_or_up $2 dotest_internal $@ } # Like dotest except only 2 args and result must exactly match stdin dotest_lit () { + maybe_sleep_if_ci_co_or_up $2 rm -f $TESTDIR/dotest.ex? 21 eval $2 $TESTDIR/dotest.tmp 21 status=$? @@ -1527,6 +1554,7 @@ dotest_lit () echo exit status was $status $LOGFILE fail $1 fi + maybe_sleep_if_ci_co_or_up $2 cat $TESTDIR/dotest.exp if cmp $TESTDIR/dotest.exp $TESTDIR/dotest.tmp /dev/null 21; then pass $1 @@ -1543,6 +1571,7 @@ dotest_lit () # Like dotest except exitstatus should be nonzero. dotest_fail () { + maybe_sleep_if_ci_co_or_up $2 rm -f $TESTDIR/dotest.ex? 21 eval $2 $TESTDIR/dotest.tmp 21 status=$? @@ -1552,12 +1581,14 @@ dotest_fail () echo exit status was $status $LOGFILE fail $1 fi + maybe_sleep_if_ci_co_or_up $2 dotest_internal $@ } # Like dotest except output is sorted. dotest_sort () { + maybe_sleep_if_ci_co_or_up $2 rm -f $TESTDIR/dotest.ex? 21 eval $2 $TESTDIR/dotest.tmp1 21 status=$? @@ -1568,12 +1599,14 @@ dotest_sort () fail $1 fi $TR ' ' ' ' $TESTDIR/dotest.tmp1 | sort $TESTDIR/dotest.tmp + maybe_sleep_if_ci_co_or_up $2 dotest_internal $@ } # Like dotest_fail except output is sorted. dotest_fail_sort () { + maybe_sleep_if_ci_co_or_up $2 rm -f $TESTDIR/dotest.ex? 21 eval $2 $TESTDIR/dotest.tmp1 21 status=$? @@ -1584,6 +1617,7 @@ dotest_fail_sort () fail $1 fi $TR ' ' ' '
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Tue Mar 13 17:12:30 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: mkmodules.c Log Message: Entries to the file contents need to be NULL terminated. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 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.5 src/external/gpl2/xcvs/dist/src/mkmodules.c:1.6 --- src/external/gpl2/xcvs/dist/src/mkmodules.c:1.5 Thu Mar 8 15:45:28 2012 +++ src/external/gpl2/xcvs/dist/src/mkmodules.c Tue Mar 13 13:12:30 2012 @@ -99,6 +99,7 @@ static const char *const access_contents }; static const char *const group_contents[] = { + NULL }; /* Structure which describes an administrative file. */
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Fri Mar 9 15:24:34 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: acl.c Log Message: remove statement with no effect. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/acl.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/acl.c diff -u src/external/gpl2/xcvs/dist/src/acl.c:1.2 src/external/gpl2/xcvs/dist/src/acl.c:1.3 --- src/external/gpl2/xcvs/dist/src/acl.c:1.2 Thu Mar 8 15:37:29 2012 +++ src/external/gpl2/xcvs/dist/src/acl.c Fri Mar 9 10:24:34 2012 @@ -208,7 +208,7 @@ access_allowed (const char *file, const dirs[intcount] = xstrdup(filefullname); } -for (accessfilecount; accessfilecount = 0 flag; accessfilecount--) +for (; accessfilecount = 0 flag; accessfilecount--) { if (!use_separate_acl_file_for_each_dir) { flag = 0;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:32:18 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: version.c Log Message: announce acl support To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/version.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/version.c diff -u src/external/gpl2/xcvs/dist/src/version.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/version.c:1.2 --- src/external/gpl2/xcvs/dist/src/version.c:1.1.1.1 Tue Apr 7 18:10:29 2009 +++ src/external/gpl2/xcvs/dist/src/version.c Thu Mar 8 15:32:18 2012 @@ -30,7 +30,9 @@ char *config_string = \n; #endif #endif - +/* cvsacl patch */ +static const char aclpatch_string[] = +with CVSACL Patch 1.2.5 (cvsacl.sourceforge.net)\n; static const char *const version_usage[] = { @@ -63,6 +65,8 @@ version (int argc, char **argv) released. */ (void) fputs (PACKAGE_STRING, stdout); (void) fputs (config_string, stdout); +/* cvsacl patch */ +(void) fputs (aclpatch_string, stdout); #ifdef CLIENT_SUPPORT if (current_parsed_root current_parsed_root-isremote)
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:32:31 UTC 2012 Added Files: src/external/gpl2/xcvs/dist/src: acl.c Log Message: acl support To generate a diff of this commit: cvs rdiff -u -r0 -r1.1 src/external/gpl2/xcvs/dist/src/acl.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. Added files: Index: src/external/gpl2/xcvs/dist/src/acl.c diff -u /dev/null src/external/gpl2/xcvs/dist/src/acl.c:1.1 --- /dev/null Thu Mar 8 15:32:31 2012 +++ src/external/gpl2/xcvs/dist/src/acl.c Thu Mar 8 15:32:31 2012 @@ -0,0 +1,2162 @@ +/* + * Copyright (C) 2006 The Free Software Foundation, Inc. + * + * Portions Copyright (C) 2006, Baris Sahin sbaris at users.sourceforge.net + * http://cvsacl.sourceforge.net + * + * + * You may distribute under the terms of the GNU General Public License as + * specified in the README file that comes with the CVS source distribution. + * + * + * + * CVS ACCESS CONTROL LIST EXTENSION + * + * It provides advanced access control definitions per modules, + * directories, and files on branch/tag for remote cvs repository + * connections.Execution of all CVS subcommands can be controlled + * with eight different permissions. + * + * Permission Types: + * - no permission (n) (1) + * - all permissions(a) (2) + * - write permission (w) (3) + * - tag permission (t) (4) + * - read permission(r) (5) + * - add permission (c) (6) + * - remove permission (d) (7) + * - permission change (p) (8) + * + */ +#include cvs.h +#include getline.h +#include grp.h + +#define free(x) (void)(x) + +static int acl_fileproc (void *callerdat, struct file_info *finfo); + +static Dtype acl_dirproc (void *callerdat, const char *dir, const char *repos, + const char *update_dir, List *entries); + +static int acllist_fileproc (void *callerdat, struct file_info *finfo); +static Dtype acllist_dirproc (void *callerdat, const char *dir, + const char *repos, const char *update_dir, + List *entries); + +static void acllist_print (char *line, const char *obj); + +static int racl_proc (int argc, char **argv, char *xwhere, + char *mwhere, char *mfile, int shorten, + int local_specified, char *mname, char *msg); + +static FILE *open_accessfile (char *xmode, const char *repos, char **fname); +static FILE *open_groupfile (char *xmode); + +static char *get_perms (const char *xperms); +static char *make_perms (char *xperms, char *xfounduserpart, char **xerrmsg); + +static char *findusername (const char *string1, const char *string2); +static char *findgroupname (const char *string1, const char *string2); +static int valid_tag (const char *part_tag, const char *tag); +static int valid_perm (const char *part_perms, int perm); +static int write_perms (const char *user, const char *perms, + const char *founduserpart, int foundline, + char *otheruserparts, const char *part_type, + const char *part_object, const char *part_tag, int pos, + const char *arepos); + +static char *cache_repository; +static int cache_retval; +static int founddeniedfile; +static int cache_perm; + +static int is_racl; +static int debug = 0; + +int use_cvs_acl = 0; +char *cvs_acl_default_permissions; +int use_cvs_groups = 0; +int use_system_groups = 0; +int use_separate_acl_file_for_each_dir = 0; +char *cvs_acl_file_location = NULL; +char *cvs_groups_file_location = NULL; +char *cvs_server_run_as = NULL; +int stop_at_first_permission_denied = 0; + +char *tag = NULL; + +char *muser; +char *mperms; +static int defaultperms; + +static char *default_perms_object; +char *default_part_perms_accessfile; +int aclconfig_default_used; + +int acldir = 0; +int aclfile = 0; +int listacl = 0; + +int userfound = 0; +int groupfound = 0; + +/* directory depth ... */ +char *dirs[255]; + +static const char *const acl_usage[] = +{ +Usage: %s %s [user||group:permissions] [-Rl] [-r tag] [directories...] [files...]\n, +\t-R\tProcess directories recursively.\n, +\t-r rev\tExisting revision/tag.\n, +\t-l\tList defined ACLs.\n, +(Specify the --help global option for a list of other help options)\n, +NULL +}; + +static const char *const racl_usage[] = +{ +Usage: %s %s [user||group:permissions] [-Rl] [-r tag] [directories...] + [files...]\n, +\t-R\tProcess directories recursively.\n, +\t-r rev\tExisting revision/tag.\n, +\t-l\tList defined ACLs.\n, +(Specify the --help global option for a list of other help options)\n, +NULL +}; + + +int +access_allowed (const char *file, const char *repos, const char *tag, + int perm, char **mline, int *mpos, int usecache) +{ +int retval = 0; +int foundline = 0; +FILE *accessfp; + +int flag = 1; + +char *iline; +char *tempv; +char *tempc; +size_t tempsize; + +int
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:33:02 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: update.c Log Message: - acl support - check chdir return To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/update.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/update.c diff -u src/external/gpl2/xcvs/dist/src/update.c:1.3 src/external/gpl2/xcvs/dist/src/update.c:1.4 --- src/external/gpl2/xcvs/dist/src/update.c:1.3 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/update.c Thu Mar 8 15:33:02 2012 @@ -596,6 +596,25 @@ update_fileproc (void *callerdat, struct status = Classify_File (finfo, tag, date, options, force_tag_match, aflag, vers, pipeout); +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, vers-tag, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } +} +#endif + /* Keep track of whether TAG is a branch tag. Note that if it is a branch tag in some files and a nonbranch tag in others, treat it as a nonbranch tag. */ @@ -1039,7 +1058,8 @@ update_dirleave_proc (void *callerdat, c { /* FIXME: chdir (..) loses with symlinks. */ /* Prune empty dirs on the way out - if necessary */ - (void) CVS_CHDIR (..); + if (CVS_CHDIR (..) == -1) + error (0, errno, Cannot chdir to ..); if (update_prune_dirs isemptydir (dir, 0)) { /* I'm not sure the existence_error is actually possible (except
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:34:35 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: tag.c Log Message: - restrict tag command to non-destructive operations for non-admins. [deletion, moving is dissallowed] - add history for tag commands - cvs acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/tag.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/tag.c diff -u src/external/gpl2/xcvs/dist/src/tag.c:1.2 src/external/gpl2/xcvs/dist/src/tag.c:1.3 --- src/external/gpl2/xcvs/dist/src/tag.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/tag.c Thu Mar 8 15:34:35 2012 @@ -18,6 +18,7 @@ */ #include cvs.h +#include grp.h #include save-cwd.h static int rtag_proc (int argc, char **argv, char *xwhere, @@ -106,15 +107,17 @@ static const char *const tag_usage[] = NULL }; - +char *UserTagOptions = bcflRrD; int cvstag (int argc, char **argv) { +struct group *grp; bool local = false; /* recursive by default */ int c; int err = 0; bool run_module_prog = true; +int only_allowed_options; is_rtag = (strcmp (cvs_cmd_name, rtag) == 0); @@ -122,8 +125,11 @@ cvstag (int argc, char **argv) usage (is_rtag ? rtag_usage : tag_usage); getoptreset (); +only_allowed_options = 1; while ((c = getopt (argc, argv, is_rtag ? rtag_opts : tag_opts)) != -1) { + if (!strchr(UserTagOptions, c)) + only_allowed_options = 0; switch (c) { case 'a': @@ -193,6 +199,42 @@ cvstag (int argc, char **argv) error (0, 0, warning: -b ignored with -d options); RCS_check_tag (symtag); +#ifdef CVS_ADMIN_GROUP +if (!only_allowed_options + (grp = getgrnam(CVS_ADMIN_GROUP)) != NULL) +{ +#ifdef HAVE_GETGROUPS + gid_t *grps; + int i, n; + + /* get number of auxiliary groups */ + n = getgroups (0, NULL); + if (n 0) + error (1, errno, unable to get number of auxiliary groups); + grps = (gid_t *) xmalloc((n + 1) * sizeof *grps); + n = getgroups (n, grps); + if (n 0) + error (1, errno, unable to get list of auxiliary groups); + grps[n] = getgid(); + for (i = 0; i = n; i++) + if (grps[i] == grp-gr_gid) break; + free (grps); + if (i n) + error (1, 0, usage is restricted to members of the group %s, + CVS_ADMIN_GROUP); +#else + char *me = getcaller(); + char **grnam; + + for (grnam = grp-gr_mem; *grnam; grnam++) + if (strcmp (*grnam, me) == 0) break; + if (!*grnam getgid() != grp-gr_gid) + error (1, 0, usage is restricted to members of the group %s, + CVS_ADMIN_GROUP); +#endif +} +#endif /* defined CVS_ADMIN_GROUP */ + #ifdef CLIENT_SUPPORT if (current_parsed_root-isremote) { @@ -271,6 +313,13 @@ cvstag (int argc, char **argv) } else { + int i; + for (i = 0; i argc; i++) + { + /* XXX last arg should be repository, but doesn't make sense here */ + history_write ('T', (delete_flag ? D : (numtag ? numtag : + (date ? date : A))), symtag, argv[i], ); + } err = rtag_proc (argc + 1, argv - 1, NULL, NULL, NULL, 0, local, NULL, NULL); } @@ -948,6 +997,25 @@ rtag_fileproc (void *callerdat, struct f * correctly without breaking your link! */ +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, numtag, 4, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } +} +#endif + if (delete_flag) { retval = rtag_delete (rcsfile); @@ -1167,6 +1235,21 @@ tag_fileproc (void *callerdat, struct fi if (!nversion) goto free_vars_and_return; } + +/* cvsacl patch */ +#ifdef SERVER_SUPPORT + if (use_cvs_acl /* server_active */) + { + if (!access_allowed (finfo-file, finfo-repository, vers-tag, 4, + NULL, NULL, 1)) + { + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + return (0); + } +} +#endif + if (delete_flag) {
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:37:29 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: acl.c Log Message: fix malloc botches in the original code To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/external/gpl2/xcvs/dist/src/acl.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/acl.c diff -u src/external/gpl2/xcvs/dist/src/acl.c:1.1 src/external/gpl2/xcvs/dist/src/acl.c:1.2 --- src/external/gpl2/xcvs/dist/src/acl.c:1.1 Thu Mar 8 15:32:31 2012 +++ src/external/gpl2/xcvs/dist/src/acl.c Thu Mar 8 15:37:29 2012 @@ -32,8 +32,6 @@ #include getline.h #include grp.h -#define free(x) (void)(x) - static int acl_fileproc (void *callerdat, struct file_info *finfo); static Dtype acl_dirproc (void *callerdat, const char *dir, const char *repos, @@ -488,7 +486,7 @@ get_perms (const char *part_perms) /* no defined acl, no default acl in access file, * or no access file at all */ if (part_perms == NULL) { -if (cvs_acl_default_permissions) + if (cvs_acl_default_permissions) { aclconfig_default_used = 1; if (debug) fprintf (stderr, default %s\n, @@ -515,10 +513,12 @@ check_default: usr = strtok (founduser, !\t); per = strtok (NULL, ,\t); + free(xperms); xperms = xstrdup (per); xperms_len = strlen (xperms); userfound = 1; + free (founduser); } else { @@ -548,6 +548,7 @@ check_default: xrealloc_and_strcat (xperms, xperms_len, gperm); groupfound = 1; + free (grp); } } } @@ -566,19 +567,23 @@ check_default: while ((read = getline (line, line_allocated, groupfp)) = 0) { + char *user; if (line[0] == '#' || line[0] == '\0' || line[0] == '\n') continue; if (line[read - 1] == '\n') line[--read] = '\0'; - if (grp = findusername (part_perms, - findgroupname (line, username))) + if ((grp = findgroupname (line, username)) + (user = findusername (part_perms, grp))) + { - gperm = strtok (grp, !\t); + gperm = strtok (user, !\t); gperm = strtok (NULL, ,\t); xrealloc_and_strcat (xperms, xperms_len, gperm); groupfound = 1; + free (grp); + free (user); } } @@ -607,8 +612,6 @@ check_default: xperms_len = strlen (xperms); } - free(foundall); - /* You don't free pointers from strtok()! */ //free(usr); //free(per); @@ -819,7 +822,7 @@ racl_proc (int argc, char **argv, char * char *myargv[2]; int err = 0; int which; -char *repository = NULL; +char *repository; char *where; char *obj; size_t objlen = 0; @@ -832,11 +835,10 @@ racl_proc (int argc, char **argv, char * if (is_racl) { + char *v; repository = Xasprintf (%s/%s, current_parsed_root-directory, argv[0]); - where = xmalloc (strlen (argv[0]) + (mfile == NULL ? 0 : - strlen (mfile) + 1) + 1); - (void) strcpy (where, argv[0]); + where = xstrdup (argv[0]); /* if mfile isn't null, we need to set up to do only part of the * module */ @@ -850,10 +852,12 @@ racl_proc (int argc, char **argv, char * if ((cp = strrchr (mfile, '/')) != NULL) { *cp = '\0'; - (void) strcat (repository, /); - (void) strcat (repository, mfile); - (void) strcat (where, /); - (void) strcat (where, mfile); + v = Xasprintf (%s/%s, repository, mfile); + free (repository); + repository = v; + v = Xasprintf (%s/%s, where, mfile); + free(where); + where = v; mfile = cp + 1; } @@ -862,18 +866,20 @@ racl_proc (int argc, char **argv, char * if (isdir (path)) { /* directory means repository gets the dir tacked on */ - (void) strcpy (repository, path); - (void) strcat (where, /); - (void) strcat (where, mfile); + free(repository); + repository = path; + v = Xasprintf (%s/%s, where, mfile); + free(where); + where = v; } else { + free (path); myargv[0] = argv[0]; myargv[1] = mfile; argc = 2; argv = myargv; } - free (path); } /* cd to the starting repository */ @@ -901,6 +907,7 @@ racl_proc (int argc, char **argv, char * else { where = NULL; + repository = NULL; which = W_LOCAL | W_REPOS | W_ATTIC; obj = xstrdup (argv[1]); @@ -918,14 +925,16 @@ racl_proc (int argc, char **argv, char * if (listacl) err = start_recursion (acllist_fileproc, NULL, acllist_dirproc, NULL, NULL, argc - 1, argv + 1, local, which, 0, 0, - (char *) where, 1, repository); + where, 1, repository); else err = start_recursion (acl_fileproc, NULL, acl_dirproc, NULL, NULL, argc - 1, argv + 1, local, which, 0, 0, - (char *) where, 1, repository); + where, 1, repository); if (repository != NULL) free (repository); +if (where != NULL) + free (where); return err; } @@
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:39:28 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: Makefile.am Log Message: add acl.c To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/Makefile.am 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/Makefile.am diff -u src/external/gpl2/xcvs/dist/src/Makefile.am:1.1.1.1 src/external/gpl2/xcvs/dist/src/Makefile.am:1.2 --- src/external/gpl2/xcvs/dist/src/Makefile.am:1.1.1.1 Tue Apr 7 18:10:23 2009 +++ src/external/gpl2/xcvs/dist/src/Makefile.am Thu Mar 8 15:39:28 2012 @@ -26,6 +26,7 @@ bin_SCRIPTS = cvsbug # The cvs executable cvs_SOURCES = \ + acl.c \ add.c \ admin.c \ annotate.c \
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:41:04 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: subr.c Log Message: - Put back %, which was removed from the new format strings [with reversed meaning, so that we are still compatible with the new format] - Fix format strings To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/subr.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/subr.c diff -u src/external/gpl2/xcvs/dist/src/subr.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/subr.c:1.2 --- src/external/gpl2/xcvs/dist/src/subr.c:1.1.1.1 Tue Apr 7 18:10:28 2009 +++ src/external/gpl2/xcvs/dist/src/subr.c Thu Mar 8 15:41:04 2012 @@ -1285,7 +1285,7 @@ format_cmdline (const char *format, ...) dellist(pflist); free(b); error (1, 0, -internal error: unknown integer arg size (%d), +internal error: unknown integer arg size (%zu), length); break; } @@ -1328,7 +1328,7 @@ format_cmdline (const char *format, ...) dellist(pflist); free(b); error (1, 0, -internal error: unknown floating point arg size (%d), +internal error: unknown floating point arg size (%zu), length); break; } @@ -1458,6 +1458,7 @@ format_cmdline (const char *format, ...) *output string into separate arguments * * %X means sub var X into location + * NB: The meaning of the following 2 formats is reversed in the new mode * %{VWXYZ} means sub V,W,X,Y,Z into location as a single arg. The shell *|| would be to quote the comma separated arguments. Each list *that V, W, X, Y, and Z represent attributes of will cause a new @@ -1567,6 +1568,12 @@ format_cmdline (const char *format, ...) } } #endif /* SUPPORT_OLD_INFO_FMT_STRINGS */ + if (*s == ',') { +#ifdef SUPPORT_OLD_INFO_FMT_STRINGS + if (!oldway) +#endif /* SUPPORT_OLD_INFO_FMT_STRINGS */ + s++, onearg = 1; + } /* parse the format string and sub in... */ if (*s == '{')
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:41:20 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: status.c Log Message: Add cvs acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/status.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/status.c diff -u src/external/gpl2/xcvs/dist/src/status.c:1.2 src/external/gpl2/xcvs/dist/src/status.c:1.3 --- src/external/gpl2/xcvs/dist/src/status.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/status.c Thu Mar 8 15:41:20 2012 @@ -127,6 +127,26 @@ status_fileproc (void *callerdat, struct Node *node; status = Classify_File (finfo, NULL, NULL, NULL, 1, 0, vers, 0); + +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, vers-tag, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } +} +#endif + sstat = Classify Error; switch (status) {
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:41:48 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: server.c Log Message: - check return value of write(2) - add acl support To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/server.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/server.c diff -u src/external/gpl2/xcvs/dist/src/server.c:1.3 src/external/gpl2/xcvs/dist/src/server.c:1.4 --- src/external/gpl2/xcvs/dist/src/server.c:1.3 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/server.c Thu Mar 8 15:41:48 2012 @@ -692,7 +692,8 @@ error ENOMEM Virtual memory exhausted.\n */ /* If this gives an error, not much we could do. syslog() it? */ -write (STDOUT_FILENO, msg, sizeof (msg) - 1); +if (write (STDOUT_FILENO, msg, sizeof (msg) - 1) == -1) + exit(EXIT_FAILURE); # ifdef HAVE_SYSLOG_H syslog (LOG_DAEMON | LOG_ERR, virtual memory exhausted); # endif /* HAVE_SYSLOG_H */ @@ -977,12 +978,16 @@ error ENOMEM Virtual memory exhausted.\n if (forced !quiet alloc_pending_warning (120 + strlen (program_name))) sprintf (pending_warning_text, -E %s server: Forcing compression level %d (allowed: %d = z = %d)., +E %s server: Forcing compression level %d (allowed: %zu = z = %zu)., program_name, gzip_level, config-MinCompressionLevel, config-MaxCompressionLevel); } -if (!nolock) { +/* cvsacl patch */ +parse_aclconfig (current_parsed_root-directory); + +if (!nolock) +{ path = xmalloc (strlen (current_parsed_root-directory) + sizeof (CVSROOTADM) + 2); @@ -4623,7 +4628,20 @@ serve_rls (char *arg) do_cvs_command (rls, ls); } - +/* cvsacl patch */ +static void +serve_acl (char *arg) +{ +do_cvs_command (acl, cvsacl); +} + +/* cvsacl patch */ +static void +serve_racl (char *arg) +{ +cvs_cmd_name = racl; +do_cvs_command (racl, cvsacl); +} static void serve_add (char *arg) @@ -5488,7 +5506,7 @@ serve_gzip_contents (char *arg) if (forced !quiet alloc_pending_warning (120 + strlen (program_name))) sprintf (pending_warning_text, -E %s server: Forcing compression level %d (allowed: %d = z = %d)., +E %s server: Forcing compression level %d (allowed: %zu = z = %zu)., program_name, level, config-MinCompressionLevel, config-MaxCompressionLevel); @@ -5519,7 +5537,7 @@ serve_gzip_stream (char *arg) if (forced !quiet alloc_pending_warning (120 + strlen (program_name))) sprintf (pending_warning_text, -E %s server: Forcing compression level %d (allowed: %d = z = %d)., +E %s server: Forcing compression level %d (allowed: %zu = z = %zu)., program_name, level, config-MinCompressionLevel, config-MaxCompressionLevel); @@ -5936,6 +5954,11 @@ struct request requests[] = REQ_LINE(diff, serve_diff, 0), REQ_LINE(log, serve_log, 0), REQ_LINE(rlog, serve_rlog, 0), + + /* cvsacl patch */ + REQ_LINE(acl, serve_acl, 0), + REQ_LINE(racl, serve_racl, 0), + REQ_LINE(list, serve_ls, 0), REQ_LINE(rlist, serve_rls, 0), /* This allows us to avoid sending `-q' as a command argument to `cvs ls', @@ -6232,7 +6255,8 @@ server_cleanup (void) /* Make sure our working directory isn't inside the tree we're going to delete. */ - CVS_CHDIR (get_cvs_tmp_dir ()); + if (CVS_CHDIR (get_cvs_tmp_dir ()) == -1) + error (0, errno, Cannot chdir to `%s', get_cvs_tmp_dir ()); /* Temporarily clear noexec, so that we clean up our temp directory regardless of it (this could more cleanly be handled by moving @@ -6553,6 +6577,10 @@ switch_to_user (const char *cvs_username } #endif +/* cvsacl patch */ +if (use_cvs_acl cvs_server_run_as) + username = cvs_server_run_as; + pw = getpwnam (username); if (pw == NULL) { @@ -7252,6 +7280,9 @@ pserver_authenticate_connection (void) in a new CVSROOT/config file to fix the broken one! */ config = get_root_allow_config (repository, gConfigPath); +/* cvsacl patch */ +parse_aclconfig (repository); + /* We need the real cleartext before we hash it. */ descrambled_password = descramble (password); host_user = check_password (username, descrambled_password, repository);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:42:21 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: sanity.sh Log Message: attempt to fix the unit tests To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/sanity.sh 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/sanity.sh diff -u src/external/gpl2/xcvs/dist/src/sanity.sh:1.1.1.1 src/external/gpl2/xcvs/dist/src/sanity.sh:1.2 --- src/external/gpl2/xcvs/dist/src/sanity.sh:1.1.1.1 Tue Apr 7 18:10:33 2009 +++ src/external/gpl2/xcvs/dist/src/sanity.sh Thu Mar 8 15:42:21 2012 @@ -2801,7 +2801,7 @@ for what in $tests; do # so we might as well test it dotest version-1 ${testcvs} --version \ ' -Concurrent Versions System (CVS) [0-9.]*.* +Concurrent Versions System (CVS) [0-9.]*.*with CVSACL Patch [0-9.]*.* Copyright (C) [0-9]* Free Software Foundation, Inc. @@ -2823,7 +2823,9 @@ Specify the --help option for further in if $remote; then dotest version-2r ${testcvs} version \ 'Client: Concurrent Versions System (CVS) [0-9p.]* (client.*) -Server: Concurrent Versions System (CVS) [0-9p.]* (.*server)' +with CVSACL Patch [0-9p.]* (.*) +Server: Concurrent Versions System (CVS) [0-9p.]* (.*server) +with CVSACL Patch [0-9p.]* (.*)' else dotest version-2 ${testcvs} version \ 'Concurrent Versions System (CVS) [0-9.]*.*' @@ -3328,9 +3330,9 @@ ${SPROG} \[admin aborted\]: attempt to d # lib/getopt.c will use POSIX when __posixly_correct # otherwise the other, so accept both of them. -- mdb dotest_fail basicb-21 ${testcvs} -q admin -H \ -admin: invalid option -- H +admin: invalid option -- '*H'* ${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information \ -admin: illegal option -- H +admin: illegal option -- '*H'* ${CPROG} \[admin aborted\]: specify ${CPROG} -H admin for usage information cd .. rmdir 1 @@ -4637,6 +4639,7 @@ A [0-9-]* [0-9:]* ${PLUS} ${username A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file7 first-dir/dir1 == ${TESTDIR} A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file6 first-dir/dir1/dir2 == ${TESTDIR} A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file7 first-dir/dir1/dir2 == ${TESTDIR} +T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[second-dive:A\] A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file14first-dir == ${TESTDIR} M [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file6 first-dir == ${TESTDIR} R [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file7 first-dir == ${TESTDIR} @@ -4646,6 +4649,7 @@ R [0-9-]* [0-9:]* ${PLUS} ${username A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file14first-dir/dir1/dir2 == ${TESTDIR} M [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file6 first-dir/dir1/dir2 == ${TESTDIR} R [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file7 first-dir/dir1/dir2 == ${TESTDIR} +T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[third-dive:A\] F [0-9-]* [0-9:]* ${PLUS} ${username} =first-dir= ${TESTDIR}/\* T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[rtagged-by-head:A\] T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[rtagged-by-tag:rtagged-by-head\] @@ -4660,6 +4664,7 @@ A [0-9-]* [0-9:]* ${PLUS} ${username A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file7 first-dir/dir1 == remote A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file6 first-dir/dir1/dir2 == remote A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file7 first-dir/dir1/dir2 == remote +T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[second-dive:A\] A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file14first-dir == remote M [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file6 first-dir == remote R [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file7 first-dir == remote @@ -4669,6 +4674,7 @@ R [0-9-]* [0-9:]* ${PLUS} ${username A [0-9-]* [0-9:]* ${PLUS} ${username} 1\.1 file14first-dir/dir1/dir2 == remote M [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file6 first-dir/dir1/dir2 == remote R [0-9-]* [0-9:]* ${PLUS} ${username} 1\.2 file7 first-dir/dir1/dir2 == remote +T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[third-dive:A\] F [0-9-]* [0-9:]* ${PLUS} ${username} =first-dir= remote/\* T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[rtagged-by-head:A\] T [0-9-]* [0-9:]* ${PLUS} ${username} first-dir \[rtagged-by-tag:rtagged-by-head\] @@ -4692,7 +4698,8 @@ W [0-9-]* [0-9:]* ${PLUS} ${username dotest ls-init-1 $testcvs -Q co -dtop . cd top dotest ls-1 $testcvs ls CVSROOT \ -checkoutlist +aclconfig +checkoutlist commitinfo config cvswrappers @@ -4712,6 +4719,7 @@ verifymsg CVSROOT CVSROOT: +aclconfig
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:42:57 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: recurse.c Log Message: restore lost fix: add nolock To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/recurse.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/recurse.c diff -u src/external/gpl2/xcvs/dist/src/recurse.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/recurse.c:1.2 --- src/external/gpl2/xcvs/dist/src/recurse.c:1.1.1.1 Tue Apr 7 18:10:27 2009 +++ src/external/gpl2/xcvs/dist/src/recurse.c Thu Mar 8 15:42:56 2012 @@ -619,7 +619,7 @@ do_recursion (struct recursion_frame *fr if (frame-flags == R_SKIP_ALL) return 0; -locktype = noexec ? CVS_LOCK_NONE : frame-locktype; +locktype = (nolock || noexec) ? CVS_LOCK_NONE : frame-locktype; /* The fact that locks are not active here is what makes us fail to have the
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:43:19 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: rcs.c Log Message: use the result of strtoul To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/rcs.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/rcs.c diff -u src/external/gpl2/xcvs/dist/src/rcs.c:1.4 src/external/gpl2/xcvs/dist/src/rcs.c:1.5 --- src/external/gpl2/xcvs/dist/src/rcs.c:1.4 Tue Apr 21 14:43:52 2009 +++ src/external/gpl2/xcvs/dist/src/rcs.c Thu Mar 8 15:43:19 2012 @@ -823,7 +823,7 @@ warning: duplicate key `%s' in version ` error (1, 0, \ unrecognized operation '\\x%x' in %s, op, rcs-print_path); - (void) strtoul (cp, (char **) cp, 10); + count = strtoul (cp, (char **) cp, 10); if (*cp++ != ' ') error (1, 0, space expected in %s revision %s, rcs-print_path, vnode-version);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:43:48 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: patch.c Log Message: - better handling of binary files - add acl support To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.6 src/external/gpl2/xcvs/dist/src/patch.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/patch.c diff -u src/external/gpl2/xcvs/dist/src/patch.c:1.5 src/external/gpl2/xcvs/dist/src/patch.c:1.6 --- src/external/gpl2/xcvs/dist/src/patch.c:1.5 Sat Sep 24 08:02:58 2011 +++ src/external/gpl2/xcvs/dist/src/patch.c Thu Mar 8 15:43:48 2012 @@ -498,6 +498,43 @@ patch_fileproc (void *callerdat, struct goto out2; } +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (rev1) + { + if (!access_allowed (finfo-file, finfo-repository, rev1, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } + } + if (rev2) + { + if (!access_allowed (finfo-file, finfo-repository, rev2, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } + } +} +#endif + /* Create 3 empty files. I'm not really sure there is any advantage * to doing so now rather than just waiting until later. * @@ -619,14 +656,18 @@ patch_fileproc (void *callerdat, struct if (getline (line1, line1_chars_allocated, fp) 0 || getline (line2, line2_chars_allocated, fp) 0) { - if (feof (fp)) - error (0, 0, \ + if (line1 strncmp(Binary files , line1, 13) == 0) { + cvs_output (Binary files are different\n, 0); + } else { + if (feof (fp)) + error (0, 0, \ failed to read diff file header %s for %s: end of file, tmpfile3, rcs); - else - error (0, errno, - failed to read diff file header %s for %s, - tmpfile3, rcs); - ret = 1; + else + error (0, errno, + failed to read diff file header %s for %s, + tmpfile3, rcs); + ret = 1; + } if (fclose (fp) 0) error (0, errno, error closing %s, tmpfile3); goto out;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:44:06 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: parseinfo.c Log Message: add acl function prototype To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/parseinfo.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/parseinfo.c diff -u src/external/gpl2/xcvs/dist/src/parseinfo.c:1.2 src/external/gpl2/xcvs/dist/src/parseinfo.c:1.3 --- src/external/gpl2/xcvs/dist/src/parseinfo.c:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/parseinfo.c Thu Mar 8 15:44:06 2012 @@ -250,7 +250,7 @@ readSizeT (const char *infopath, const c infopath, option, p[strlen(p)]); return false; } - TRACE (TRACE_DATA, readSizeT(): Found factor %u for %s, + TRACE (TRACE_DATA, readSizeT(): Found factor %zu for %s, factor, option); } @@ -274,9 +274,9 @@ readSizeT (const char *infopath, const c /* Don't return an error, just max out. */ num = SIZE_MAX; -TRACE (TRACE_DATA, readSizeT(): read number %u for %s, num, option); +TRACE (TRACE_DATA, readSizeT(): read number %zu for %s, num, option); *val = xtimes (strtoul (p, NULL, 10), factor); -TRACE (TRACE_DATA, readSizeT(): returnning %u for %s, *val, option); +TRACE (TRACE_DATA, readSizeT(): returnning %zu for %s, *val, option); return true; } @@ -731,3 +731,191 @@ parse_config (const char *cvsroot, const return retval; } + +/* cvsacl patch */ +int +parse_aclconfig (const char *cvsroot) +{ +char *infopath; +FILE *fp_info; +char *line = NULL; +size_t line_allocated = 0; +size_t len; +char *p; +/* FIXME-reentrancy: If we do a multi-threaded server, this would need + to go to the per-connection data structures. */ +static int parsed = 0; + +/* Authentication code and serve_root might both want to call us. + Let this happen smoothly. */ +if (parsed) + return 0; +parsed = 1; + +infopath = xmalloc (strlen (cvsroot) + + sizeof (CVSROOTADM_ACLCONFIG) + + sizeof (CVSROOTADM) + + 10); +if (infopath == NULL) +{ + error (0, 0, out of memory; cannot allocate infopath); + goto error_return; +} + +strcpy (infopath, cvsroot); +strcat (infopath, /); +strcat (infopath, CVSROOTADM); +strcat (infopath, /); +strcat (infopath, CVSROOTADM_ACLCONFIG); + +fp_info = CVS_FOPEN (infopath, r); +if (fp_info == NULL) +{ + /* If no file, don't do anything special. */ + if (!existence_error (errno)) + { + /* Just a warning message; doesn't affect return + value, currently at least. */ + error (0, errno, cannot open %s, infopath); + } + free (infopath); + return 0; +} + +while (getline (line, line_allocated, fp_info) = 0) +{ + /* Skip comments. */ + if (line[0] == '#') + continue; + + len = strlen (line) - 1; + if (line[len] == '\n') + line[len] = '\0'; + + /* Skip blank lines. */ + if (line[0] == '\0') + continue; + + /* The first '=' separates keyword from value. */ + p = strchr (line, '='); + if (p == NULL) + { + /* Probably should be printing line number. */ + error (0, 0, syntax error in %s: line '%s' is missing '=', + infopath, line); + goto error_return; + } + + *p++ = '\0'; + + if (strcmp (line, UseCVSACL) == 0) + { + if (strcmp (p, no) == 0) + use_cvs_acl = 0; + else if (strcmp (p, yes) == 0) + use_cvs_acl = 1; + else + { + error (0, 0, unrecognized value '%s' for UseCVSACL, p); + goto error_return; + } + } + else if (strcmp (line, UseSeperateACLFileForEachDir) == 0) + { + if (strcmp (p, no) == 0) + use_separate_acl_file_for_each_dir = 0; + else if (strcmp (p, yes) == 0) + use_separate_acl_file_for_each_dir = 1; + else + { + error (0, 0, unrecognized value '%s' for UseSeperateACLFileForEachDir, p); + goto error_return; + } + } + else if (strcmp (line, StopAtFirstPermissionDenied) == 0) + { + if (strcmp (p, no) == 0) + stop_at_first_permission_denied = 0; + else if (strcmp (p, yes) == 0) + stop_at_first_permission_denied = 1; + else + { + error (0, 0, unrecognized value '%s' for StopAtFirstPermissionDenied, p); + goto error_return; + } + } + else if (strcmp (line, CVSACLDefaultPermissions) == 0) + { + if (cvs_acl_default_permissions != NULL) + free (cvs_acl_default_permissions); + if (!given_perms_valid (p)) +error (1,0,Invalid CVS ACL Default Permissions: '%s' in CVSROOT/aclconfig, p); + cvs_acl_default_permissions = xstrdup (p); + } + else if (strcmp (line, UseCVSGroups) == 0) + { + if (strcmp (p, no) == 0) + use_cvs_groups = 0; + else if (strcmp (p, yes) == 0) + use_cvs_groups = 1; + else + { + error (0, 0, unrecognized value '%s' for UseCVSGroups, p); + goto error_return; + } + } + else if
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:44:32 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: parseinfo.h Log Message: add acl prototype To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/parseinfo.h 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/parseinfo.h diff -u src/external/gpl2/xcvs/dist/src/parseinfo.h:1.2 src/external/gpl2/xcvs/dist/src/parseinfo.h:1.3 --- src/external/gpl2/xcvs/dist/src/parseinfo.h:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/parseinfo.h Thu Mar 8 15:44:32 2012 @@ -65,4 +65,5 @@ struct config bool parse_error (const char *, unsigned int); struct config *parse_config (const char *, const char *); void free_config (struct config *data); +int parse_aclconfig (const char *cvsroot); #endif /* !PARSEINFO_H */
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:45:28 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: mkmodules.c Log Message: - add acl support - document availability of tag commands. To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 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.4 src/external/gpl2/xcvs/dist/src/mkmodules.c:1.5 --- src/external/gpl2/xcvs/dist/src/mkmodules.c:1.4 Fri Jul 29 14:47:11 2011 +++ src/external/gpl2/xcvs/dist/src/mkmodules.c Thu Mar 8 15:45:28 2012 @@ -28,6 +28,79 @@ static void rename_dbmfile (char *temp); static void write_dbmfile (char *temp); #endif/* !MY_NDBM */ +/* cvsacl patch */ +static const char *const aclconfig_contents[] = { + # Set `UseCVSACL' to yes to use CVSACL feature.\n, + UseCVSACL=yes\n, + \n, + # Default CVSACL Permission to use.\n, + #CVSACLDefaultPermissions=p\n, + \n, + # Default file location for CVS ACL file (access) is CVSROOT/access.\n, + # If you want to use a different location, define it below.\n, + #CVSACLFileLocation=/path/to/cvs/access\n, + \n, + # Set `UseSystemGroups' to yes to use system group definitions (/etc/group).\n, + UseSystemGroups=yes\n, + \n, + # Set `UseCVSGroups' to yes to use another group file.\n, + #UseCVSGroups=yes\n, + \n, + # Default file location for CVS groups file is CVSROOT/group.\n, + # If you want to use a different location, define it below.\n, + #CVSGroupsFileLocation=/path/to/cvs/group\n, + \n, + # Set UseSeperateACLFileForEachDir to yes in order to use a\n, + # seperate 'access' file for each directory.\n, + # This increased the performance if you have really big repository.\n, + #UseSeperateACLFileForEachDir=no\n, + \n, + # If StopAtFirstPermissionDenied is set to yes\n, + # operation will stop at first permission denied message.\n, + # Default is no.\n, + #StopAtFirstPermissionDenied=no\n, + \n, + # Set CVSServerRunAsUser to a system user, in order CVS server\n, + # to run as.\n, + #CVSServerRunAsUser=runascvsuser, + NULL +}; + +static const char *const access_contents[] = { + # CVS ACL definitions file. DO NOT EDIT MANUALLY\n, + #\n, + # BNF:\n, + # entry: + filetype:path:tag-branch:permission-list:\n, + # filetype:d|f\n, + # path:ALL | unix-file-path\n, + # tag-branch: ALL | HEAD | name\n, + # permission-list: permission\n, + #| permission-list , permission\n, + # permission: actor!privilege\n, + # actor: ALL | user | group\n, + # privilegen | a | w | t | r | c | d | p\n, + #\n, + # Valid privileges are:\n, + # * - no permission (n) (1)\n, + # * - all permissions(a) (2)\n, + # * - write permission (w) (3)\n, + # * - tag permission (t) (4)\n, + # * - read permission(r) (5)\n, + # * - add permission (c) (6)\n, + # * - remove permission (d) (7)\n, + # * - permission change (p) (8)\n, + #\n, + # Valid filetypes are:\n, + # * - plain file (f)\n, + # * - directory (d)\n, + #\n, + NULL +}; + +static const char *const group_contents[] = { +}; + /* Structure which describes an administrative file. */ struct admin_file { /* Name of the file, within the CVSROOT directory. */ @@ -73,6 +146,7 @@ static const char *const loginfo_content #endif #%p = path relative to repository\n, #%r = repository (path portion of $CVSROOT)\n, +#%t = tagname\n, #%{sVv} = attribute list = file name, old version number (pre-checkin),\n, # new version number (post-checkin). When either old or new revision\n, # is unknown, doesn't exist, or isn't applicable, the string \NONE\\n, @@ -168,6 +242,7 @@ static const char *const commitinfo_cont #endif #%p = path relative to repository\n, #%r = repository (path portion of $CVSROOT)\n, +#%t = tagname\n, #%{s} = file name, file name, ...\n, #\n, # If no format strings are present in the filter string, a default of\n, @@ -677,6 +752,20 @@ static const struct admin_file filelist[ {CVSROOTADM_CONFIG, a %s file configures various behaviors, config_contents}, + + /* cvsacl patch */ +{CVSROOTADM_ACLCONFIG, + a %s file configures Access Control List behaviors, + aclconfig_contents}, + +{CVSROOTADM_ACCESS, + a %s file configures Access Control Lists, + access_contents}, + +{CVSROOTADM_GROUP, + a %s file configures Access Control List group definitions, + group_contents}, + {NULL, NULL, NULL} }; @@ -1259,13 +1348,13 @@ init (int argc, char **argv) fp = xfopen (info, w); if (fclose (fp) 0) error (1, errno, cannot close %s, info); - + /* Make the new history file world-writeable, since every CVS
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:45:52 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: main.c Log Message: - fix printf format string - add acl support To generate a diff of this commit: cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/main.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/main.c diff -u src/external/gpl2/xcvs/dist/src/main.c:1.4 src/external/gpl2/xcvs/dist/src/main.c:1.5 --- src/external/gpl2/xcvs/dist/src/main.c:1.4 Mon Apr 20 13:13:42 2009 +++ src/external/gpl2/xcvs/dist/src/main.c Thu Mar 8 15:45:52 2012 @@ -138,6 +138,9 @@ static const struct cmd } cmds[] = { +/* cvsacl patch */ +{ acl, NULL, NULL, cvsacl,CVS_CMD_MODIFIES_REPOSITORY | CVS_CMD_USES_WORK_DIR }, +{ racl, NULL, NULL, cvsacl,CVS_CMD_MODIFIES_REPOSITORY | CVS_CMD_USES_WORK_DIR }, { add, ad, new, add, CVS_CMD_MODIFIES_REPOSITORY | CVS_CMD_USES_WORK_DIR }, { admin,adm, rcs, admin, CVS_CMD_MODIFIES_REPOSITORY | CVS_CMD_USES_WORK_DIR }, { annotate, ann, NULL,annotate, CVS_CMD_USES_WORK_DIR }, @@ -231,6 +234,7 @@ static const char *const usg[] = static const char *const cmd_usage[] = { CVS commands are:\n, +acl Add/modify/delete ACLs in files and directories\n, add Add a new file/directory to the repository\n, adminAdministration front end for rcs\n, annotate Show last revision where each line was modified\n, @@ -255,6 +259,7 @@ static const char *const cmd_usage[] = #if (defined(AUTH_SERVER_SUPPORT) || defined (HAVE_GSSAPI)) defined(SERVER_SUPPORT) pserver Password server mode\n, #endif +racl Add/modify/delete ACLs in files and directories\n, rannotateShow last revision where each line of module was modified\n, rdiffCreate 'patch' format diffs between releases\n, release Indicate that a Module is no longer in use\n, @@ -1127,6 +1132,9 @@ cause intermittent sandbox corruption.) * if it was set in config, we now know it. */ push_env_temp_dir (); + + /* cvsacl patch */ + parse_aclconfig (current_parsed_root-directory); } #ifdef CLIENT_SUPPORT @@ -1506,7 +1514,7 @@ usage (register const char *const *cpp) { (void) fprintf (stderr, *cpp++, program_name, cvs_cmd_name); for (; *cpp; cpp++) - (void) fprintf (stderr, *cpp); + (void) fprintf (stderr, %s, *cpp); exit (EXIT_FAILURE); }
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:46:08 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: ls.c Log Message: check chdir return To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/ls.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/ls.c diff -u src/external/gpl2/xcvs/dist/src/ls.c:1.2 src/external/gpl2/xcvs/dist/src/ls.c:1.3 --- src/external/gpl2/xcvs/dist/src/ls.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/ls.c Thu Mar 8 15:46:08 2012 @@ -546,7 +546,8 @@ ls_dirleaveproc (void *callerdat, const set_tag = false; } - (void)CVS_CHDIR (..); + if (CVS_CHDIR (..) == -1) + error (0, errno, Failed to chdir ..); if (unlink_file_dir (dir)) error (0, errno, Failed to remove directory `%s', created_dir);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:46:35 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: logmsg.c Log Message: in new format strings, formats are actually checked, so put tag commands in. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/logmsg.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/logmsg.c diff -u src/external/gpl2/xcvs/dist/src/logmsg.c:1.3 src/external/gpl2/xcvs/dist/src/logmsg.c:1.4 --- src/external/gpl2/xcvs/dist/src/logmsg.c:1.3 Fri Feb 19 18:50:55 2010 +++ src/external/gpl2/xcvs/dist/src/logmsg.c Thu Mar 8 15:46:35 2012 @@ -808,7 +808,7 @@ logfile_write (const char *repository, c #endif /* SERVER_SUPPORT */ p, s, srepos, r, s, current_parsed_root-directory, - sVv, ,, changes, + sVvTt, ,, changes, logmsg_list_to_args_proc, (void *) NULL, (char *) NULL); if (!cmdline || !strlen (cmdline)) @@ -933,7 +933,7 @@ verifymsg_proc (const char *repository, r, s, current_parsed_root-directory, l, s, vpd-fname, - sV, ,, vpd-changes, + sVTt, ,, vpd-changes, logmsg_list_to_args_proc, (void *) NULL, (char *) NULL);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:46:59 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: log.c Log Message: add acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/log.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/log.c diff -u src/external/gpl2/xcvs/dist/src/log.c:1.2 src/external/gpl2/xcvs/dist/src/log.c:1.3 --- src/external/gpl2/xcvs/dist/src/log.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/log.c Thu Mar 8 15:46:59 2012 @@ -834,6 +834,25 @@ log_fileproc (void *callerdat, struct fi return 1; } +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, NULL, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } +} +#endif + if (log_data-sup_header || !log_data-nameonly) {
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:47:17 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: filesubr.c Log Message: check symlink return To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/filesubr.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/filesubr.c diff -u src/external/gpl2/xcvs/dist/src/filesubr.c:1.3 src/external/gpl2/xcvs/dist/src/filesubr.c:1.4 --- src/external/gpl2/xcvs/dist/src/filesubr.c:1.3 Sat Sep 5 02:18:55 2009 +++ src/external/gpl2/xcvs/dist/src/filesubr.c Thu Mar 8 15:47:17 2012 @@ -45,7 +45,8 @@ copy_file (const char *from, const char if ((rsize = islink (from)) 0) { char *source = Xreadlink (from, rsize); - symlink (source, to); + if (symlink (source, to) == -1) + error (1, errno, cannot symlink %s to %s, source, to); free (source); return; }
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:47:45 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: import.c Log Message: - put back missing noexec check - add cvs acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/import.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/import.c diff -u src/external/gpl2/xcvs/dist/src/import.c:1.2 src/external/gpl2/xcvs/dist/src/import.c:1.3 --- src/external/gpl2/xcvs/dist/src/import.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/import.c Thu Mar 8 15:47:45 2012 @@ -320,6 +320,20 @@ import (int argc, char **argv) error (1, 0, attempt to import the repository); } +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (NULL, repository, argv[1], 6, NULL, NULL, 1)) + { + error (stop_at_first_permission_denied, 0, + permission denied for %s, Short_Repository (repository)); + + return (0); + } +} +#endif + ulist = getlist (); p = getnode (); p-type = UPDATE; @@ -595,7 +609,7 @@ process_import_file (char *message, char /* Attempt to make the Attic directory, in case it does not exist. */ (void) sprintf (rcs, %s/%s, repository, CVSATTIC); - if (CVS_MKDIR (rcs, 0777 ) != 0 errno != EEXIST) + if (noexec == 0 CVS_MKDIR (rcs, 0777 ) != 0 errno != EEXIST) error (1, errno, cannot make directory `%s', rcs); /* Note that the above clobbered the path name, so we
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:48:02 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: diff.c Log Message: add acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/diff.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/diff.c diff -u src/external/gpl2/xcvs/dist/src/diff.c:1.2 src/external/gpl2/xcvs/dist/src/diff.c:1.3 --- src/external/gpl2/xcvs/dist/src/diff.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/diff.c Thu Mar 8 15:48:02 2012 @@ -498,6 +498,46 @@ diff_fileproc (void *callerdat, struct f { /* Skip all the following checks regarding the user file; we're not using it. */ + +/* cvsacl patch */ +#ifdef SERVER_SUPPORT + if (use_cvs_acl /* server_active */) + { + if (diff_rev1) + { + if (!access_allowed (NULL, finfo-repository, diff_rev1, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), + finfo-file); + + return (0); + } + } + if (diff_rev2) + { + if (!access_allowed (NULL, finfo-repository, diff_rev2, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), + finfo-file); + + return (0); + } + } + } +#endif + } else if (vers-vn_user == NULL) { @@ -840,6 +880,40 @@ diff_dirproc (void *callerdat, const cha if (!isdir (dir)) return R_SKIP_ALL; +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (diff_rev1) + { + if (!access_allowed (NULL, update_dir, diff_rev1, 5, NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (update_dir)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (update_dir), update_dir); + + return (0); + } + } + if (diff_rev2) + { + if (!access_allowed (NULL, update_dir, diff_rev2, 5, NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (update_dir)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (update_dir), update_dir); + + return (0); + } + } +} +#endif if (!quiet) error (0, 0, Diffing %s, update_dir); return R_PROCESS;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:48:22 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: add.c admin.c annotate.c commit.c remove.c Log Message: add acl support To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/add.c \ src/external/gpl2/xcvs/dist/src/annotate.c \ src/external/gpl2/xcvs/dist/src/remove.c cvs rdiff -u -r1.4 -r1.5 src/external/gpl2/xcvs/dist/src/admin.c cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/commit.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/add.c diff -u src/external/gpl2/xcvs/dist/src/add.c:1.2 src/external/gpl2/xcvs/dist/src/add.c:1.3 --- src/external/gpl2/xcvs/dist/src/add.c:1.2 Fri Apr 10 07:20:29 2009 +++ src/external/gpl2/xcvs/dist/src/add.c Thu Mar 8 15:48:22 2012 @@ -401,6 +401,25 @@ add (int argc, char **argv) } else { +/* cvsacl patch */ +#ifdef SERVER_SUPPORT + if (use_cvs_acl /* server_active */) + { + if (!access_allowed (finfo.file, repository, + vers-tag, 6, NULL, NULL, 1)) + { +if (stop_at_first_permission_denied) +error (1, 0, permission denied for %s, + Short_Repository (finfo.repository)); +else +error (0, 0, permission denied for %s/%s, + Short_Repository (finfo.repository), + finfo.file); + +return (0); + } + } +#endif /* There is a user file, so build the entry for it */ if (build_entry (repository, finfo.file, vers-options, message, entries, vers-tag) != 0) @@ -675,6 +694,25 @@ add (int argc, char **argv) isdir (finfo.file) !wrap_name_has (finfo.file, WRAP_TOCVS)) { + +/* cvsacl patch */ +#ifdef SERVER_SUPPORT + if (use_cvs_acl /* server_active */) + { + if (!access_allowed (NULL, repository, NULL, 6, NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo.repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo.repository), finfo.file); + + return (0); + } + } +#endif + err += add_directory (finfo); } else Index: src/external/gpl2/xcvs/dist/src/annotate.c diff -u src/external/gpl2/xcvs/dist/src/annotate.c:1.2 src/external/gpl2/xcvs/dist/src/annotate.c:1.3 --- src/external/gpl2/xcvs/dist/src/annotate.c:1.2 Fri Apr 10 07:20:29 2009 +++ src/external/gpl2/xcvs/dist/src/annotate.c Thu Mar 8 15:48:22 2012 @@ -267,6 +267,25 @@ annotate_fileproc (void *callerdat, stru if (version == NULL) return 0; +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, version, 5, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } +} +#endif + /* Distinguish output for various files if we are processing several files. */ cvs_outerr (\nAnnotations for , 0); Index: src/external/gpl2/xcvs/dist/src/remove.c diff -u src/external/gpl2/xcvs/dist/src/remove.c:1.2 src/external/gpl2/xcvs/dist/src/remove.c:1.3 --- src/external/gpl2/xcvs/dist/src/remove.c:1.2 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/remove.c Thu Mar 8 15:48:22 2012 @@ -241,6 +241,25 @@ cannot remove file `%s' which has a stic { char *fname; +/* cvsacl patch */ +#ifdef SERVER_SUPPORT + if (use_cvs_acl /* server_active */) + { + if (!access_allowed (finfo-file, finfo-repository, vers-tag, 7, + NULL, NULL, 1)) + { + if (stop_at_first_permission_denied) + error (1, 0, permission denied for %s, + Short_Repository (finfo-repository)); + else + error (0, 0, permission denied for %s/%s, + Short_Repository (finfo-repository), finfo-file); + + return (0); + } + } +#endif + /* Re-register it with a negative version number. */ fname = Xasprintf (-%s, vers-vn_user); Register (finfo-entries, finfo-file, fname, vers-ts_rcs, Index: src/external/gpl2/xcvs/dist/src/admin.c diff -u src/external/gpl2/xcvs/dist/src/admin.c:1.4 src/external/gpl2/xcvs/dist/src/admin.c:1.5 --- src/external/gpl2/xcvs/dist/src/admin.c:1.4 Sat Sep 5 08:50:33 2009 +++ src/external/gpl2/xcvs/dist/src/admin.c Thu Mar 8 15:48:22 2012 @@ -690,6 +690,25 @@ admin_fileproc (void *callerdat, struct vers = Version_TS (finfo, NULL, NULL, NULL, 0, 0); +/* cvsacl patch */ +#ifdef SERVER_SUPPORT +if (use_cvs_acl /* server_active */) +{ + if (!access_allowed (finfo-file, finfo-repository, NULL, 2, + NULL, NULL, 1)) + { + if
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Thu Mar 8 20:50:26 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: cvs.h Log Message: add cvs acl support To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/cvs.h 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/cvs.h diff -u src/external/gpl2/xcvs/dist/src/cvs.h:1.3 src/external/gpl2/xcvs/dist/src/cvs.h:1.4 --- src/external/gpl2/xcvs/dist/src/cvs.h:1.3 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/cvs.h Thu Mar 8 15:50:26 2012 @@ -19,7 +19,7 @@ #ifdef HAVE_CONFIG_H # include config.h /* this is stuff found via autoconf */ -#endif /* CONFIG_H */ +#endif /* HAVE_CONFIG_H */ /* Add GNU attribute suppport. */ #ifndef __attribute__ @@ -189,6 +189,11 @@ char *strerror (int); #define CVSROOTADM_WRAPPER cvswrappers #define CVSROOTADM_WRITERS writers +/* cvsacl patch */ +#define CVSROOTADM_ACLCONFIG aclconfig +#define CVSROOTADM_ACCESS access +#define CVSROOTADM_GROUP group + #define CVSNULLREPOS Emptydir /* an empty directory */ /* Other CVS file names */ @@ -459,6 +464,22 @@ int diff_exec (const char *file1, const */ extern int error_use_protocol; +/* cvsacl patch */ +/* ACL Patch settings from CVSROOT/config */ +extern int use_cvs_acl; +extern char *cvs_acl_default_permissions; +extern int use_cvs_groups; +extern int use_system_groups; +extern int use_separate_acl_file_for_each_dir; +extern char *cvs_acl_file_location; +extern char *cvs_groups_file_location; +extern char *cvs_server_run_as; +extern int stop_at_first_permission_denied; + +int given_perms_valid (const char *cperms); +int +access_allowed (const char *file, const char *repos, const char *tag, + int perm, char **mline, int *mpos, int usecache); DBM *open_module (void); List *Find_Directories (char *repository, int which, List *entries); @@ -858,6 +879,9 @@ char *expand_path (const char *name, con /* User variables. */ extern List *variable_list; +/* cvsacl patch */ +extern int cvsacl (int argc, char **argv); + void variable_set (char *nameval); int watch (int argc, char **argv);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: drochner Date: Thu Feb 9 16:28:53 UTC 2012 Modified Files: src/external/gpl2/xcvs/dist/src: client.c Log Message: add patch from Redhat bug#784141 which fixes a possible buffer overflow if used with an HTTP proxy (CVE-2012-0804) approved by releng To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/client.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/client.c diff -u src/external/gpl2/xcvs/dist/src/client.c:1.3 src/external/gpl2/xcvs/dist/src/client.c:1.4 --- src/external/gpl2/xcvs/dist/src/client.c:1.3 Sun May 15 17:52:41 2011 +++ src/external/gpl2/xcvs/dist/src/client.c Thu Feb 9 16:28:53 2012 @@ -3550,9 +3550,9 @@ connect_to_pserver (cvsroot_t *root, str * code. */ read_line_via (from_server, to_server, read_buf); - sscanf (read_buf, %s %d, write_buf, codenum); + count = sscanf (read_buf, %*s %d, codenum); - if ((codenum / 100) != 2) + if (count != 1 || (codenum / 100) != 2) error (1, 0, proxy server %s:%d does not support http tunnelling, root-proxy_hostname, proxy_port_number); free (read_buf);
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: mrg Date: Sat Sep 24 11:37:27 UTC 2011 Modified Files: src/external/gpl2/xcvs/dist/src: patch.c Log Message: implement cvs rdiff -p. (someone please upate the manual for me :) To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/patch.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/patch.c diff -u src/external/gpl2/xcvs/dist/src/patch.c:1.3 src/external/gpl2/xcvs/dist/src/patch.c:1.4 --- src/external/gpl2/xcvs/dist/src/patch.c:1.3 Fri Apr 10 11:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/patch.c Sat Sep 24 11:37:27 2011 @@ -43,16 +43,18 @@ static char *tmpfile2 = NULL; static char *tmpfile3 = NULL; static int unidiff = 0; +static int show_c_func = 0; static const char *const patch_usage[] = { -Usage: %s %s [-flR] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n, +Usage: %s %s [-flR] [-p] [-c|-u] [-s|-t] [-V %%d] [-k kopt]\n, -r rev|-D date [-r rev2 | -D date2] modules...\n, \t-f\tForce a head revision match if tag/date not found.\n, \t-l\tLocal directory only, not recursive\n, \t-R\tProcess directories recursively.\n, \t-c\tContext diffs (default)\n, \t-u\tUnidiff format.\n, +\t-p\tShow which C function each change is in.\n, /* --show-c-function */ \t-s\tShort patch - one liner per file.\n, \t-t\tTop two diffs - last change made to the file.\n, \t-V vers\tUse RCS Version \vers\ for keyword expansion.\n, @@ -78,7 +80,7 @@ usage (patch_usage); getoptreset (); -while ((c = getopt (argc, argv, +V:k:cuftsQqlRD:r:)) != -1) +while ((c = getopt (argc, argv, +V:k:cuftsQqlRD:r:p)) != -1) { switch (c) { @@ -154,6 +156,9 @@ case 'c': /* Context diff */ unidiff = 0; break; + case 'p': + show_c_func = 1; + break; case '?': default: usage (patch_usage); @@ -202,6 +207,8 @@ send_arg(-s); if (unidiff) send_arg(-u); + if (show_c_func) + send_arg(-p); if (rev1) option_with_arg (-r, rev1); @@ -571,6 +578,8 @@ if (unidiff) run_add_arg_p (dargc, darg_allocated, dargv, -u); else run_add_arg_p (dargc, darg_allocated, dargv, -c); +if (show_c_func) +run_add_arg_p (dargc, darg_allocated, dargv, -p); switch (diff_exec (tmpfile1, tmpfile2, NULL, NULL, dargc, dargv, tmpfile3)) {
CVS commit: src/external/gpl2/xcvs/dist/src
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
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Sun May 15 17:52:41 UTC 2011 Modified Files: src/external/gpl2/xcvs/dist/src: client.c Log Message: Add missing prototype. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/client.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/client.c diff -u src/external/gpl2/xcvs/dist/src/client.c:1.2 src/external/gpl2/xcvs/dist/src/client.c:1.3 --- src/external/gpl2/xcvs/dist/src/client.c:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/client.c Sun May 15 13:52:41 2011 @@ -68,6 +68,10 @@ int tag (int argc, char **argv); int update (int argc, char **argv); +#if defined AUTH_CLIENT_SUPPORT || defined HAVE_KERBEROS || defined HAVE_GSSAPI +static int connect_to(char *, unsigned int); +#endif + static size_t try_read_from_server (char *, size_t); static void auth_server (cvsroot_t *, struct buffer *, struct buffer *, @@ -5151,7 +5155,7 @@ #if defined AUTH_CLIENT_SUPPORT || defined HAVE_KERBEROS || defined HAVE_GSSAPI -int +static int connect_to(char *hostname, unsigned int port) { struct addrinfo hints, *res, *res0 = NULL;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Fri Feb 19 23:50:55 UTC 2010 Modified Files: src/external/gpl2/xcvs/dist/src: logmsg.c Log Message: make the default action abort for the empty log message; it used to be continue. requested by joerg. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/logmsg.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/logmsg.c diff -u src/external/gpl2/xcvs/dist/src/logmsg.c:1.2 src/external/gpl2/xcvs/dist/src/logmsg.c:1.3 --- src/external/gpl2/xcvs/dist/src/logmsg.c:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/logmsg.c Fri Feb 19 18:50:55 2010 @@ -357,7 +357,7 @@ { (void) printf (\nLog message unchanged or not specified\n); (void) printf (a)bort, c)ontinue, e)dit, !)reuse this message unchanged for remaining dirs\n); - (void) printf (Action: (continue) ); + (void) printf (Action: (abort) ); (void) fflush (stdout); line_length = getline (line, line_chars_allocated, stdin); if (line_length 0) @@ -369,14 +369,14 @@ error (1, 0, aborting); } else if (line_length == 0 - || *line == '\n' || *line == 'c' || *line == 'C') - break; - if (*line == 'a' || *line == 'A') + || *line == '\n' || *line == 'a' || *line == 'A') { if (unlink_file (fname) 0) error (0, errno, warning: cannot remove temp file %s, fname); error (1, 0, aborted by user); } + if (*line == 'c' || *line == 'C') + break; if (*line == 'e' || *line == 'E') goto again; if (*line == '!')
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: dsl Date: Fri Nov 27 18:38:29 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: zlib.c Log Message: Fix compressed server accesses. According to http://cvs.savannah.gnu.org/viewvc/ccvs/src/?root=cvs this was broken between revs 1.29 and 1.32 for a perion of 4 months about 4 years ago. Not sure at all why/how we have the broken version. Our old code, the latest gnu code and this fix all differ slightly, but have the same effect. To generate a diff of this commit: cvs rdiff -u -r1.1.1.1 -r1.2 src/external/gpl2/xcvs/dist/src/zlib.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/zlib.c diff -u src/external/gpl2/xcvs/dist/src/zlib.c:1.1.1.1 src/external/gpl2/xcvs/dist/src/zlib.c:1.2 --- src/external/gpl2/xcvs/dist/src/zlib.c:1.1.1.1 Tue Apr 7 22:10:29 2009 +++ src/external/gpl2/xcvs/dist/src/zlib.c Fri Nov 27 18:38:29 2009 @@ -229,7 +229,7 @@ would fetch all the available bytes, and at least one byte. */ status = (*cb-buf-input) (cb-buf-closure, bd-text, -need, BUFFER_DATA_SIZE, nread); +need 0, BUFFER_DATA_SIZE, nread); if (status == -2) /* Don't try to recover from memory allcoation errors. */
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: dholland Date: Sat Sep 5 06:18:55 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: filesubr.c Log Message: Check group membership correctly; ingroup() returns a truth value, not a gid. PR bin/41995. To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/filesubr.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/filesubr.c diff -u src/external/gpl2/xcvs/dist/src/filesubr.c:1.2 src/external/gpl2/xcvs/dist/src/filesubr.c:1.3 --- src/external/gpl2/xcvs/dist/src/filesubr.c:1.2 Wed Apr 8 16:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/filesubr.c Sat Sep 5 06:18:55 2009 @@ -282,8 +282,7 @@ omask |= S_IXOTH; } -mask = sb.st_uid == uid ? umask : sb.st_gid == ingroup(sb.st_gid) ? - gmask : omask; +mask = sb.st_uid == uid ? umask : ingroup(sb.st_gid) ? gmask : omask; if ((sb.st_mode mask) == mask) return true; errno = EACCES;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: apb Date: Sat Sep 5 12:50:33 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: admin.c Log Message: It's expected that config will be NULL in a cvs client, but not in a server or with a local CVSROOT. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/admin.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/admin.c diff -u src/external/gpl2/xcvs/dist/src/admin.c:1.3 src/external/gpl2/xcvs/dist/src/admin.c:1.4 --- src/external/gpl2/xcvs/dist/src/admin.c:1.3 Fri Apr 10 11:20:29 2009 +++ src/external/gpl2/xcvs/dist/src/admin.c Sat Sep 5 12:50:33 2009 @@ -327,8 +327,17 @@ while ((c = getopt (argc, argv, +ib::c:a:A:e::l::u::LUn:N:m:o:s:t::IqxV:k:)) != -1) { - if (c != 'q' !strchr (config-UserAdminOptions, c)) + if (config != NULL) { + if (c != 'q' !strchr (config-UserAdminOptions, c)) + only_allowed_options = false; + } else { +#ifdef CLIENT_SUPPORT + assert(current_parsed_root-isremote); only_allowed_options = false; +#else + assert(0); /* config should not be NULL, except in a client */ +#endif + } switch (c) {
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Tue Apr 21 17:27:50 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: rcs.c Log Message: Fix LOCALID expansion (from Anon Ymous) To generate a diff of this commit: cvs rdiff -u -r1.2 -r1.3 src/external/gpl2/xcvs/dist/src/rcs.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/rcs.c diff -u src/external/gpl2/xcvs/dist/src/rcs.c:1.2 src/external/gpl2/xcvs/dist/src/rcs.c:1.3 --- src/external/gpl2/xcvs/dist/src/rcs.c:1.2 Wed Apr 8 12:27:51 2009 +++ src/external/gpl2/xcvs/dist/src/rcs.c Tue Apr 21 13:27:50 2009 @@ -3511,6 +3511,11 @@ KEYWORD_INIT (new, KEYWORD_REVISION, Revision); KEYWORD_INIT (new, KEYWORD_SOURCE, Source); KEYWORD_INIT (new, KEYWORD_STATE, State); +KEYWORD_INIT (new, KEYWORD_STATE, State); +new[KEYWORD_LOCALID].string = NULL; +new[KEYWORD_LOCALID].len = 0; +new[KEYWORD_LOCALID].expandto = KEYWORD_LOCALID; +new[KEYWORD_LOCALID].expandit = false; return new; }
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Tue Apr 21 18:43:52 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: rcs.c Log Message: remove dup line. To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/rcs.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/rcs.c diff -u src/external/gpl2/xcvs/dist/src/rcs.c:1.3 src/external/gpl2/xcvs/dist/src/rcs.c:1.4 --- src/external/gpl2/xcvs/dist/src/rcs.c:1.3 Tue Apr 21 13:27:50 2009 +++ src/external/gpl2/xcvs/dist/src/rcs.c Tue Apr 21 14:43:52 2009 @@ -3511,7 +3511,6 @@ KEYWORD_INIT (new, KEYWORD_REVISION, Revision); KEYWORD_INIT (new, KEYWORD_SOURCE, Source); KEYWORD_INIT (new, KEYWORD_STATE, State); -KEYWORD_INIT (new, KEYWORD_STATE, State); new[KEYWORD_LOCALID].string = NULL; new[KEYWORD_LOCALID].len = 0; new[KEYWORD_LOCALID].expandto = KEYWORD_LOCALID;
CVS commit: src/external/gpl2/xcvs/dist/src
Module Name:src Committed By: christos Date: Mon Apr 20 17:13:42 UTC 2009 Modified Files: src/external/gpl2/xcvs/dist/src: main.c Log Message: put back -u To generate a diff of this commit: cvs rdiff -u -r1.3 -r1.4 src/external/gpl2/xcvs/dist/src/main.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/main.c diff -u src/external/gpl2/xcvs/dist/src/main.c:1.3 src/external/gpl2/xcvs/dist/src/main.c:1.4 --- src/external/gpl2/xcvs/dist/src/main.c:1.3 Fri Apr 10 07:20:30 2009 +++ src/external/gpl2/xcvs/dist/src/main.c Mon Apr 20 13:13:42 2009 @@ -519,7 +519,7 @@ int help = 0; /* Has the user asked for help? This lets us support the `cvs -H cmd' convention to give help for cmd. */ -static const char short_options[] = +QqrwtlnRvb:T:e:d:D:Hfz:s:xa; +static const char short_options[] = +QqrwtlnRuvb:T:e:d:D:Hfz:s:xa; static struct option long_options[] = { {help, 0, NULL, 'H'},