CVS update: /ccvs/src/

[email protected] 26 May 2005 17:48:08 -0000
Newsgroups gmane.comp.version-control.cvs.cvs
Message-ID <[email protected]>
User: dprice  
Date: 05/05/26 10:48:08

Modified:
 /ccvs/src/
  ChangeLog, checkout.c, client.c, find_names.c, import.c, modules.c,
  parseinfo.c, repos.c, root.c, server.c, subr.c, subr.h

Log:
 * subr.c (isabsolute), subr.h (isabsolute): Remove this function.
 * root.c: Likewise, plus some reformatting.
 * checkout.c, client.c, find_names.c, import.c, modules.c, parseinfo.c,
 repos.c, root.c, server.c, subr.c: s/isabsolute/ISABSOLUTE/.

File Changes:

Directory: /ccvs/src/
=====================

File [changed]: ChangeLog
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/ChangeLog?r1=1.3199&r2=1.3200
Delta lines:  +7 -0
-------------------
--- ChangeLog	26 May 2005 17:12:54 -0000	1.3199
+++ ChangeLog	26 May 2005 17:48:05 -0000	1.3200
@@ -1,5 +1,12 @@
 2005-05-26  Derek Price  <[email protected]>
 
+	* subr.c (isabsolute), subr.h (isabsolute): Remove this function.
+	* root.c: Likewise, plus some reformatting.
+	* checkout.c, client.c, find_names.c, import.c, modules.c, parseinfo.c,
+	repos.c, root.c, server.c, subr.c: s/isabsolute/ISABSOLUTE/.
+
+2005-05-26  Derek Price  <[email protected]>
+
 	* cvs.h: Move "system.h" include before GNULIB includes.  Move some
 	GNULIB includes from "system.h".
 

File [changed]: checkout.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/checkout.c?r1=1.141&r2=1.142
Delta lines:  +2 -2
-------------------
--- checkout.c	23 May 2005 22:56:41 -0000	1.141
+++ checkout.c	26 May 2005 17:48:05 -0000	1.142
@@ -703,7 +703,7 @@
            directory, let the user override it with the command-line
            -d option. */
 
-	if ((mwhere != NULL) && (! isabsolute (mwhere)))
+	if (mwhere && !ISABSOLUTE (mwhere))
 	    (void) strcat (where, mwhere);
 	else
 	    (void) strcat (where, argv[0]);
@@ -929,7 +929,7 @@
 	   build_one_dir whenever the -d command option was specified
 	   to checkout.  */
 
-	if (!isabsolute (where) && config->top_level_admin
+	if (!ISABSOLUTE (where) && config->top_level_admin
 	    && m_type == CHECKOUT)
 	{
 	    /* It may be argued that we shouldn't set any sticky

File [changed]: client.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/client.c?r1=1.424&r2=1.425
Delta lines:  +1 -1
-------------------
--- client.c	24 May 2005 20:59:01 -0000	1.424
+++ client.c	26 May 2005 17:48:05 -0000	1.425
@@ -706,7 +706,7 @@
 int is_valid_client_path (const char *pathname)
 {
     /* 1. Absolute paths. */
-    if (isabsolute (pathname)) return 0;
+    if (ISABSOLUTE (pathname)) return 0;
     /* 2. No up-references in path.  */
     if (pathname_levels (pathname) == 0) return 1;
     /* 2. No Max-dotdot paths registered.  */

File [changed]: find_names.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/find_names.c?r1=1.42&r2=1.43
Delta lines:  +1 -1
-------------------
--- find_names.c	11 May 2005 20:01:47 -0000	1.42
+++ find_names.c	26 May 2005 17:48:06 -0000	1.43
@@ -427,7 +427,7 @@
     /* First figure out whether we need to skip directories named
        Emptydir.  Except in the CVSNULLREPOS case, Emptydir is just
        a normal directory name.  */
-    if (isabsolute (dir)
+    if (ISABSOLUTE (dir)
 	&& strncmp (dir, current_parsed_root->directory, strlen (current_parsed_root->directory)) == 0
 	&& ISSLASH (dir[strlen (current_parsed_root->directory)])
 	&& strcmp (dir + strlen (current_parsed_root->directory) + 1, CVSROOTADM) == 0)

File [changed]: import.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/import.c?r1=1.170&r2=1.171
Delta lines:  +1 -1
-------------------
--- import.c	24 May 2005 20:59:01 -0000	1.170
+++ import.c	26 May 2005 17:48:06 -0000	1.171
@@ -206,7 +206,7 @@
 		error (1, 0, "tag `%s' was specified more than once", argv[i]);
     }
 
-    if (isabsolute (argv[0]) || pathname_levels (argv[0]) > 0)
+    if (ISABSOLUTE (argv[0]) || pathname_levels (argv[0]) > 0)
 	/* It is somewhere between a security hole and "unexpected" to
 	   let the client start mucking around outside the cvsroot
 	   (wouldn't get the right CVSROOT configuration, &c).  */

File [changed]: modules.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/modules.c?r1=1.95&r2=1.96
Delta lines:  +1 -1
-------------------
--- modules.c	22 Mar 2005 13:19:57 -0000	1.95
+++ modules.c	26 May 2005 17:48:06 -0000	1.96
@@ -144,7 +144,7 @@
      *   cvs [server aborted]: cannot make directory /foo: Permission denied
      *   $
      */
-    if (isabsolute (mname))
+    if (ISABSOLUTE (mname))
 	error (1, 0, "Absolute module reference invalid: `%s'", mname);
 
     /* Similarly for directories that attempt to step above the root of the

File [changed]: parseinfo.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/parseinfo.c?r1=1.75&r2=1.76
Delta lines:  +2 -2
-------------------
--- parseinfo.c	11 May 2005 20:01:47 -0000	1.75
+++ parseinfo.c	26 May 2005 17:48:06 -0000	1.76
@@ -498,7 +498,7 @@
 	    /* Expand ~ & $VARs.  */
 	    retval->HistoryLogPath = expand_path (p, infopath, ln, false);
 
-	    if (retval->HistoryLogPath && !isabsolute (retval->HistoryLogPath))
+	    if (retval->HistoryLogPath && !ISABSOLUTE (retval->HistoryLogPath))
 	    {
 		error (0, 0, "%s [%u]: HistoryLogPath must be absolute.",
 		       infopath, ln);
@@ -512,7 +512,7 @@
 	    retval->HistorySearchPath = expand_path (p, infopath, ln, false);
 
 	    if (retval->HistorySearchPath
-		&& !isabsolute (retval->HistorySearchPath))
+		&& !ISABSOLUTE (retval->HistorySearchPath))
 	    {
 		error (0, 0, "%s [%u]: HistorySearchPath must be absolute.",
 		       infopath, ln);

File [changed]: repos.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/repos.c?r1=1.40&r2=1.41
Delta lines:  +1 -1
-------------------
--- repos.c	16 Mar 2005 22:00:49 -0000	1.40
+++ repos.c	26 May 2005 17:48:06 -0000	1.41
@@ -104,7 +104,7 @@
      * this function is called, we the contents of CVS/Root have already been
      * compared to original_root and found to match.
      */
-    if (!isabsolute (repos))
+    if (!ISABSOLUTE (repos))
     {
 	char *newrepos;
 

File [changed]: root.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/root.c?r1=1.113&r2=1.114
Delta lines:  +11 -17
---------------------
--- root.c	16 Mar 2005 22:07:46 -0000	1.113
+++ root.c	26 May 2005 17:48:06 -0000	1.114
@@ -776,7 +776,7 @@
 	   pathname produced various errors (I couldn't get it to work),
 	   so there would seem to be little risk in making this a fatal
 	   error.  */
-	if (!isabsolute (newroot->directory))
+	if (!ISABSOLUTE (newroot->directory))
 	{
 	    error (0, 0, "CVSROOT must be an absolute pathname (not `%s')",
 		   newroot->directory);
@@ -804,7 +804,7 @@
 	    goto error_exit;
 	}
 	newroot->hostname = xstrdup("server");  /* for error messages */
-	if (!isabsolute (newroot->directory))
+	if (!ISABSOLUTE (newroot->directory))
 	{
 	    error (0, 0, "CVSROOT must be an absolute pathname (not `%s')",
 		   newroot->directory);
@@ -1018,18 +1018,8 @@
 char *program_name = "testing";
 char *cvs_cmd_name = "parse_cvsroot";		/* XXX is this used??? */
 
-/* Toy versions of various functions when debugging under unix.  Yes,
-   these make various bad assumptions, but they're pretty easy to
-   debug when something goes wrong.  */
-
-int
-isabsolute( const char *dir )
-{
-    return (dir && (*dir == '/'));
-}
-
 void
-main( int argc, char *argv[] )
+main (int argc, char *argv[])
 {
     program_name = argv[0];
 
@@ -1045,12 +1035,16 @@
 	exit (1);
     }
     printf ("CVSroot: %s\n", argv[1]);
-    printf ("current_parsed_root->method: %s\n", method_names[current_parsed_root->method]);
+    printf ("current_parsed_root->method: %s\n",
+	    method_names[current_parsed_root->method]);
     printf ("current_parsed_root->username: %s\n",
-	    current_parsed_root->username ? current_parsed_root->username : "NULL");
+	    current_parsed_root->username
+	      ? current_parsed_root->username : "NULL");
     printf ("current_parsed_root->hostname: %s\n",
-	    current_parsed_root->hostname ? current_parsed_root->hostname : "NULL");
-    printf ("current_parsed_root->directory: %s\n", current_parsed_root->directory);
+	    current_parsed_root->hostname
+	      ? current_parsed_root->hostname : "NULL");
+    printf ("current_parsed_root->directory: %s\n",
+	    current_parsed_root->directory);
 
    exit (0);
    /* NOTREACHED */

File [changed]: server.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/server.c?r1=1.430&r2=1.431
Delta lines:  +9 -9
-------------------
--- server.c	24 May 2005 20:59:02 -0000	1.430
+++ server.c	26 May 2005 17:48:06 -0000	1.431
@@ -800,7 +800,7 @@
 # endif /* PROXY_SUPPORT */
        ) return;
 
-    if (!isabsolute (arg))
+    if (!ISABSOLUTE (arg))
     {
 	if (alloc_pending (80 + strlen (arg)))
 	    sprintf (pending_error_text,
@@ -913,7 +913,7 @@
     /* An absolute pathname is almost surely a path on the *client* machine,
        and is unlikely to do us any good here.  It also is probably capable
        of being a security hole in the anonymous readonly case.  */
-    if (isabsolute (path))
+    if (ISABSOLUTE (path))
 	/* Giving an error is actually kind of a cop-out, in the sense
 	   that it would be nice for "cvs co -d /foo/bar/baz" to work.
 	   A quick fix in the server would be requiring Max-dotdot of
@@ -931,7 +931,7 @@
 		path );
     if (pathname_levels (path) > max_dotdot_limit)
     {
-	/* Similar to the isabsolute case in security implications.  */
+	/* Similar to the ISABSOLUTE case in security implications.  */
 	error (0, 0, "protocol error: `%s' contains more leading ..", path);
 	error (1, 0, "than the %d which Max-dotdot specified",
 	       max_dotdot_limit);
@@ -949,10 +949,10 @@
     size_t repos_len = strlen (repos);
     size_t root_len = strlen (current_parsed_root->directory);
 
-    /* isabsolute (repos) should always be true, but
+    /* ISABSOLUTE (repos) should always be true, but
        this is a good security precaution regardless. -DRP
      */
-    if (!isabsolute (repos))
+    if (!ISABSOLUTE (repos))
     {
 	if (alloc_pending (repos_len + 80))
 	    sprintf (pending_error_text, "\
@@ -1060,7 +1060,7 @@
 
        FIXME: could/should unify these checks with server_pathname_check
        except they need to report errors differently.  */
-    if (isabsolute (dir))
+    if (ISABSOLUTE (dir))
     {
 	if (alloc_pending (80 + strlen (dir)))
 	    sprintf ( pending_error_text,
@@ -1275,7 +1275,7 @@
     status = buf_read_line (buf_from_net, &repos, NULL);
     if (status == 0)
     {
-	if (!isabsolute (repos))
+	if (!ISABSOLUTE (repos))
 	{
 	    /* Make absolute.
 	     *
@@ -4685,7 +4685,7 @@
 {
     cvsroot_t *saved_parsed_root;
 
-    if (!isabsolute (arg))
+    if (!ISABSOLUTE (arg))
     {
 	if (alloc_pending (80 + strlen (arg)))
 	    sprintf (pending_error_text,
@@ -6225,7 +6225,7 @@
 	/* The code which wants to chdir into server_temp_dir is not set
 	   up to deal with it being a relative path.  So give an error
 	   for that case.  */
-	if (!isabsolute (Tmpdir))
+	if (!ISABSOLUTE (Tmpdir))
 	{
 	    if (alloc_pending (80 + strlen (Tmpdir)))
 		sprintf (pending_error_text,

File [changed]: subr.c
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/subr.c?r1=1.142&r2=1.143
Delta lines:  +1 -12
--------------------
--- subr.c	24 May 2005 20:59:02 -0000	1.142
+++ subr.c	26 May 2005 17:48:06 -0000	1.143
@@ -774,7 +774,7 @@
 	   expedient hack seems to be looking at HAVE_READLINK.  */
 	char *newname = Xreadlink (*filename, rsize);
 	
-	if (isabsolute (newname))
+	if (ISABSOLUTE (newname))
 	{
 	    free (*filename);
 	    *filename = newname;
@@ -1834,17 +1834,6 @@
 
 
 
-/* Return true iff FILENAME is absolute.
-   Trivial under Unix, but more complicated under other systems.  */
-bool
-isabsolute (filename)
-    const char *filename;
-{
-    return ISABSOLUTE (filename);
-}
-
-
-
 /* Like xstrdup (), but can handle a NULL argument.
  */
 char *

File [changed]: subr.h
Url: https://ccvs.cvshome.org/source/browse/ccvs/src/subr.h?r1=1.4&r2=1.5
Delta lines:  +0 -2
-------------------
--- subr.h	23 May 2005 22:56:42 -0000	1.4
+++ subr.h	26 May 2005 17:48:06 -0000	1.5
@@ -72,8 +72,6 @@
 char *format_cmdline (const char *format, ...);
 #endif /* SUPPORT_OLD_INFO_FMT_STRINGS */
 
-bool isabsolute (const char *filename);
-
 /* Many, many CVS calls to xstrdup depend on it to return NULL when its
  * argument is NULL.
  */