cvs-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Cvs-cvs] ccvs/src ChangeLog add.c sanity.sh [cvs1-11-x-branch]


From: Derek Robert Price
Subject: [Cvs-cvs] ccvs/src ChangeLog add.c sanity.sh [cvs1-11-x-branch]
Date: Wed, 22 Aug 2007 21:42:58 +0000

CVSROOT:        /cvsroot/cvs
Module name:    ccvs
Branch:         cvs1-11-x-branch
Changes by:     Derek Robert Price <dprice>     07/08/22 21:42:56

Modified files:
        src            : ChangeLog add.c sanity.sh 

Log message:
        * add.c (add): Check last component of argument paths instead of the
        entire argument.
        * sanity.sh (add-restricted): Test indirect paths to `CVS' dir with
        add.

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/ChangeLog?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.2336.2.489&r2=1.2336.2.490
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/add.c?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.80.2.27&r2=1.80.2.28
http://cvs.savannah.gnu.org/viewcvs/ccvs/src/sanity.sh?cvsroot=cvs&only_with_tag=cvs1-11-x-branch&r1=1.752.2.213&r2=1.752.2.214

Patches:
Index: ChangeLog
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/ChangeLog,v
retrieving revision 1.2336.2.489
retrieving revision 1.2336.2.490
diff -u -b -r1.2336.2.489 -r1.2336.2.490
--- ChangeLog   22 Aug 2007 21:33:51 -0000      1.2336.2.489
+++ ChangeLog   22 Aug 2007 21:42:54 -0000      1.2336.2.490
@@ -1,5 +1,10 @@
 2007-08-22  Derek Price  <address@hidden>
 
+       * add.c (add): Check last component of argument paths instead of the
+       entire argument.
+       * sanity.sh (add-restricted): Test indirect paths to `CVS' dir with
+       add.
+
        * server.c (serve_init): Remove unnecessary argument to printf style
        function.
 

Index: add.c
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/add.c,v
retrieving revision 1.80.2.27
retrieving revision 1.80.2.28
diff -u -b -r1.80.2.27 -r1.80.2.28
--- add.c       31 May 2006 15:15:56 -0000      1.80.2.27
+++ add.c       22 Aug 2007 21:42:54 -0000      1.80.2.28
@@ -117,7 +117,7 @@
        strip_trailing_slashes (argv[i]);
        if (strcmp (argv[i], ".") == 0
            || strcmp (argv[i], "..") == 0
-           || fncmp (argv[i], CVSADM) == 0)
+           || fncmp (last_component(argv[i]), CVSADM) == 0)
        {
            if (!quiet)
                error (0, 0, "cannot add special file `%s'; skipping", argv[i]);

Index: sanity.sh
===================================================================
RCS file: /cvsroot/cvs/ccvs/src/sanity.sh,v
retrieving revision 1.752.2.213
retrieving revision 1.752.2.214
diff -u -b -r1.752.2.213 -r1.752.2.214
--- sanity.sh   22 Aug 2007 21:33:17 -0000      1.752.2.213
+++ sanity.sh   22 Aug 2007 21:42:54 -0000      1.752.2.214
@@ -1123,6 +1123,7 @@
        tests="version basica basicb basicc basic1 deep basic2"
        tests="${tests} parseroot parseroot2 files spacefiles commit-readonly"
        tests="${tests} commit-add-missing"
+       tests="$tests add-restricted"
        tests="${tests} status"
        # Branching, tagging, removing, adding, multiple directories
        tests="${tests} rdiff rdiff-short"
@@ -29571,6 +29572,37 @@
          rm -rf ${CVSROOT_DIRNAME}/$module
          ;;
 
+       add-restricted)
+         # Verify that `sdir/CVS' may not be explicitly added.
+         mkdir add-restricted; cd add-restricted
+
+         mkdir import; cd import
+         : > junk
+         dotest add-restricted-init-1 \
+"$testcvs -Q import -m. add-restricted X Y"
+         cd ..
+
+         dotest add-restricted-init-2 "$testcvs -Q co add-restricted"
+         cd add-restricted
+
+         # errmsg2-3 tests the specific message here.
+         dotest_fail add-restricted-1 "$testcvs -Q add CVS"
+
+         mkdir sdir
+         dotest add-restricted-2 "$testcvs -Q add sdir"
+         dotest_fail add-restricted-3 "$testcvs add sdir/CVS" \
+"$PROG add: cannot add special file \`sdir/CVS'; skipping"
+
+         if $keep; then
+           echo Keeping $TESTDIR and exiting due to --keep
+           exit 0
+         fi
+         cd ../..
+         rm -rf add-restricted $CVSROOT_DIRNAME/add-restricted
+       ;;
+
+
+
        commit-d)
          # Check that top-level commits work when CVS/Root
          # is overridden by cvs -d.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]