================= PATCH: patch-aa ===================== *** common.h Sat Feb 27 08:48:17 1993 --- common.h Thu Oct 6 14:35:00 1994 *************** *** 60,65 **** --- 60,69 ---- **===================================================================== */ + #ifdef HAVE_PARAM_H + #include + #endif + /* **--------------------------------------------------------------------- ** Define the following symbol to enable the use of a *************** *** 268,281 **** #define SUNOS_403C #endif ! #ifdef OSVER_BSD386 #define BSD_STYLE_PRINT #define BSD_STYLE_PR_LIST #define BSD_STYLE_QUEUE #define BSD_STYLE_CANCEL #define BSD_STYLE_STATUS #define BSD_STYLE_MONITOR ! #define BSD386 #endif #ifdef OSVER_ULTRIX --- 272,285 ---- #define SUNOS_403C #endif ! #if (defined(BSD) && (BSD >= 199103)) #define BSD_STYLE_PRINT #define BSD_STYLE_PR_LIST #define BSD_STYLE_QUEUE #define BSD_STYLE_CANCEL #define BSD_STYLE_STATUS #define BSD_STYLE_MONITOR ! #define GETUSERSHELL #endif #ifdef OSVER_ULTRIX *** pcnfsd_misc.c Sat Feb 27 08:48:14 1993 --- pcnfsd_misc.c Thu Oct 6 14:32:17 1994 *************** *** 480,486 **** #else SVR4 #include ! #define WTMP_PATH "/usr/adm/wtmp" void wlogin(name) --- 480,488 ---- #else SVR4 #include ! #ifndef _PATH_WTMP ! #define _PATH_WTMP "/usr/adm/wtmp" ! #endif void wlogin(name) *************** *** 499,505 **** (void) strncpy(ut.ut_name,name,sizeof ut.ut_name); ut.ut_time = time( (time_t *) 0); (void) strncpy(ut.ut_host, getcallername(), sizeof ut.ut_host); ! if ((fd = open(WTMP_PATH, O_WRONLY|O_APPEND, 0)) >= 0) { (void)write(fd, (char *)&ut, sizeof(ut)); (void)close(fd); } --- 501,507 ---- (void) strncpy(ut.ut_name,name,sizeof ut.ut_name); ut.ut_time = time( (time_t *) 0); (void) strncpy(ut.ut_host, getcallername(), sizeof ut.ut_host); ! if ((fd = open(_PATH_WTMP, O_WRONLY|O_APPEND, 0)) >= 0) { (void)write(fd, (char *)&ut, sizeof(ut)); (void)close(fd); } *** pcnfsd_print.c Fri Jan 29 23:52:04 1993 --- pcnfsd_print.c Thu Apr 27 12:43:01 1995 *************** *** 395,407 **** */ if(!xcmd) { #ifdef BSD_STYLE_PRINT ! #ifdef BSD386 sprintf(cmdbuf, "/usr/bin/lpr -P%s -C%s -J%s %s", pr, system, user, new_pathname); #else sprintf(cmdbuf, "/usr/ucb/lpr -P%s -C%s -J%s %s", pr, system, user, new_pathname); ! #endif BSD386 #endif BSD_STYLE_PRINT #ifdef SVR4_STYLE_PRINT sprintf(cmdbuf, "/usr/bin/lp -c -d%s %s", --- 395,407 ---- */ if(!xcmd) { #ifdef BSD_STYLE_PRINT ! #if (defined(BSD) && (BSD >= 199103)) sprintf(cmdbuf, "/usr/bin/lpr -P%s -C%s -J%s %s", pr, system, user, new_pathname); #else sprintf(cmdbuf, "/usr/ucb/lpr -P%s -C%s -J%s %s", pr, system, user, new_pathname); ! #endif #endif BSD_STYLE_PRINT #ifdef SVR4_STYLE_PRINT sprintf(cmdbuf, "/usr/bin/lp -c -d%s %s", *************** *** 686,696 **** char *cp; int saw_system; ! #ifdef BSD386 p = popen("/usr/sbin/lpc status", "r"); #else p = popen("/usr/etc/lpc status", "r"); ! #endif BSD386 if(p == NULL) { printers = list_virtual_printers(); return(1); --- 686,696 ---- char *cp; int saw_system; ! #if (defined(BSD) && (BSD >= 199103)) p = popen("/usr/sbin/lpc status", "r"); #else p = popen("/usr/etc/lpc status", "r"); ! #endif if(p == NULL) { printers = list_virtual_printers(); return(1); *************** *** 975,981 **** --- 975,985 ---- if(pn == NULL || suspicious(pn) || !valid_pr(pn)) return(PI_RES_NO_SUCH_PRINTER); + #if (defined(BSD) && (BSD >= 199103)) + sprintf(buff, "/usr/bin/lpq -P%s", pn); + #else sprintf(buff, "/usr/ucb/lpq -P%s", pn); + #endif p = su_popen(user, buff, MAXTIME_FOR_QUEUE); if(p == NULL) { *************** *** 1234,1244 **** sprintf(pname, "%s:", pn); n = strlen(pname); ! #ifdef BSD386 sprintf(cmd, "/usr/sbin/lpc status %s", pn); #else sprintf(cmd, "/usr/etc/lpc status %s", pn); ! #endif BSD386 p = popen(cmd, "r"); if(p == NULL) { msg_out("rpc.pcnfsd: unable to popen() lpc status"); --- 1238,1248 ---- sprintf(pname, "%s:", pn); n = strlen(pname); ! #if (defined(BSD) && (BSD >= 199103)) sprintf(cmd, "/usr/sbin/lpc status %s", pn); #else sprintf(cmd, "/usr/etc/lpc status %s", pn); ! #endif p = popen(cmd, "r"); if(p == NULL) { msg_out("rpc.pcnfsd: unable to popen() lpc status"); *************** *** 1404,1414 **** if(suspicious(id)) return(PC_RES_NO_SUCH_JOB); ! #ifdef BSD386 sprintf(cmdbuf, "/usr/bin/lprm -P%s %s", pr, id); #else sprintf(cmdbuf, "/usr/ucb/lprm -P%s %s", pr, id); ! #endif BSD386 if ((fd = su_popen(user, cmdbuf, MAXTIME_FOR_CANCEL)) == NULL) { msg_out("rpc.pcnfsd: su_popen failed"); return(PC_RES_FAIL); --- 1408,1418 ---- if(suspicious(id)) return(PC_RES_NO_SUCH_JOB); ! #if (defined(BSD) && (BSD >= 199103)) sprintf(cmdbuf, "/usr/bin/lprm -P%s %s", pr, id); #else sprintf(cmdbuf, "/usr/ucb/lprm -P%s %s", pr, id); ! #endif if ((fd = su_popen(user, cmdbuf, MAXTIME_FOR_CANCEL)) == NULL) { msg_out("rpc.pcnfsd: su_popen failed"); return(PC_RES_FAIL); *************** *** 1487,1497 **** char default_cmd[] = "lp $FILE"; #endif SVR4_STYLE_PRINT #ifdef BSD_STYLE_PRINT ! #ifdef BSD386 char default_cmd[] = "/usr/bin/lpr $FILE"; #else char default_cmd[] = "/usr/ucb/lpr $FILE"; ! #endif BSD386 #endif BSD_STYLE_PRINT void --- 1491,1501 ---- char default_cmd[] = "lp $FILE"; #endif SVR4_STYLE_PRINT #ifdef BSD_STYLE_PRINT ! #if (defined(BSD) && (BSD >= 199103)) char default_cmd[] = "/usr/bin/lpr $FILE"; #else char default_cmd[] = "/usr/ucb/lpr $FILE"; ! #endif #endif BSD_STYLE_PRINT void ================= PATCH: patch-ab ===================== *** /dev/null Thu Oct 6 16:22:04 1994 --- Makefile.44bsd Thu Oct 6 17:18:19 1994 *************** *** 0 **** --- 1,21 ---- + # + # @(#)Makefile + # Makefile for rpc.pcnfsd for BSD/386 or similar + # $Id: patch-ab,v 1.2 1995/03/19 10:12:39 joerg Exp $ + # + + PROG= rpc.pcnfsd + SRCS= pcnfsd_svc.c pcnfsd_xdr.c pcnfsd_v1.c pcnfsd_v2.c pcnfsd_misc.c \ + pcnfsd_cache.c pcnfsd_print.c + MAN8= pcnfsd.8 + + CFLAGS+=-DHAVE_PARAM_H + + DPADD+= ${LIBCRYPT} + LDADD+= -lcrypt + + beforeinstall: + -mkdir -p ${BINDIR} + -mkdir -p ${PRDIR} + + .include ================= PATCH: patch-ac ===================== *** pcnfsd.8c Sat Feb 27 08:48:29 1993 --- pcnfsd.8c Thu Oct 6 16:04:23 1994 *************** *** 1,5 **** ! .\" @(#) @(#)pcnfsd.8c 1.3 11/3/92; ! .TH PCNFSD 8C "25 April 1991" .SH NAME pcnfsd \- (PC)NFS authentication and print request server .SH SYNOPSIS --- 1,5 ---- ! .\" @(#) @(#)pcnfsd.8 1.3 11/3/92; ! .TH PCNFSD 8 "25 April 1991" .SH NAME pcnfsd \- (PC)NFS authentication and print request server .SH SYNOPSIS *************** *** 48,58 **** .B PCNFSD2_AUTH request\**, it will "log in" the user by validating the username and password and returning the corresponding uid, gids, home directory, ! and umask. If ! .B pcnfsd ! was built with the ! .B WTMP ! compile-time option, it will also append a record to the .BR wtmp (5) data base. If you do not wish to record PC "logins" in this way, you should add a line of the form --- 48,54 ---- .B PCNFSD2_AUTH request\**, it will "log in" the user by validating the username and password and returning the corresponding uid, gids, home directory, ! and umask, it will also append a record to the .BR wtmp (5) data base. If you do not wish to record PC "logins" in this way, you should add a line of the form *************** *** 105,111 **** .B pcnfsd creates a subdirectory for each of its clients: the parent directory is normally ! .B /usr/spool/pcnfs and the subdirectory is the hostname of the client system. If you wish to use a different parent directory, you should add a line of the form --- 101,107 ---- .B pcnfsd creates a subdirectory for each of its clients: the parent directory is normally ! .B /var/spool/pcnfs and the subdirectory is the hostname of the client system. If you wish to use a different parent directory, you should add a line of the form *************** *** 134,140 **** must be run as root. .LP Every print request from the client includes the name of the printer ! which is to be used. In SunOS, this name corresponds to a printer definition in the .BR /etc/printcap (5) database. If you wish to define a non-standard way of processing --- 130,136 ---- must be run as root. .LP Every print request from the client includes the name of the printer ! which is to be used. This name corresponds to a printer definition in the .BR /etc/printcap (5) database. If you wish to define a non-standard way of processing *************** *** 230,238 **** its list of valid printers. To do this, it checks the modification time of .B /etc/printcap ! for BSD-style systems or ! .B /etc/lp/printers ! for SVR4-based systems. However, it does not monitor the file .B /etc/pcnfsd.conf for updates; if you change this file, it is still necessary to kill and restart --- 226,232 ---- its list of valid printers. To do this, it checks the modification time of .B /etc/printcap ! However, it does not monitor the file .B /etc/pcnfsd.conf for updates; if you change this file, it is still necessary to kill and restart *************** *** 244,249 **** .B /etc/pcnfsd.conf .PD .SH "SEE ALSO" ! .BR lp (1) ! .BR lpstat (1) .BR lpq (1) --- 238,242 ---- .B /etc/pcnfsd.conf .PD .SH "SEE ALSO" ! .BR lpr (1) .BR lpq (1) ================= PATCH: patch-ad ===================== The following two patches are security patches as discussed in CERT advisory CA:96-08.pcnfsd dated April 18th. *** /tmp/T0a005Z3 Fri Apr 19 14:50:43 1996 --- pcnfsd_misc.c Fri Apr 19 14:37:00 1996 *************** *** 114,120 **** int suspicious (s) char *s; { ! if(strpbrk(s, ";|&<>`'#!?*()[]^/") != NULL) return 1; return 0; } --- 114,120 ---- int suspicious (s) char *s; { ! if(strpbrk(s, ";|&<>`'#!?*()[]^/${}\n\r\"\\:") != NULL) return 1; return 0; } *** /tmp/T0a002c1 Fri Apr 5 13:14:50 1996 --- pcnfsd_print.c Fri Apr 5 13:14:46 1996 *************** *** 221,226 **** --- 221,227 ---- { int dir_mode = 0777; int rc; + mode_t oldmask; *sp = &pathname[0]; pathname[0] = '\0'; *************** *** 231,241 **** /* get pathname of current directory and return to client */ (void)sprintf(pathname,"%s/%s",sp_name, sys); (void)mkdir(sp_name, dir_mode); /* ignore the return code */ - (void)chmod(sp_name, dir_mode); rc = mkdir(pathname, dir_mode); /* DON'T ignore this return code */ if((rc < 0 && errno != EEXIST) || - (chmod(pathname, dir_mode) != 0) || (stat(pathname, &statbuf) != 0) || !(statbuf.st_mode & S_IFDIR)) { (void)sprintf(tempstr, --- 232,242 ---- /* get pathname of current directory and return to client */ (void)sprintf(pathname,"%s/%s",sp_name, sys); + oldmask = umask(0); (void)mkdir(sp_name, dir_mode); /* ignore the return code */ rc = mkdir(pathname, dir_mode); /* DON'T ignore this return code */ + umask(oldmask); if((rc < 0 && errno != EEXIST) || (stat(pathname, &statbuf) != 0) || !(statbuf.st_mode & S_IFDIR)) { (void)sprintf(tempstr, *************** *** 381,387 **** ** filter with the appropriate arguments. **------------------------------------------------------ */ ! (void)run_ps630(new_pathname, opts); } /* ** Try to match to an aliased printer --- 382,391 ---- ** filter with the appropriate arguments. **------------------------------------------------------ */ ! (void)sprintf(tempstr, ! "rpc.pcnfsd: ps630 filter disabled for %s\n", pathname); ! msg_out(tempstr); ! return(PS_RES_FAIL); } /* ** Try to match to an aliased printer ================= PATCH: patch-ae ===================== This patch allows "make bsd" to build the Linux binary. --- Makefile.bsd.orig Wed Aug 19 15:27:12 1998 +++ Makefile.bsd Wed Aug 19 15:27:46 1998 @@ -40,9 +40,9 @@ LINTFLAGS= -hbax # uncomment as appropriate for debugging -CFLAGS = -DOSVER_BSD386 +CFLAGS = -DOSVER_BSD386 -DSHADOW_SUPPORT -Dcrypt=pw_encrypt #CFLAGS = -g -DDEBUG -DOSVER_BSD386 -LIBS= -lrpc +LIBS= -lshadow LFLAGS = bsd/rpc.pcnfsd: $(SVR_OBJS) $(HDRS) ================= PATCH: patch-af ===================== This patch makes changes to the "bsd" build target to configure the daemon for Linux instead. --- common.h.orig Wed Aug 19 15:35:14 1998 +++ common.h Wed Aug 19 15:41:50 1998 @@ -272,14 +272,17 @@ #define SUNOS_403C #endif -#if (defined(BSD) && (BSD >= 199103)) +/* #if (defined(BSD) && (BSD >= 199103)) */ +#ifdef OSVER_BSD386 +#define BSD 199103 #define BSD_STYLE_PRINT #define BSD_STYLE_PR_LIST #define BSD_STYLE_QUEUE #define BSD_STYLE_CANCEL #define BSD_STYLE_STATUS #define BSD_STYLE_MONITOR -#define GETUSERSHELL +#define BSD386 +/* #define GETUSERSHELL */ #endif #ifdef OSVER_ULTRIX