[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Cvs-cvs] ccvs/src ChangeLog root.c sanity.sh
From: |
Derek Robert Price |
Subject: |
[Cvs-cvs] ccvs/src ChangeLog root.c sanity.sh |
Date: |
Sun, 26 Feb 2006 21:39:55 +0000 |
CVSROOT: /cvsroot/cvs
Module name: ccvs
Branch:
Changes by: Derek Robert Price <address@hidden> 06/02/26 21:39:55
Modified files:
src : ChangeLog root.c sanity.sh
Log message:
* root.c [HOSTNAME_CHARS]: New macro.
(parse_cvsroot): Interpret specs that look like relative paths as
relative paths, not hostname/path.
* sanity.sh (crerepos-6a, parseroot2): Update to compensate.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/ChangeLog.diff?tr1=1.3348&tr2=1.3349&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/root.c.diff?tr1=1.121&tr2=1.122&r1=text&r2=text
http://cvs.savannah.gnu.org/viewcvs/cvs/ccvs/src/sanity.sh.diff?tr1=1.1113&tr2=1.1114&r1=text&r2=text
Patches:
Index: ccvs/src/ChangeLog
diff -u ccvs/src/ChangeLog:1.3348 ccvs/src/ChangeLog:1.3349
--- ccvs/src/ChangeLog:1.3348 Sun Feb 26 21:30:10 2006
+++ ccvs/src/ChangeLog Sun Feb 26 21:39:54 2006
@@ -1,5 +1,10 @@
2006-02-26 Derek Price <address@hidden>
+ * root.c [HOSTNAME_CHARS]: New macro.
+ (parse_cvsroot): Interpret specs that look like relative paths as
+ relative paths, not hostname/path.
+ * sanity.sh (crerepos-6a, parseroot2): Update to compensate.
+
* client.c (call_in_directory): Remove unneeded code.
2006-02-25 Mark D. Baushke <address@hidden>
Index: ccvs/src/root.c
diff -u ccvs/src/root.c:1.121 ccvs/src/root.c:1.122
--- ccvs/src/root.c:1.121 Wed Dec 7 20:04:49 2005
+++ ccvs/src/root.c Sun Feb 26 21:39:54 2006
@@ -26,6 +26,9 @@
"kserver", "gserver", "ext", "extssh", "fork"
};
+#define HOSTNAME_CHARS \
+ "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUZWXYZ1234567890-_."
+
#ifndef DEBUG
cvsroot_t *
@@ -389,7 +392,7 @@
newroot->directory = NULL;
newroot->method = null_method;
newroot->isremote = false;
-#ifdef CLIENT_SUPPORT
+#if defined CLIENT_SUPPORT || defined SERVER_SUPPORT
newroot->username = NULL;
newroot->password = NULL;
newroot->hostname = NULL;
@@ -625,12 +628,14 @@
}
else
{
- /* If the method isn't specified, assume EXT_METHOD if the string looks
- like a relative path and LOCAL_METHOD otherwise. */
-
- newroot->method = ((*cvsroot_copy != '/' && strchr (cvsroot_copy, '/'))
- ? ext_method
- : local_method);
+ /* If the method isn't specified, assume LOCAL_METHOD unless the root
+ * looks like server:/path. Then assume EXT_METHOD.
+ */
+ size_t len = strspn (cvsroot_copy, HOSTNAME_CHARS);
+ if (len > 0 && cvsroot_copy[len] == ':')
+ newroot->method = ext_method;
+ else
+ newroot->method = local_method;
}
/*
Index: ccvs/src/sanity.sh
diff -u ccvs/src/sanity.sh:1.1113 ccvs/src/sanity.sh:1.1114
--- ccvs/src/sanity.sh:1.1113 Sat Feb 25 22:20:43 2006
+++ ccvs/src/sanity.sh Sun Feb 26 21:39:54 2006
@@ -22164,13 +22164,13 @@
# Test that CVS rejects a relative path in CVSROOT.
mkdir 1; cd 1
- # Set CVS_RSH=false since ocassionally (e.g. when CVS_RSH=ssh on
- # some systems) some rsh implementations will block because they
- # can look up '..' and want to ask the user about the unknown host
- # key or somesuch. Which error message we get depends on whether
- # false finishes running before we try to talk to it or not.
- dotest_fail crerepos-6a "CVS_RSH=false ${testcvs} -q -d ../crerepos
get ." \
-"${SPROG} \[checkout aborted\]: .*"
+ # CVS used to interpret this case as hostname/path, but that
+ # changed with 1.12.22 to interpreting it as a relative path
+ # and rejecting it.
+ dotest_fail crerepos-6a "$testcvs -q -d ../crerepos get ." \
+"$SPROG checkout: CVSROOT must be an absolute pathname (not \`\.\./crerepos')
+$SPROG checkout: when using local access method\.
+$SPROG \[checkout aborted\]: Bad CVSROOT: \`\.\./crerepos'\."
cd ..
rm -r 1
@@ -23661,16 +23661,10 @@
dotest parseroot2-1 "$testcvs -Q co CVSROOT"
cd CVSROOT
dotest parseroot2-2 "$testcvs -Q up"
- cd ..
- # A degenerate remote case, just the server name and the directory
- # name, with no :'s to help parsing. It can be mistaken for a
- # relative directory name.
- rm -r CVSROOT
- CVSROOT=$host$CVSROOT_DIRNAME
- dotest parseroot2-3 "$testcvs -Q co CVSROOT"
- cd CVSROOT
- dotest parseroot2-4 "$testcvs -Q up"
+ # parseroot2-3 & parseroot2-4 used to test the old degenerate case
+ # hostname/path, but CVS now interprets that as a relative path and
+ # rejects it, as tested in crerepos-6a.
dokeep
cd ../..
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Cvs-cvs] ccvs/src ChangeLog root.c sanity.sh,
Derek Robert Price <=