[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cvs admin -u bug
From: |
Mark D. Baushke |
Subject: |
Re: cvs admin -u bug |
Date: |
Tue, 18 Feb 2003 13:58:13 -0800 |
Marc Prewitt <mprewitt@wssource.com> writes:
> >Description:
> When running 'cvs admin -u' on a file which doesn't exist in the repository
> generates a core dump. Also, a lock file is left in the repository. Here's
> a
> trace of the core dump:
>
...elided...
> #0 admin_fileproc (callerdat=0xffbefa58, finfo=0xffbef820) at admin.c:571
> 571 if (rcs->flags & PARTIAL)
...elided...
The patch for this problem would seem to be as follows.
If someone with commit access would do the honors?
Enjoy!
-- Mark
ChangeLog entry:
2003-02-18 Mark D. Baushke <mdb@cvshome.org>
* admin.c (admin_fileproc): Check that the file is cvs-controlled
to avoid core dumps.
* sanity.sh (reserved-16): Test it.
Index: src/admin.c
===================================================================
RCS file: /cvs/ccvs/src/admin.c,v
retrieving revision 1.81
diff -u -p -r1.81 admin.c
--- admin.c 7 Feb 2003 19:53:30 -0000 1.81
+++ admin.c 18 Feb 2003 21:55:18 -0000
@@ -568,6 +568,12 @@ admin_fileproc (callerdat, finfo)
}
rcs = vers->srcfile;
+ if (rcs == NULL)
+ {
+ error (0, 0, "cannot admin non-cvs file `%s'", finfo->file);
+ goto exitfunc;
+ }
+
if (rcs->flags & PARTIAL)
RCS_reparsercsfile (rcs, (FILE **) NULL, (struct rcsbuffer *) NULL);
Index: src/sanity.sh
===================================================================
RCS file: /cvs/ccvs/src/sanity.sh,v
retrieving revision 1.758
diff -u -p -r1.758 sanity.sh
--- sanity.sh 15 Feb 2003 05:29:38 -0000 1.758
+++ sanity.sh 18 Feb 2003 21:55:01 -0000
@@ -20871,6 +20871,9 @@ ${CVSROOT_DIRNAME}/first-dir/a-lock,v <
new revision: 1\.2; previous revision: 1\.1
done"
+ dotest reserved-16 "${testcvs} admin -u foo" \
+"${PROG} [a-z]*: cannot admin non-cvs file .foo."
+
# Now test for a bug involving branches and locks
sed -e 's/locks; strict;/locks fred:1.2; strict;/'
${CVSROOT_DIRNAME}/first-dir/a-lock,v > a-lock,v
chmod 644 ${CVSROOT_DIRNAME}/first-dir/a-lock,v
- cvs admin -u bug, Marc Prewitt, 2003/02/18
- Re: cvs admin -u bug,
Mark D. Baushke <=