Patch #: 76 Type: bug fix Priority: medium Affects: sites using lwsrv with incorrect argument list Reported: William Roberts Reported: William Bogstad Archived: munnari.OZ.AU mac/cap.patches/cap60.patch076 Application: 'cd cap60; patch -p < cap60.patches/cap60.patch076' Summary: change optlist string, add sanity checking code File: cap60/applications/lwsrv/lwsrv.c *** applications/lwsrv/lwsrv.c.orig Mon Nov 18 01:02:33 1991 --- applications/lwsrv/lwsrv.c Sun Feb 16 02:00:11 1992 *************** *** 1,6 **** ! static char rcsid[] = "$Author: djh $ $Date: 1991/11/17 14:02:13 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.14 1991/11/17 14:02:13 djh Rel djh $"; ! static char revision[] = "$Revision: 2.14 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter --- 1,6 ---- ! static char rcsid[] = "$Author: djh $ $Date: 1992/02/15 14:59:55 $"; ! static char rcsident[] = "$Header: /mac/src/cap60/applications/lwsrv/RCS/lwsrv.c,v 2.15 1992/02/15 14:59:55 djh Rel djh $"; ! static char revision[] = "$Revision: 2.15 $"; /* * lwsrv - UNIX AppleTalk spooling program: act as a laserwriter *************** *** 176,182 **** int c; extern char *optarg; extern int optind; ! static char optlist[64] = "a:f:l:p:P:t:d:n:rehNT:A:S:v:"; #ifdef LWSRV_AUFS_SECURITY strcat(optlist, "X:"); --- 176,182 ---- int c; extern char *optarg; extern int optind; ! static char optlist[64] = "a:f:l:p:P:t:d:n:rehNT:A:Sv"; #ifdef LWSRV_AUFS_SECURITY strcat(optlist, "X:"); *************** *** 263,268 **** --- 263,273 ---- usage(argv[0],NULL); /* usage and exit */ break; } + } + if (optind < argc) { + fprintf(stderr, "%s: surplus arguments starting from \"%s\"\n", + argv[0],argv[optind]); + usage(argv[0], NULL); } if (unixpname == NULL) *** README.orig Sun Feb 16 02:01:56 1992 --- README Sun Feb 16 02:02:46 1992 *************** *** 3,9 **** (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 75, November 1991 Introduction ------------ --- 3,9 ---- (For use with AppleTalk/Ethernet bridge) o RELEASE NOTES ! o CAP Distribution 6.0, Patch Level 76, February 1992 Introduction ------------