Patch #: 41 Type: bug fix Priority: medium Affects: sites using lwsrv with LWSRV_AUFS_SECURITY Reported: AAke Holmlund Archived: munnari.OZ.AU mac/cap.patches/cap60.patch041 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch041' Summary: ensure authentication files are closed properly File: cap60/applications/lwsrv/lwsrv.c *** applications/lwsrv/lwsrv.c.orig Thu Jul 11 00:03:15 1991 --- applications/lwsrv/lwsrv.c Sun Jul 28 22:04:09 1991 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/07/10 14:03:03 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.7 1991/07/10 14:03:03 djh Rel djh $"; ! static char revision[] = "$Revision: 2.7 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1991/07/28 12:03:41 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.8 1991/07/28 12:03:41 djh Rel djh $"; ! static char revision[] = "$Revision: 2.8 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 429,436 **** struct stat statbuf; ok = 0; /* false */ make_userlogin( filename, aufsdb, addr ); ! if( (f = open( filename, 0)) >= 0 && ! (cc = read( f, fname, sizeof( fname )-1 )) > 0 ) { if( fname[cc-1] == '\n' ) fname[cc-1] = '\0'; fprintf( stderr, "Found username in aufsdb (%s): %s\n", --- 429,436 ---- struct stat statbuf; ok = 0; /* false */ make_userlogin( filename, aufsdb, addr ); ! if( (f = open( filename, 0)) >= 0) { ! if( (cc = read( f, fname, sizeof( fname )-1 )) > 0 ) { if( fname[cc-1] == '\n' ) fname[cc-1] = '\0'; fprintf( stderr, "Found username in aufsdb (%s): %s\n", *************** *** 463,470 **** #endif LWSRV_LPR_LOG ok = 1; /* true */ } /* pwnam ok */ close(f); /* close the file */ ! } /* open and read OK */ if( !ok ) { /* dump connection with error message */ char message[ 512 ]; fprintf( stderr, "No username (or invalid) confirmation.\n"); --- 463,471 ---- #endif LWSRV_LPR_LOG ok = 1; /* true */ } /* pwnam ok */ + } /* read OK */ close(f); /* close the file */ ! } /* open OK */ if( !ok ) { /* dump connection with error message */ char message[ 512 ]; fprintf( stderr, "No username (or invalid) confirmation.\n"); *** README.orig Sun Jul 28 22:01:44 1991 --- README Sun Jul 28 22:02:33 1991 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 40, July 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 41, July 1991 Introduction ------------