[comp.protocols.appletalk] New Columbia AppleTalk Package, Patches 1-3.

djh@cs.mu.oz.au (David Hornsby) (03/20/91)

Enclosed are a couple of patches to fix 2 silly typos in the CAP 6.0
distribution. The first bug affects sites with CAP host node numbers
greater than 127, the second for sites using the RUTGERS defines in
papif.c. Bug 3 exists in CAP 5.0 or 6.0 and ru-cap2, the enclosed
third patch is only directly applicable to CAP 6.0 files. This bug
occurs in the situation where the afpvols file contains ~bart where
"bart" is not a valid user. My thanks to the people who reported these.

I should also mention that patches for CAP 6.0 are numbered and if
applied in order will generate the next distribution. Patches are
being archived on munnari.OZ.AU in the directory mac/cap.patches,
other archive sites may decide to collect them too ...

 - David.

[The patch program is by Larry Wall, you can get it from your
nearest comp.sources.unix archive, volume7/patch2 or later ]

---------cut-x-here-----------------
Patch #:	1
Type:		bug fix
Priority:	high
Affects:	sites with CAP host node number > 127
Reported:	David N. Blank <dnb@meshugge.media.mit.edu>
Archived:	munnari.OZ.AU	mac/cap.patches/cap60.patch001
Summary:	uses bogus mask value
File:		cap60/lib/cap/atalkdbm.c

*** lib/cap/atalkdbm.c.orig	Wed Mar 20 17:02:57 1991
--- lib/cap/atalkdbm.c		Wed Mar 20 17:03:30 1991
***************
*** 1,7 ****
  /*
!  * $Date: 91/03/15 14:56:00 $
!  * $Header: atalkdbm.c,v 2.3 91/03/15 14:56:00 djh Exp $
!  * $Revision: 2.3 $
   *
   * mods for async appletalk support, /etc/etalk.local for EtherTalk and
   * changes for quoted zone names: djh@munnari.OZ.AU, 27/11/90
--- 1,7 ----
  /*
!  * $Date: 91/03/20 16:52:56 $
!  * $Header: atalkdbm.c,v 2.4 91/03/20 16:52:56 djh Exp $
!  * $Revision: 2.4 $
   *
   * mods for async appletalk support, /etc/etalk.local for EtherTalk and
   * changes for quoted zone names: djh@munnari.OZ.AU, 27/11/90
***************
*** 196,202 ****
        getfield(st, sizeof(st), 0);
        this_net = htons(atnetshort(st));
        getfield(st, sizeof(st), 0);
!       this_node = atoi(st) & 0x7f;
        getfield(this_zone, sizeof(this_zone), 0);
        if (this_net == 0 || this_node == 0 || *this_zone == '\0') {
  	fprintf(stderr, "openatalkdb: in %s, error at line %d\n",fn,linecnt);
--- 196,202 ----
        getfield(st, sizeof(st), 0);
        this_net = htons(atnetshort(st));
        getfield(st, sizeof(st), 0);
!       this_node = atoi(st) & 0xff;
        getfield(this_zone, sizeof(this_zone), 0);
        if (this_net == 0 || this_node == 0 || *this_zone == '\0') {
  	fprintf(stderr, "openatalkdb: in %s, error at line %d\n",fn,linecnt);
---------cut-x-here-----------------
Patch #:	2
Type:		bug fix
Priority:	high
Affects:	papif with RUTGERS defined code segments
Reported:	Nihei Akira <nihei@stella.src.ricoh.co.jp>
Archived:	munnari.OZ.AU	mac/cap.patches/cap60.patch002
Summary:	bad parenthesis placement, papif dies
File:		cap60/applications/papif/papif.c

*** applications/papif/papif.c.orig	Thu Mar 14 13:52:42 1991
--- applications/papif/papif.c		Wed Mar 20 16:57:32 1991
***************
*** 1,6 ****
! static char rcsid[] = "$Author: djh $ $Date: 91/03/14 13:51:43 $";
! static char rcsident[] = "$Header: papif.c,v 2.2 91/03/14 13:51:43 djh Exp $";
! static char revision[] = "$Revision: 2.2 $";
  
  /*
   * papif - UNIX AppleTalk test program: simple line printer input filter 
--- 1,6 ----
! static char rcsid[] = "$Author: djh $ $Date: 91/03/20 16:56:56 $";
! static char rcsident[] = "$Header: papif.c,v 2.3 91/03/20 16:56:56 djh Exp $";
! static char revision[] = "$Revision: 2.3 $";
  
  /*
   * papif - UNIX AppleTalk test program: simple line printer input filter 
***************
*** 357,363 ****
      }
    }
  #ifdef RUTGERS
!   if ((psreverse != NULL || pstext != NULL) && strcmp(filtername,"psdf" != 0))
  #else RUTGERS
    if (psreverse != NULL || pstext != NULL)
  #endif RUTGERS
--- 357,363 ----
      }
    }
  #ifdef RUTGERS
!   if ((psreverse != NULL || pstext != NULL) && strcmp(filtername,"psdf") != 0)
  #else RUTGERS
    if (psreverse != NULL || pstext != NULL)
  #endif RUTGERS
---------cut-x-here-----------------
Patch #:	3
Type:		bug fix
Priority:	medium
Affects:	afpvols files with ~noSuchUser
Reported:	Maarten Carels <maarten@fwi.uva.nl>
Archived:	munnari.OZ.AU	mac/cap.patches/cap60.patch003
Summary:	logdir() return value not checked properly
File:		cap60/applications/aufs/afpos.c
File:		cap60/applications/aufs/afpvols.c

*** applications/aufs/afpos.c.orig	Wed Mar 13 19:40:32 1991
--- applications/aufs/afpos.c		Wed Mar 20 17:30:24 1991
***************
*** 1,7 ****
  /*
!  * $Author: djh $ $Date: 91/03/13 19:39:13 $
!  * $Header: afpos.c,v 2.2 91/03/13 19:39:13 djh Exp $
!  * $Revision: 2.2 $
   */
  
  /*
--- 1,7 ----
  /*
!  * $Author: djh $ $Date: 91/03/20 17:28:44 $
!  * $Header: afpos.c,v 2.3 91/03/20 17:28:44 djh Exp $
!  * $Revision: 2.3 $
   */
  
  /*
***************
*** 2957,2963 ****
  char *s;
  {
    static char path[MAXPATHLEN];
!   char *sp,*logdir();
    
    if (*s != '~')			/* start with tilde? */
      return(s);				/* no, return original */
--- 2957,2963 ----
  char *s;
  {
    static char path[MAXPATHLEN];
!   char *sp,*logdir(),*l;
    
    if (*s != '~')			/* start with tilde? */
      return(s);				/* no, return original */
***************
*** 2975,2981 ****
      return(logdir(s));			/*  return ~john expanded */
  
    *sp = '\0';				/* otherwise tie off ~bill/mac */
!   strcpy(path,logdir(s));		/* copy in the expanded ~bill */
    *sp = '/';				/* ... put back slash */
    strcat(path,sp);			/* append the remainder */
    return(path);				/* and return it */
--- 2975,2983 ----
      return(logdir(s));			/*  return ~john expanded */
  
    *sp = '\0';				/* otherwise tie off ~bill/mac */
!   if ((l = logdir(s)) == NULL)		/* does the user exist? */
! 	return NULL;
!   strcpy(path,l);			/* copy in the expanded ~bill */
    *sp = '/';				/* ... put back slash */
    strcat(path,sp);			/* append the remainder */
    return(path);				/* and return it */
*** applications/aufs/afpvols.c.orig	Wed Mar 13 20:29:48 1991
--- applications/aufs/afpvols.c		Wed Mar 20 17:31:00 1991
***************
*** 1,7 ****
  /*
!  * $Author: djh $ $Date: 91/03/13 20:29:41 $
!  * $Header: afpvols.c,v 2.2 91/03/13 20:29:41 djh Exp $
!  * $Revision: 2.2 $
  */
  
  /*
--- 1,7 ----
  /*
!  * $Author: djh $ $Date: 91/03/20 17:30:37 $
!  * $Header: afpvols.c,v 2.3 91/03/20 17:30:37 djh Exp $
!  * $Revision: 2.3 $
  */
  
  /*
***************
*** 187,192 ****
--- 187,194 ----
      pswdp = p; p = vskip(p);		/* save it */
      if (DBVOL) printf("VRdVFile: pswdp : %s\n",pswdp);
      pathp = tilde(pathp);		/* expand the path */
+     if (pathp == NULL)			/* non existent user */
+       continue;				/* skip it */
      if (DBVOL) printf("VRdVFile: pathp after tilde : %s\n",pathp);
      VNew(pathp,namep,pswdp);		/* add new entry */
    }
---------cut-x-here-----------------