Patch #: 3 Type: bug fix Priority: medium Affects: afpvols files with ~noSuchUser Reported: Maarten Carels 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 */ }