*BSD News Article 37446


Return to BSD News archive

Path: sserve!newshost.anu.edu.au!harbinger.cc.monash.edu.au!bunyip.cc.uq.oz.au!munnari.oz.au!spool.mu.edu!howland.reston.ans.net!gatech!news-feed-1.peachnet.edu!news.duke.edu!godot.cc.duq.edu!toads.pgh.pa.us!w2xo!durham
From: durham@w2xo.pgh.pa.us (James C. Durham)
Newsgroups: comp.os.386bsd.questions
Subject: Fix for "#" sign problem in Taylor UUCP on FreeBSD-1.1.5.1
Keywords: Taylor UUCP
Message-ID: <41@w2xo.pgh.pa.us>
Date: 3 Nov 94 04:42:54 GMT
Organization: Jims Basement, Gibsonia,PA
Lines: 133


I had filed a bug report on an apparent problem with uuxqt truncating
arguments to rmail when they were addresses containing a "#" sign.

I had thought the problem was with exec(), because the same problem
would occur in passing arguments to a program being debugged under
GDB.

However, the problem turned out to be in the version of Taylor UUCP
bundled with FreeBSD-1.1.5.1.

Ian Taylor replied to e-mail I sent him with a set of patches.
Here is his reply:

From: ian@airs.com (Ian Lance Taylor)
Subject: Re: problem with rmail argument(address)
To: durham@w2xo.pgh.pa.us
Date: Mon, 31 Oct 94 21:49:21 -0500
Cc: taylor-uucp@gnu.ai.mit.edu
In-Reply-To: <199410310653.BAA13735@w2xo.pgh.pa.us>; from "durham@w2xo.pgh.pa.us" at Oct 31, 94 1:53 am
X-Mailer: ELM [version 2.3 PL11]
Status: R

> I am running a gateway from internet to ham packet radio. These
> addresses contain a "#" pound sign. The addresses are of
> the form "call%bbs-address@w2xo.pgh.pa.us". The "bbs-address" part
> could be similar to "k4xxx.#nva.va.usa.na" .  When these addresses
> are passed to rmail by uuxqt, they are truncated at the "#" .
> This was not happening with Ultrix on a Microvax, which I used
> up until a few months ago.

This is a known problem in 1.05.  Here is the patch.

*** 1.32	1994/01/30 20:59:40
--- common_sources/uuconf.h	1994/06/28 00:57:50
*************** struct uuconf_cmdtab
*** 1418,1423 ****
--- 1418,1427 ----
  /* If set, a backslash at the end of a line may be used to include the
     next physical line in the logical line.  */
  #define UUCONF_CMDTABFLAG_BACKSLASH (0x2)
+ 
+ /* If set, the comment character (#) is treated as a normal character,
+    rather than as starting a comment.  */
+ #define UUCONF_CMDTABFLAG_NOCOMMENTS (0x4)
  
  #if UUCONF_ANSI_C
  
*** 1.76	1994/01/30 20:59:40
--- uuxqt/uuxqt.c	1994/06/28 00:59:29
*************** uqdo_xqt_file (puuconf, zfile, zbase, qs
*** 742,748 ****
  
    iuuconf = uuconf_cmd_file (puuconf, e, asQcmds, (pointer) zbase,
  			     (uuconf_cmdtabfn) NULL,
! 			     UUCONF_CMDTABFLAG_CASE, (pointer) NULL);
    (void) fclose (e);
  
    if (iuuconf != UUCONF_SUCCESS)
--- 742,750 ----
  
    iuuconf = uuconf_cmd_file (puuconf, e, asQcmds, (pointer) zbase,
  			     (uuconf_cmdtabfn) NULL,
! 			     (UUCONF_CMDTABFLAG_CASE
! 			      | UUCONF_CMDTABFLAG_NOCOMMENTS),
! 			     (pointer) NULL);
    (void) fclose (e);
  
    if (iuuconf != UUCONF_SUCCESS)
*** 1.3	1994/01/30 21:14:29
--- libuuconf/cmdlin.c	1994/06/28 00:58:46
*************** uuconf_cmd_line (pglobal, zline, qtab, p
*** 56,73 ****
    char **pzargs;
    int iret;
  
!   /* Any # not preceeded by a backslash starts a comment.  */
!   z = zline;
!   while ((z = strchr (z, '#')) != NULL)
      {
!       if (z == zline || *(z - 1) != '\\')
  	{
! 	  *z = '\0';
! 	  break;
  	}
-       /* Remove the backslash.  */
-       while ((*(z - 1) = *z) != '\0')
- 	++z;
      }
  
    /* Parse the first CSTACK arguments by hand to avoid malloc.  */
--- 56,76 ----
    char **pzargs;
    int iret;
  
!   if ((iflags & UUCONF_CMDTABFLAG_NOCOMMENTS) == 0)
      {
!       /* Any # not preceeded by a backslash starts a comment.  */
!       z = zline;
!       while ((z = strchr (z, '#')) != NULL)
  	{
! 	  if (z == zline || *(z - 1) != '\\')
! 	    {
! 	      *z = '\0';
! 	      break;
! 	    }
! 	  /* Remove the backslash.  */
! 	  while ((*(z - 1) = *z) != '\0')
! 	    ++z;
  	}
      }
  
    /* Parse the first CSTACK arguments by hand to avoid malloc.  */


-- 
Ian Taylor | ian@airs.com | First to identify quote wins free e-mail message:
``You don't have to sleep.  That's just something *they* tell you to keep
  *control* over you.  Nobody has to sleep; you're *taught* to sleep when
  you're a kid.  If you're really determined, you can get over it.''



I actually "patched" this patch slightly so that the path names reflect
the way that FreeBSD is organized.

This should work if run from the "uucp" directory in the source tree.

Thanks also to others who replied and to the FreeBSD gang who also took
an interest.

-Jim Durham