Tue Nov  4 13:53:09 1997  Ian T Zimmerman  <itz@kronstadt.rahul.net>

        * lpd/printjob.c (printjob): replaced getpwname by getpwnam.

        * lpr/lpr.c (main): replaced getpwname by getpwnam.

        * Makefile: changed all the subdirectory makefiles to use
        DAEMON_USER and DAEMON_GROUP for privileged installation.  This
        finishes the task of nixing the du capability, which has never
        really worked.

        * lpr/lpr.c (main): added code to retrive passwd entry for the
        daemon user.
        (chkprinter): removed code for the du capability.

        * lpd/printjob.c (printjob): setting DU to the user configured in
        Makefile rather than interrogating printcap for it.
        (init): removed code for the du capability.

        * Makefile (DEFS): added definition of DAEMON_USER which will
        replace the du capability

        * A lot of trivial changes to keep file access modes and ownership
        in the spool area consistent.

Mon Nov  3 13:11:31 1997  Ian T Zimmerman  <itz@kronstadt.rahul.net>

        * bsdcap.c (cgetnum): the scan pointer needs to be advanced once
        more before being passed to strtoul (it only points to the '#').

        * lpd/printjob.c (printjob): lpd should change its euid to the
        daemon id immediately after forking printjob(), not only in
        children of that process.  Otherwise lpq will always report "no
        daemon".  This took ages to hunt down, is it possible that BSD is
        more permissive about kill(pid, 0) (ie. allows that for processes
        owned by other users)?

        * lprm/Makefile (install): install lprm setuid to the lp daemon user.

        * lpq/Makefile (install): install lpq setuid to the lp daemon
        user.  This is needed because lpq does a kill(pid, 0) on the lpd
        spawn for the particular printer, which fails if the effective
        uids of the two processes differ.  That's where the stupid
        "Warning: no daemon" message came from.  FIXME: This is now
        hardwired to be the user "lp"; it really should be configurable in
        the toplevel Makefile, but the problem is that parts of the
        package are written to allow this to be a different user for each
        printer.

        * lpr/Makefile (install): install lpr program as setuid root.  I
        REALLY DON'T like doing this but it is needed to change ownership
        of control files.  This escaped my attention because the return
        value from fchown() is not checked.

        * bsdcap.c (bsdcap_namatch): Fixed typo causing only first name in
        colon-separated list to match, patch by Dmitri Bouros.
        
        * lpd/lpd.c (chkrluser): Need to skip comment lines in hosts.*
        files to stop useless failing DNS lookups.  Patch by Dmitri Bouros.

Sat Nov  1 09:34:16 1997  Ian T Zimmerman  <itz@kronstadt.rahul.net>

        * bsdcap.c (cgetent): if bsdcap_set_entry is nonnull return it,
        but first check that it matches the requested entry name
        (cgetnext): removed check for bsdcap_set_entry in this function,
        as it doesn't really make sense to substitute a particular entry
        when a scan of the whole database is called for

        * lpc/cmds.c: added cgetclose() after every cgetnext() loop,
        otherwise one can only do a "status all" once for example.

        * lpd/lpd.c (startup): added cgetclose() for cleanness.

        * lpq/lpq.c (main): added cgetclose() for cleanness.

Fri Oct 31 05:23:39 1997  Ian T Zimmerman  <itz@kronstadt.rahul.net>

        * Makefile (CFLAGS): Get rid of -I /usr/include/bsd.  The
        `solutions' in these headers are extremely primitive and could
        hide real semantic compatibility problems.  Generally it seems
        better to just include the GNU headers and rely on -D_BSD_SOURCE
        to tell glibc what is expected.

        * lpd/lpd.c: Include time.h to get declarations related to
        select().  I really hate BSD.

        * lpd/printjob.c: Include time.h to stop warning about the result
        type of ctime().

        * bsdcap.c (cgetnext): cannot successfully break reading loop if I
        have just read a comment line.
        (bsdcap_nchktc): Fixed length parameter to write() that could
        cause segfaults.  Whoever heard of printing error messages with
        write()?       
        (cgetnext): must break of outer while loop on read failure or eof
        condition.
        (cgetent): must break of outer while loop on read failure or eof
        condition.
        (bsdcap_nchktc): fixed code that could try to retrieve characters
        from negative positions in the argument buffer.
        (bsdcap_nchktc): More safety fixes, relying on string functions
        instead of pointer scans by hand.
        (bsdcap_namatch): complete rewrite relying on string functions
        instead of pointer scans by hand.
        (bsdcap_skip): relying on string functions
        instead of pointer scans by hand.
        (cgetnum): replaced hand-scanning strings by the strto* functions.
        (bsdcap_namatch): Replaced strcspn() by strpbrk
        (cgetnum): Need to store the result in *res.  Yuck!  Really this
        smells of Redmond.
        (cgetstr): Need to return -1 on error, not 0.

        * Makefile: changed order of CFLAGS to make manual command line
        override easier.

        * lpd/lpd.c (main): replaced daemon call by equivalent open code
        to eliminate libbsd reference.

        * lpd/printjob.c (setty): replaced cfsetspeed call by a
        cfsetispeed / cfsetospeed pair.

        * Makefile (install): added installation of the bsdcap library
        (clean): added cleaning up of the bsdcap library
        removed -lbsd from LDLIBS (libbsd is integrated into libc)

Thu Oct 30 16:09:03 1997  Ian T Zimmerman  <itz@kronstadt.rahul.net>

        * pac/pac.c (chkprinter): passing printcapdb to
        cgetent.

        * lpr/lpr.c (chkprinter): passing printcapdb to
        cgetent.

        * lpq/lpq.c (main): passing printcapdb to
        cgetent.

        * lpd/recvjob.c (recvjob): passing printcapdb to
        cgetent.

        * lpd/printjob.c (init):  passing printcapdb to
        cgetent. 

        * lpd/lpd.c (startup):  passing printcapdb to
        cgetent. 

        * lpc/cmds.c (up): passing printcapdb to
        cgetent.

        * bsdcap.c (cgetnext): had to change the meaning of return value
        because the BSD interface approaches Windoze in its braindead
        contradictions. 

        * common_source/rmjob.c (rmjob):  passing printcapdb to
        cgetent. 

        * common_source/displayq.c (displayq): passing printcapdb to
        cgetent. 

        * common_source/common.c: reinstated definition of printcapdb[] to
        use the new cget* emulation.

        * Makefile: added bsdcap.c, my own reimplementation of the BSD
        cget* functions

        * common_source/Makefile (install): replaced split ar/ranlib with
        ar -rcsu.
        (OBJS): replaced the old and ugly printcap.c hack with my own
        reimplementation of the BSD cget* functions, in ./bsdcap.c.

        * lpd/lpd.c (chkhost): At last, replaced the __ivaliduser call by
        equivalent code.

        * lpd/printjob.c (sendfile): changed formatting escape from
        %qd to %ld, acting on suggestion of Thomas Roessler
        <roessler@guug.de>.

        * common_source/displayq.c (ldump): changed formatting escape from
        %qd to %ld, acting on suggestion of Thomas Roessler
        <roessler@guug.de>. 

