system/5076: OpenBSD rlog appends ',v' unconditionally

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

system/5076: OpenBSD rlog appends ',v' unconditionally

Nikolay Sturm-3
>Number:         5076
>Category:       system
>Synopsis:       rlog appends ',v' unconditionally to file names
>Confidential:   yes
>Severity:       serious
>Priority:       medium
>Responsible:    bugs
>State:          open
>Quarter:        
>Keywords:      
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 14 20:10:01 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Nikolay Sturm
>Release:        -current
>Organization:
net
>Environment:
       
        System      : OpenBSD 3.9
        Architecture: OpenBSD.i386
        Machine     : i386
>Description:
       
rlog appends ',v' unconditionally to file names, breaking other tools
like cvsweb. gnu rlog only adds ',v' if it is missing
>How-To-Repeat:
       
eris:1$ rlog -r /a/devel/cvs/ports/README,v                                    
rlog: /a/devel/cvs/ports/README,v,v: No such file or directory

>Fix:
       

>Release-Note:
>Audit-Trail:
>Unformatted:

Reply | Threaded
Open this post in threaded view
|

Re: system/5076: OpenBSD rlog appends ',v' unconditionally

Nikolay Sturm-3
The following reply was made to PR system/5076; it has been noted by GNATS.

From: Nikolay Sturm <[hidden email]>
To: Joris Vink <[hidden email]>
Cc: [hidden email], [hidden email], [hidden email], [hidden email]
Subject: Re: system/5076: OpenBSD rlog appends ',v' unconditionally
Date: Fri, 14 Apr 2006 22:38:58 +0200

 * Joris Vink [2006-04-14]:
 > The problem was being caused by rcs_choosefile() not checking
 > if the given argument existed in the first place.
 > Which resulted in an extra ,v to be appended when it was doing it's voodoo.
 >
 > The following diff should resolve the problem.
 
 Ack, this fixes the problem.
 
 Nikolay

Reply | Threaded
Open this post in threaded view
|

Re: system/5076: OpenBSD rlog appends ',v' unconditionally

Joris Vink-2
In reply to this post by Nikolay Sturm-3
The following reply was made to PR system/5076; it has been noted by GNATS.

From: Joris Vink <[hidden email]>
To: [hidden email]
Cc: [hidden email], [hidden email], [hidden email], [hidden email]
Subject: Re: system/5076: OpenBSD rlog appends ',v' unconditionally
Date: Fri, 14 Apr 2006 15:38:16 -0500

 On Fri, Apr 14, 2006 at 10:00:14PM +0200, [hidden email] wrote:
 > >Number:         5076
 > >Category:       system
 > >Synopsis:       rlog appends ',v' unconditionally to file names
 > >Confidential:   yes
 > >Severity:       serious
 > >Priority:       medium
 > >Responsible:    bugs
 > >State:          open
 > >Quarter:        
 > >Keywords:      
 > >Date-Required:
 > >Class:          sw-bug
 > >Submitter-Id:   net
 > >Arrival-Date:   Fri Apr 14 20:10:01 GMT 2006
 > >Closed-Date:
 > >Last-Modified:
 > >Originator:     Nikolay Sturm
 > >Release:        -current
 > >Organization:
 > net
 > >Environment:
 >
 > System      : OpenBSD 3.9
 > Architecture: OpenBSD.i386
 > Machine     : i386
 > >Description:
 >
 > rlog appends ',v' unconditionally to file names, breaking other tools
 > like cvsweb. gnu rlog only adds ',v' if it is missing
 > >How-To-Repeat:
 >
 > eris:1$ rlog -r /a/devel/cvs/ports/README,v                                    
 > rlog: /a/devel/cvs/ports/README,v,v: No such file or directory
 >
 > >Fix:
 >
 >
 > >Release-Note:
 > >Audit-Trail:
 > >Unformatted:
 
 The problem was being caused by rcs_choosefile() not checking
 if the given argument existed in the first place.
 Which resulted in an extra ,v to be appended when it was doing it's voodoo.
 
 The following diff should resolve the problem.
 
 Index: rcsprog.c
 ===================================================================
 RCS file: /cvs/src/usr.bin/rcs/rcsprog.c,v
 retrieving revision 1.102
 diff -u -p -r1.102 rcsprog.c
 --- rcsprog.c 14 Apr 2006 01:11:07 -0000 1.102
 +++ rcsprog.c 14 Apr 2006 20:33:25 -0000
 @@ -239,6 +239,11 @@ rcs_choosefile(const char *filename)
  if (rcs_suffixes == NULL)
  rcs_suffixes = RCS_DEFAULT_SUFFIX;
 
 + if (stat(filename, &sb) != -1) {
 + ret = xstrdup(filename);
 + return (ret);
 + }
 +
  /*
  * If `filename' contains a directory, `rcspath' contains that
  * directory, including a trailing slash.  Otherwise `rcspath'
 
  .joris

Reply | Threaded
Open this post in threaded view
|

Re: system/5076: OpenBSD rlog appends ',v' unconditionally

Joris Vink-2
In reply to this post by Nikolay Sturm-3
The following reply was made to PR system/5076; it has been noted by GNATS.

From: Joris Vink <[hidden email]>
To: Nikolay Sturm <[hidden email]>
Cc: [hidden email], [hidden email], [hidden email], [hidden email]
Subject: Re: system/5076: OpenBSD rlog appends ',v' unconditionally
Date: Fri, 14 Apr 2006 15:55:22 -0500

 On Fri, Apr 14, 2006 at 10:38:58PM +0200, Nikolay Sturm wrote:
 >
 > Ack, this fixes the problem.
 >
 
 I managed to break about everything else with the previous diff,
 this one passes regression and solves the problem.
 
 Index: rcsprog.c
 ===================================================================
 RCS file: /cvs/src/usr.bin/rcs/rcsprog.c,v
 retrieving revision 1.102
 diff -u -p -r1.102 rcsprog.c
 --- rcsprog.c 14 Apr 2006 01:11:07 -0000 1.102
 +++ rcsprog.c 14 Apr 2006 20:51:45 -0000
 @@ -232,7 +232,7 @@ char *
  rcs_choosefile(const char *filename)
  {
  struct stat sb;
 - char *ext, name[MAXPATHLEN], *next, *ptr, rcsdir[MAXPATHLEN],
 + char *p, *ext, name[MAXPATHLEN], *next, *ptr, rcsdir[MAXPATHLEN],
     *ret, *suffixes, rcspath[MAXPATHLEN];
 
  /* If -x flag was not given, use default. */
 @@ -294,6 +294,15 @@ rcs_choosefile(const char *filename)
  for (ret = NULL, next = suffixes; (ext = strsep(&next, "/")) != NULL;) {
  char fpath[MAXPATHLEN];
 
 + if ((p = strrchr(rcspath, ',')) != NULL) {
 + if (!strcmp(p, ext)) {
 + if (stat(rcspath, &sb) == 0) {
 + ret = xstrdup(rcspath);
 + goto out;
 + }
 + }
 + }
 +
  /* Construct RCS file path. */
  if (strlcpy(fpath, rcspath, sizeof(fpath)) >= sizeof(fpath) ||
     strlcat(fpath, ext, sizeof(fpath)) >= sizeof(fpath))
 @@ -338,7 +347,6 @@ rcs_statfile(char *fname, char *out, siz
  struct stat st;
  char *rcspath;
 
 - /* XXX - do this in rcs_choosefile? */
  if ((rcspath = rcs_choosefile(fname)) == NULL)
  fatal("rcs_statfile: path truncation");
 
  .joris

Reply | Threaded
Open this post in threaded view
|

Re: system/5076: OpenBSD rlog appends ',v' unconditionally

Nikolay Sturm-3
In reply to this post by Nikolay Sturm-3
The following reply was made to PR system/5076; it has been noted by GNATS.

From: Nikolay Sturm <[hidden email]>
To: Joris Vink <[hidden email]>
Cc: [hidden email], [hidden email], [hidden email], [hidden email]
Subject: Re: system/5076: OpenBSD rlog appends ',v' unconditionally
Date: Fri, 14 Apr 2006 23:02:56 +0200

 * Joris Vink [2006-04-14]:
 > I managed to break about everything else with the previous diff,
 > this one passes regression and solves the problem.
 
 But it breaks something else. In cvsweb I now get this message when I
 look at a port's directory:
 
 NOTE: There are 2 files, but none matches the current tag ().
 
 I'll try to figure out what command causes this.
 
 Nikolay