Patrick Powell
Sat Feb  8 14:16:02 PST 1997

This version of PCNFSD is based on the pcnfsd release of
Feb 16, 1993 by Geoff Arnold.  This is also the baseline
for the Linux, BSDI, and other UNIX system releases.

Note the following changes.

1. strcpy/strcat/sprintf did not do bounds checks, and in many cases used raw user parameters as
   inputs.  While in most cases the RPC parameters probably limited lengths, they were not
   'visible' or guaranteed to be in the bounds of the destination strings.  This was fixed
    by using strncpy, strncat, and snprintf together with explicit bounds.
   In several places combinations of strcpy/strcat were replaced by snprintf().

2. In several places a char * was passed and used as an input buffer, and no
   bounds checking done.  Added length parameter restrictions.

3. Removed all sorts of unused/misused variables,  etc.  Added standard include files to
   common.h that appears to have cleaned up some errors.

4.  Plugged a possible security loophole in syslog().

5.  Plugged a possible security loophole with gethostbyname();

6.  Added a -d flag for pcfnsd to turn on debugging information (VERY useful).
7.  pcnfsd_test.c has been edited to bring the comments and actions into agreement.

EXECUATBLE CONFIGURATION

   Extended the way to configure the LPR/LPRM/LPC/LPQ commands.
   See the pcnfsd_print.c file for details.  Basically, you can now define:
    CFLAGS= -DLPR_COMMMAND=/usr/local/bin/lpr \
   -DLPRM_COMMMAND=/usr/local/bin/lprm \
   -DLPC_COMMMAND=/usr/local/bin/lpc \
   -DLPQ_COMMMAND=/usr/local/bin/lpq

LPRNG SPECIFIC
    The flag CFLAGS=-DLPRNG will force lpr to use the -V option and return a job id,
    as does lp, and define the standard locations for LPRng distributions.

RECOMMENDED INSTALLATION METHOD

    read the pcnfsd.8 man page - you may want to set up a pcnfsd.conf file.

    make clean all;
    make clnt.pcnfsd

	(Do the next as root)
    pcnfsd -d  2>&1  >/tmp/dlog

    (Do the next as user)
    clnt.pcnfsd server host printer user password 2>&1 >/tmp/clog
     (substitute suitable names above)

    Examine the logs and make sure that things are correct.

	Set up the NFS exports - remember to set up the SPOOLDIR (/var/spool/pcnfs)
      and make sure you export it.  You may need to export it using the -n
      (allow non-root mounting) option.

    From a remote host try using the various capabilities - you can leave logging on
    and try printing.  This is now very easy to debug if things go wrong.

Prof. Patrick Powell
Dept. Electrical and Computer Engineering,
San Diego State University,
San Diego, CA 92182-1309
Office (619) 594-7796; Lab (619) 594-7578 FAX (619) 594-7577
email: papowell@sdsu.edu
