Version LPRng-3.8.32 - Thu Sep 6 15:07:19 PDT 2007 added: discard_zero_length_jobs flag zero length jobs are now discarded rather than trying to be printed. However, sometimes zero length jobs are actually MEANT to be printed as the various filters will expand the zero length job into content. This is the way to put the name of a file you want printed from an archive into an option line/flag and then have the back end print it. Ugly, but it works. Version LPRng-3.8.31 - Fri Feb 16 17:33:35 PST 2007 postinstall.freebsd: /etc/rc.conf is not truncated Version LPRng-3.8.30 - Thu Sep 21 11:53:39 PDT 2006 Fixed: If job was forwarded to queue, or redirected to queue, then queue would not start printing. Fixed: If job with multiple copies (lpr -Kxxx) was forwarded to queue or redirected to queue, then forwarded then only a single file copy was printed. Fixed: If the 'router' or 'chooser' was used, then only 1 copy of file was sent to destination queue, and job may unexpected die. Version LPRng-3.8.29 - Fri Jan 28 11:05:58 PST 2005 ATHENTICATION: added k5conn (kerberos 5) method. This is identical to the kerberos method, but does not do encrypted data transfer. BUG FIXES: The authentication information is now saved in the control file. The status of incoming jobs is now displayed with the LPQ command. Unfortunately, the incoming job size is displayed as 0 until the entire job file arrives. The file locking strategy has been modified once more, due to dealing with problems of HUGE incoming jobs that would cause all the LPD/LPRM/... facilities to lock. This required the 'Get_hold_file_info' and 'Set_hold_file_info' usage to change. - job reception: the hold file is created and then modified when all of the job files have been received. - job deletion - you can remove an incoming job. The incoming process is killed as well. If you have 'multiple retries' enabled for job transfer, then the job will be sent again. Such is life. - job printing - the job file remains locked until the 'lpd' server decides what to do with it. This is usually a VERY short period, but if a process needs to be run to determine the destination of the job, it may remain locked until the process has completed. Apple OS-X - LPR+kerberos as backend for CUPS server Added support for the using LPR+kerberos authentication with CUPS backend on Apple OS X. See the README.kprPDE file for the gory details. Basically, OS-X has a 'Printer Driver' set up that specifies the capabilties of a printer as well as the 'driver' or 'transport program' which will handle the transfer of the print job to the remote printer. If compiled with the correct flags, when lpr is invoked as 'klpr', it will assume that it is being used by OS-X as a 'transport program' and take the necessary steps to obtain the user Kerberos credentials and then forward the print job to the LPD server. Note that much of this code is totally dependent on the OS-X system, and I (Patrick Powell) do not have access to details of how it is supported or implemented. The code was supplied by Rich Cochran of Cornell, and has been added to the LPRng system at his and others request. If the PDE support changes on OS-X, then it will be necessary to redo this support. Note that the PDE files are BINARY, and contain compiled and executable code. Kerberos, Red Hat Enterprise Linux The 'com_err.h' file has been removed from some versions of RHEL. Configure now checks to see if it is found. This may break if com_err.h is not in one of the 'standard' locations, or is in a subdirectory such as /usr/kerberos/include, or some other permutation. Updated preinstall, postinstall, preremove, postremove, to be more compatible with package systems such as the FreeBSD 'ports' and rpms. Major Installation Change: If you want to have the LPRng install run a script that stops your current LPD installation, or your current CUPS installation, you will need to use: make STARTSERVER=YES install New Directory: The /usr/local/share/LPRng/ or ($datadir)/LPRng directory will now be used for holding sample versions of configuration files. During the install process these will then be moved to the appropriate destinations by the 'postinstall' scripts. By doing this, you can now generate FreeBSD ports/packages that will have a 'constant' set of locations for files, but then can move them or copy them to system specific destinations. This solves a nasty set of problems with FreeBSD ports/packages, which have a 'fixed' pkg-plist file, but also allows you to specify the destinations of printcap, lpd.conf, and do forth. Files: printcap.sample lpd.conf.sample lpd.perms.sample lprng.sh.sample (startup script), postinstall New Installation Assistance File: /usr/local/share/LPRng/postinstall This can be used to set the sample versions of configuration files to their destinations. In addition, you can also run a set of commands that will attempt to replace your current LPD system with the LPRng system: Bourne/bash shells: STARTSERVER=YES postinstall Others: env STARTSERVER=YES postinstall If you are building a package for mass distribution, then after installing the package on a host you can run this script: pkg_add LPRng-.tar env STARTSERVER=yes /usr/local/share/LPRng/postinstall Version LPRng-3.8.28 - Fri Jul 23 09:01:55 PDT 2004 MAJOR CHANGES: The 'hold file' is now referred to as the 'job ticket' file. This is really what it is. Reference manual, Cookbook, etc., will be modified to reflect this change. incoming_control_filter: The input to this filter now has the format: X=option (from original control file) key=option (options for job) Output for changes should have the format: X= (for option deletion) key= (for option deletion) X=newvalue (for option modification) key=newvalue (for option modification) The following environment variables are also passed, and have slightly different formats than before. CONTROL - image of the control file. Note that the data file entries have the form. f/path/to/temporary/file DATAFILES - space separted list of data files. These are in the format /path/to/temporary/file. Added translations for German. (Translations by: Walter Harms ) Fixed yet another silly problem with moving jobs from a queue while the queue is busy. Now the main server will NOT start another process to move the job if it can do the work itself. Added a counter to make sure that if a job is moved more than a specified number of times, that we catch this and stop moving the job. This code now works (ahem). Version LPRng-3.8.27 - Wed Apr 21 11:32:41 PDT 2004 Fixed: 'Missing HOLD_FILE' logic error fixed in lpd_rcvjob.c (Noted by: Mark Tamisiea ) (And another suggestion by: Christian Reiber ) Fixed: configure with-initpath --with-initpath=PATH now works correctly (Reported by: Jeff Bastian ) Fixed (well, clarified): Errormsg() now checks for a 'null' error string and provides a printable version of errno for logging. Edited the Scan_queue() function to print error message and removed some dead code. (Inspired by comments from: Russell Adams ) lpc MOVE could result in endless loop. (Problem reported by: Wichert Akkerman to Debian bug list, forwarded by: Craig Small ) lpc MOVE will now start printing job in destination, rather than just copying and preserving status of last operation. Added detailed error message for connection failure. (Inspired by comments by: Russell Adams ) Found a really small (1 byte) memory leak in LPD. Solves the mystery of the server dying with malloc failed messages. (Information supplied by: Russell Adams ) Version LPRng-3.8.26 - Tue Feb 3 16:58:00 PST 2004 ADDITION to UTILS: VeryFlexibleChooser.pl script uses SNMP to get printer status and selects printer. (Contributed by: Henrik Edlund ) Fixed: --disable-werror configuration option not set correctly. (Noticed and patched by: Gabriele Balducci ) IPP listening enabled by default. Should not be enabled by default. (ipp_listen_port=0) Version LPRng-3.8.25 - Wed Jan 7 04:46:12 PST 2004 MAJOR CHANGE in internals: The legacy 'control file' has been removed from the spool queue as all of the information is duplicated in the hold file. The various LPRng documents will be updated to reflect this. Users who access the control file information external to LPRng should be warned that this is not a good idea due to file locking, etc. MAJOR CHANGE in 'move' operation: The 'lpc move' is now 'nonblocking'. If you request a job to be moved, the LPD server will start a process to (almost) immediately move the job. Until this job is moved, no other job processing for the queue will be done. If the move is to a local queue on the same host, then the job will be copied via a file copy. This action is identical to the action for sending a job to a 'load balance' queue, with the difference that the job is immediately marked as done rather than after the load balance queue has printed it. Note: if you enter a non-existent remote queue, then the LPD subserver process trying to move the job will/may sit in an endless loop trying to move the job. Added: discard_large_jobs option discard_large_jobs - if this option is set, large jobs are accepted and then discarded. Fixed: Priority and Class For incoming jobs, the first letter of the C (class) field in the control file is used to set the priority. This action is modified by the: # ignore requested user priority ignore_requested_user_priority=0 # do not set priority from class name break_classname_priority_link=0 If not present or the break_classname_priority_link, the default priority value is used to set the priority. (C=) and class (class=) values in the control file. This deals with several lpd print clients that appear to to assign random control file names and do not have a C field in the control file. Not to mention users who try to manipulate queue priorities. Modified: incoming_control_filter action This filter is applied to the incoming job control file. and is used to modify the actions of the LPD server. options. The output can be in the form: Xoption X (no option) Xoption ... key=value key=value The Xoption is equivalent to X=option. The key=value set of options is separated from the first by a blank line. If an option is not specified, it is not modified. The X (no option) or X= (no option) form will remove the option from the control file. It is dangerous to try to modify the A (identifier) option unless the user has intimate knowledge of the LPRng lpd server operation. Modified: filter environment variables Filters are now invoked with the HF environment variable set to the hold file contents. This assists with the incoming_control_filter and control_filter actions. Fixed: The 'Remove_done_jobs' code now removes done and error jobs. This makes the 'done_jobs' and 'done_jobs_max_age' actions symmetrical. Documented: added more details to the -D flags. debug flag format: num | flag[+num] | flag=str flag names: print[+N], lpr[+N], lpc[+N], lprm[+N], lpq[+N], network[+N], database[+N], log[+N], test=num use on command line, or in printcap :db=... entry for server: print: show queue (printing) actions, larger number, more information NUMBER same as print+NUMBER lpr: show servicing lpr actions lpq: show servicing lpq actions lprm: show servicing lprm actions network: show low level network actions database: show low level database actions log: Testing. Don't use this unless you read the code. test: Testing. don't use this unless you read the code. for clients (lpr, lpq, etc): print: show client actions, larger number, more information NUMBER same as print+NUMBER network: show low level network actions. database: show low level database actions. Modified: The lpq display now shows Pr/Class (Priority/Class) information if the priority is different than the class information. This better shows information on the class/priority relationshiop. The Class information is in the 'class=' field in the control file and the Priority information is in the priority field. The 'nonexistent printer message' has been modified to be a little more helpful, or at least more verbose: Status Information, attempt 1 of 3: sending job 'papowell@h110+563' to xx@localhost connecting to 'localhost', attempt 1 connected to 'localhost' requesting printer xx@localhost job 'papowell@h110+563' transfer to xx@localhost failed error 'NONZERO RFC1179 ERROR CODE FROM SERVER' with ack 'ACK_FAIL' sending str '^Bxx' to xx@localhost error msg: 'spool queue for 'xx' does not exist on server h110.private' error msg: 'check for correct printer name or you may need to run' error msg: ''checkpc -f' to create queue' Waiting 10 seconds before retry Version LPRng-3.8.24 - Fri Dec 12 15:03:02 PST 2003 Small bugfixes Cygwin patch applied. (From "Luke Bakken" Comment: I thought I'd check LPRng to make sure that the latest version still works OK with Cygwin. Everything seems OK except for the checkpc.c "root" user warning. Will this patch be OK for that file? GCC 3.xx giveth, GCC 2.95 taketh a hard line. Patch for - t = 0; char buffer[128]; in user_auth.c (From: "Marcus Overhagen" and Jeff Chua ) Version LPRng-3.8.23 - Wed Nov 12 13:32:02 PST 2003 I did not document that the default locations of the lpd.conf and lpd.perms file are now /etc/lpd/lpd.conf and /etc/lpd/lpd.perms This change puts all of the lpd files, except /etc/printcap, whose location is hardwired into too many places, in the /etc/lpd directory. You can change this: configure --help --with-config_subdir=CONFIG_SUBDIR configuration subdirectory (default 'lpd') --with-lpddir=DIR lpd executable directory (default \${sbindir}) --with-lpd_conf_path=PATH path of lpd.conf (default: \${sysconfdir}/${CONFIG_SUBDIR}/lpd.conf) --with-lpd_perms_path=PATH path of lpd.perms (default: \${sysconfdir}/${CONFIG_SUBDIR}/lpd/lpd.perms) --with-printcap_path=PATH path of printcap (default \${sysconfdir}/printcap) --with-lpd_printcap_path=PATH path of lpd_printcap (default \${sysconfdir}/${CONFIG_SUBDIR}/lpd_printcap) --with-initpath=PATH path of lpd startup file (default /usr/local/etc/rc.d/lprng.sh) Also, the postinstall will now copy the old files to the new locations and issue a warning message. Fixed up a very subtle problem with 'chooser' functionality. we now have to find out if we really need to call the chooser if we are working and have a single queue, then we do not need to call the chooser if :sv= p1,p2 but none are available then we do not need to call the chooser if :sv == "" - then we do need to call the chooser if :sv == p1,p2 and at least one is available - then we do need to call the chooser Added the 'chooser_scan_queue' flag. If the flag is 1, then we check all the jobs in the spool queue to see if any can be sent to any destination. If the flag is 0 (default), then only the first printable job in the queue is checked. This causes only the first job in the queue to be tested, which is probably the appropriate behaviour for the majority of situations. Determined that it was possible to do a denial of service attack on the LPRng system. Added a zillion timeouts for reads/writes to socket/pipe connections. - for 'non-printing' actions, used Send_query_rw_timeout - for 'printing' actions, used Send_job_rw_timeout - on initial connections, use Send_job_rw_timeout, then Connect_timeout, and finally fall back to 10 seconds. While this does not totally eliminate the attack, it does try to make the LPD server responsive after the timeout periods. This is better than nothing. Note that there is a problem when you use these timeouts AND you are connecting to a slow printer. This solves the mystery of the 'hanging lpr processes' on some systems where a connection is made to the lpd server and then nothing is sent so there is no way to timeout things. Added a further fallback for missing filters: job format X - filter is :Xf=/filter if present, else filter is :filter=/filter if present, else filter is :if=/filter if present. Added --with-config_subdir (=lpd) to allow the $sysconfig/$subdir to be the directory for lpd.conf and lpd.perms files, also SSL files. The :ppd=file option now specifies the location of a PPD file. This is used by foomatic-rip (http://www.linuxprinting.org) to specify options and by ifhp. - checkpc -f checks to see if the file is present and readable - lpc ppd will return the PPD file contents We can now integrate lrpng into KDE in a straight forward manner, as the ppd file should be standard. Also, you can specify a default PPD file in /etc/lpd.conf. This will be added to the printcap entries shown by lpc printcap and passed to the filters. Added a 'pc_entries_required' option that will force the specified printcap entries to be put into the PRINTCAP_ENTRY information if they have a defined value and are not in the printcap entry. The current (only) value is ppd, but I suspect others might be nice. Fixed a bug in the way that the PGP security was implemented. - removed the PGP* environment variables from the default pass list for clients - did sanity checks for PGPPASS, PGPPASSFILE, and PGPPASSFD, and passed only the correct ones. Also opened the PGPPASSFILE and passed the file descriptor. - made sure that the file descriptor specified in PGPPASSFD was actually connected to the open file. - only passed PGPPASS if running as a client. - on clients, passing the PGPPATH environment value, on server using printcap :pgp_server_pgppath value (if specified). - updated the Reference (AKA LPRng-HOWTO) manual to reflect these changes. In summary, we now use: lp: :pgp_path - path of the PGP program :pgp_id - id for clients to use when sending to server - id used by server for decoding client requests :pgp_server_pgppath - PGPPATH environment variable for server :pgp_server_passphrasefile - file containing passphrase (must be absolute path name or is relative to the spool directory) :pgp_forward_id - for server to server communications id of the remote server :pgp_passphrasefile - default client passphrase file For clients, the following environment variables are used: PGPPATH - location of PGP configuration and key files PGPPASS - password PGPPASSFD - file descriptor to file with password PGPPASSFILE - file with password If PGPASSFD and PGPPASSFILE not defined, then - if PGPPATH defined, look for $PGPPATH/$passphrasefile - if $HOME defined, look in $HOME/.pgp/$passphrasefile Error in SSL Support discovered by Geoff Greene and patch supplied. (Patch and hard work by: Geoff Greene ) Amazing speed of some systems is so fast that jobs complete in less than the resolution of the system clock. This, needless to say, has some interesting problems with job order. Added some sequence numbers as well as time to various places. Screwed up the patch sent by Henrik Edlund . It should have been: > for(i = 0; i < listv.count; ++i ){ > s = listv.list[i]; > - if( (t = safestrpbrk(s,File_sep)) ) *t++ = 0; > + if( (t = safestrpbrk(s,Value_sep)) ) *t++ = 0; > Free_line_list(&l); > - Split(&l,t,Value_sep,0,0,0,0,0,0); > + Split(&l,t,File_sep,0,0,0,0,0,0); > DEBUGF(DLPQ1)("Job_status: Force_lpq_status '%s'='%s'", s,t); (Correction by: Henrik Edlund ) Misimplemented Hendriks accounting fixes. - if( Match_ipaddr_value(&l,&RemoteHost_IP) ){ + if( Match_ipaddr_value(&l,&RemoteHost_IP) == 0 ){ Oooops. (Correction by: Henrik Edlund ) utiltities.c: modified the 'Find_{str,flag,decimal}_value routines so that they did not take a separator option. This appears to be an oversite due to the importation from another set of code. Apparently I wanted to used non-printable characters as separators, but this turned out to be too hard to debug, so I used '=', '#', and '@' instead. Modified the init.freebsd.sh, postinstall.freebsd.sh, and preremove.freebsd.sh files to be a bit more 'ports' friendly. Updated the STANDARD_install to be more in line with FreeBSD/NetBSD. Documented the max_accounting_file_size and min_accounting_file_size option and changed the lpd.conf comment to indicate a 0 value disables truncation. (Lack of documentation pointed out by: Jim Trocki ) Fixed typos in INSTALL document. (Pointed out by: Daniel E Singer ) Version LPRng-3.8.22 - Fri Sep 5 08:45:33 PDT 2003 Updated the LPRng, IFHP, and LPRngTool LICENSE with the new Artistic License from the www.opensource.org web site. Updated the DISTRIBUTIONS/FreeBSD port information to meet the current (new) port format. Renamed LPRng HOWTO to LPRng Reference Manual. Added notes to the Printing Cookbook. lpf.c - removed log() and fatal(). (Suggested by: Torsten Rohlfing ) Filter command line options now allows ${X} to reference a control file option. You can now use: $X with -X (if present) $0X with -X (adds space) $'X with -X'' (adds quotes) $-X with (drops key) $0-X with (same as $-X) $'-X with '' (adds quotes) ${ss} with value of printcap option ss $'{ss} with quoted value of printcap option ss or job control file option Example: filter=ifhp -Z '${S},${O}' This will get the O and S options from the job control file. Note that $S is the 'printer comment name' and '$P' is the 'actual printer name'. (prompted by a question from: Paul Armstrong ) Fixed vars.c 'fifo' option - -{ "fifo", 0, STRING_K, &Fifo_DYN,0,0,0}, +{ "fifo", 0, FLAG_K, &Fifo_DYN,0,0,0}, (Thanks to the Debian folks - especially Craig Small ) Fixed up printer@remotehost%port parsing so you can do: localhost:lp=pr@%P and it gets expanded to: localhost:lp=pr@localhost This is pretty far down the extrema of wierd... But somebody came up with a use for it. Sigh... (Lots of head scratching caused by: Michael J. Carter ) Filters no longer have file descriptor 3 connected to the 'accounting file'. Since the '-a accounting_file' option provides the name of the file and this should be used instead. plp_snprintf now handles '*' in floating precision correctly. (Patch by: Henrik Edlund ) if( Run_OF_filter(), Status_file_DYN ) problem found. (Thanks to the Debian List: Sam Lown and Craig Small ) If you want to use force_lpq_status according to the docs (HOWTO), the following patch has to be applied. Otherwise it doesn't work when you have several ip netmasks listed as in the example: force_lpq_status=s=pc*.eng.com,130.192.12.0/24,l=sun*.eng.com Change is: - Split(&l,t,Value_sep,0,0,0,0,0,0); Value_sep DEFINE( = " \t=#@" ); + Split(&l,t,File_sep,0,0,0,0,0,0); File_sep DEFINE( = " \t,;:" ); (Pointed out to me by: Henrik Edlund ) Updated the configure and src/krb5_auth.c to be consistent with latest Kerberos releases. Added 'accounting_namefixup' option as suggested by Henrik Edlund accounting_namefixup=list[,list]* where list is: host(,host*)[=user(,user*)] The incoming job is check to see if the originating host (RemoteHost_IP) is in the list of hosts; the first matching one found is used. Each host list has the format: host,host... where host has the same format used for the 'oh' and other host name matching options. You can use '!host' to invert matching. For example: host1,127.*,!somehost When a host match is found, the name to be used for the user is determined from the user list; if none is specified then no changes are made. Each entry in the user list has the format ${option} or 'name'; the ${option} values are extracted from the control file (capital letters) or printcap/configuration information (lower case letters/names). The first non-empty value found is used. For example: ${R},${L},${accounting_name},default If the control file 'R' option is present, the R option value is used else if the control file 'L' option is present, the L option value is used, else if the printcap/config option 'accounting_name' is not empty then it is used, otherwise the 'default' value is used. (Original suggestion and patches by: Henrik Edlund ) Fought with the various Kerberos distributions and appear to have a new version that compiles with the Kerberos 1.3.1 release and with other legacy releases. Added the "# REJECT NOT SERVER" comment to the lpd.perms file to cause LPRng to reject all jobs/connections from external (non-localhost) clients Version LPRng-3.8.21 - Mon Mar 17 07:06:57 PST 2003 The LPQ 'stalled' indication is now based on status information updates, rather than the job run time. If there has been no status update for the specified stall time, i.e. - log file (lf=...) or status file (ps=...) then the stalled indication will be displayed. Karol Lewandowski discovered that psbanner, a printer filter that creates a PostScript format banner and is part of LPRng, insecurely creates a temporary file for debugging purpose when it is configured as filter. The program does not check whether this file already exists or is linked to another place writes its current environment and called arguments to the file unconditionally with the user id daemon. -- reported by security.debian.org -- Debian Security Advisory DSA 285-1 Fixed. Version LPRng-3.8.20 - Tue Jan 7 09:18:15 PST 2003 The lpd.conf now uses (EMPTY STRING) for defaults which are empty strings... Before it was '0'. Oops. Patrick At the request of Karl Kopper I reviewed the issues of queue starting, polling the queues for done jobs, and other issues. A small side effect of this is that the LPD server process now starts printing processes. This is actually beneficial as it can now limit the total number of printing processes and allow some LPQ/LPC/LPR etc actions. Here is a summary of the current operation and the options that control it: Options: lpd_force_poll - forces a check of the spool queues, even when there is most likely no reason to. Used when you have some REALLY odd programs running that will directly manipulate the LPD spool queues and you do not want to have to connect to the server. (default is OFF). lpd_poll_time - interval in secs between checking queues for work. Done if there is some reason to suspect that some spool queue had problems and might need to be restarted. This also handles a race condition where a job arrives just as the process servicing the spool queue exits. (default is 5 minutes or 600 seconds) lpd_poll_start_interval - if there are spool queues which need service, fork up to 'lpd_poll_servers_started' processes at a time and then wait for lpd_poll_start_interval seconds before forking more. This prevents the deadly situation where the LPD server is started and in turn starts a gizillion process; the rc starupt scripts may fail because there are no free processes (I kid you not on this one, it drove me nuts trying to find out why the system would crash ONLY when LPD ran with NO debugging - the IO caused it to slow down enough so that the other scripts could run). (default now 1 second) lpd_poll_servers_started - maximum number of processs to fork to be spool queue servers at a time. this prevents the massive forking a huge number of processes at once. (default now 3) max_servers_active - the maximum number of children of LPD that are handling spool queues. Since each spool queue process may have up to 5 children, and these in turn make fork other ones, you should make sure that the limits for the LPD server are set as high as possible, or use this value to throttle activity. The actual limit used by LDP value is the minimum of max_servers_active value and maximum children processes per process/2 as determined by the getrlimit(), sysconf(), or other appropriate system calls. Most problems reported by systems with heavy load are caused by restrictive process limits. Run 'lpd -F -D1 | grep Get_max_servers' (as an ordinary user) and see the limits for processes and file descriptors. Summary: lpd_force_poll=0 lpd_poll_time=600 (5 minutes) lpd_poll_start_interval=1 (1 second) lpd_poll_servers_started=3 (3 per start interval) max_servers_active=1024 Experiments with heavily loaded systems (FreeBSD 4.7, Solaris 2.8, Linux RedHat 7.3, and Mandrake 8) indicate that these values should not cause system trauma. Your milage may vary; if the load average goes up very high, then set lpd_poll_start_interval to a larger value and/or decrease the lpd_poll_servers_started value. Both is best. The amount of free memory seems to be the limiting factor on the system loading. When you send a job via LPR, the LPD server forks a 'service socket' process to handle job reception; in previous versions after receiving the job the process would then call Do_queue_jobs() to take on the duties of the 'handle the jobs in the spool queue' process. In this version the 'service socket' process sends a 'start queue' request to the LPD server and then exits. The LPD service will then fork a process to become the 'handle the jobs' process. Similarly, when an lpc operation needs to start a 'handle the jobs' process, a message is sent to the LPD server to start the process. While there is no real difference in performance on lightly loaded systems, there is a big difference on heavily loaded systems. Now the LPD server can control the total number of active spool queues much easier, and the system does not get overloaded as easily. Also, the LPRng server does not clobber the system at startup time as badly now. By the way, queues which are started or have jobs put in them by LPC or LPR have priority over queues that are started by the LPD process looking for work, and the LPD server will brutally try to start as many as possible. Thus, if you do an 'lpc start all' you can bring the system to its knees for a short time until all of the forking and file reading activity is completed. Since only the administrator can do an 'lpc start' command, this should not be an issue... Keith ("HP Printer Dies Horrible Death") Rinaldo has reported that some HP printers lock up and do not report status, etc., and display a nasty low level error message on the printer console such as 7900FE. The IFHP filter or LPD would sit there waiting for a response. The 'keepalive' TCP/IP facility does not solve this problem, as sometimes the TCP/IP stack is OK but the job handling code (i.e. - print engine) is non-functional. You need to try to get a response from the printer, which is what the IFHP filter does. NOTE: send_job_rw_timeout default value is now 0 (no timeout). In order to not surprise new users, the default value for send_job_rw_timeout is now 0, i.e.- no timeout. Details below. The send_job_rw_timeout is now used to set a maximum time that the printer (network, parallel port or serial port) connection will be 'inactive', i.e. - no data input and not available for data output, OR, starting with this release, that the various filter processes do not update the status file (by default, ${spooldir}/status.printer). When the timeout expires the job will terminate with a JTIMEOUT status, which will be treated as a JFAIL status. /* LPRng internal process exit status */ #define JTIMEOUT 43 /* 12 timeout */ The IFHP filter (ifhp-3.5.11) now has a similar 'send_job_rw_timeout' option that has the same effect as the LPD 'send_job_rw_timeout'. If the file descriptor used to communicate with the printer is inactive for this period of time, then the IFHP filter will exit with a JTIMEOUT error code, which will be treated as a JFAIL status. This will only work if the printer goes totally catatonic and does not reply with status, or the print filter goes catatonic and does not update the status file. This situation, unfortunately, can happen when the printer is taken offline in the middle of a job in order to put paper in the paper tray. You can't win them all... but if the time taken to put the paper in the tray is less than the send_job_rw_timeout then you should be OK. Version LPRng-3.8.19 - Thu Dec 5 12:34:45 PST 2002 Check_for_missing_files was not writing control file. (Spotted by Keith ("Wanna bet on that?") Rinaldo Version LPRng-3.8.18 - Mon Dec 2 12:08:34 PST 2002 Added the 'fifo' option - this now makes LPRng handle one incoming job at a time in FIFO order. If you send jobs A B C then they get delivered in order A B C. For users who MUST have sequential delivery of jobs. Some Linux distributions set 'unlimited' resources for all parameters, such as user processes. Added limit of 1024 processes for such cases as the system will die a horrible death at startup. Version LPRng-3.8.17 - Sat Oct 26 20:11:28 PDT 2002 Found a race condition between LPD printing, LPRM, and LPC actions that would cause LPD to stop printing if you removed or did an LPC action on a job. After a bit of thought, decided that the job would get moved or removed anyways. Sigh... But you might get a bogus error message about 'cannot find id' as the job hold file has been removed. Version LPRng-3.8.16 - Mon Aug 12 15:26:05 PDT 2002 lpr now honors :mx=xx values so you can check job size before you send it. (Suggested by: Rick Cochran ) configure --disable-werror removes the -Werror option from CFLAGS. (From the wish list of: Rick Cochran ) Bad incoming jobs are removed. You do not get the jobs left in the queue as errors. Note - spoolers will keep trying to send jobs even when they get error and sit in an endless loop. No solution for this one except to get a better print spooler or whatever... Version LPRng-3.8.15 - Sun Aug 11 13:11:48 PDT 2002 Remove_done_jobs - checks to see if the INCOMING flag is set BEFORE it checks to see if there is an error and only checks for the data files if the ERROR or DONE flags are set. This removes a race condition. It was bloody obvious when I looked at it... I wonder why I did not see it before? Version LPRng-3.8.14 - Tue Aug 6 09:14:06 PDT 2002 man page fixes. (Spotted by the eagle eyes of: Eric S. Raymond ) Based on third hand reports, some installations of GNU compilers on HPUX and other systems now have 'fd_set' data types. I have modified configure so that it checks for 'fd_set' being present. I wish there was a way to read the man pages and find out if this was the real case. The configure 'enable-ssl/disable-ssl/' option was not working. Once again beating on autoconf 1.53 ... It now understands 'enable-OPTION' and 'disable-OPTION'. The Samba examples in the LPRNG-Howto were not consistent. changed queuepause command = /usr/sbin/lpc -P%p stop queueresume command = /usr/sbin/lpc -P%p start to queuepause command = /usr/local/sbin/lpc stop %p queueresume command = /usr/local/sbin/lpc start %p (Suggested by: Jim Van Sickler ) Version LPRng-3.8.13 - Mon Jul 22 09:07:57 PDT 2002 Major Enhancement In Printcap and Configuration Functionality After much consideration, added the 'client.xxx' and 'server.xxx' facility. Briefly, if you have a printcap entry of the form client.xxx or server.xxx then this can be used to set the corresponding xxx variable when the printcap entry is used by the lpd server or the LPRng client programs lpr, lpq, lprm, checkpc, etc. Entry Program Type Sets server.xxx = vvv lpd (server) xxx = vvv client.xxx = vvv lpr,lpq... (client) xxx = vvv The purpose of this enhancement is to allow a single printcap entry to be used for both client and server operation, especially in situations where the lpd server is forwarding or sending jobs to another lpd queue. Example of use: lp: # used by clients, forcess them to send to # specified server :lp=%P@server.hostname:force_localhost@ # used by lpd server # the server will now send jobs to the # specified destination :server.lp=%P@destination This is equivalent to and replaces the :client and :server printcap flags, as shown below: lp:client :lp=%P@server.hostname:force_localhost@ lp:server :lp=%P@destination This selection operation also works with values in the lpd.conf file, allowing global overrides for clients and servers. (I can't imagine a use for this, but it is there if somebody wants to use it.) The lpc client and lpc server commands will display the selected client.xxx and server.xxx values. They are also propagated to the PRINTCAP_ENTRY environment variables for filters. Typo's in documentation corrected. (Patch by: Stepan Kasal ) lpr Kerberos authentication failures were not being reported. (Problem noticed by: Rick Cochran ) Added SSL authentication. See the README.SSL.SECURITY file for the truly complicated details. Note that testing with certificates signed by non-root CA indicates that the client is not sending a certificate, even though one has been requested and the certificates and signing certs are in the right places. lpd.conf did not have 'include' functionality working. (Patch by: Stepan Kasal ) Added Yet Another LPRng Option: user_is_authuser user_is_authuser: if( header_info && User_is_authuser_DYN && (s = Find_str_value(header_info,AUTHUSER,Value_sep)) ){ Set_str_value(&job->info,LOGNAME,s); DEBUG1("Check_for_missing_files: authuser '%s'", s ); } printcap: lp:auth=kerberos5:user_is_authuser:... Causes the principle name to be used as the user name. lpq_in_perl was screwed up (Patches by: Anthony Thyssen ) generate_banner core dumped. Turned out not to be setting banner format ("f") when generating entry, so that control file generation core dumped when generating new control file. (Problem reported by: "Keith Rinaldo" ) Updated Remove_done_jobs to sort jobs by completion time. Added 'Set_nz_flag_value' function to stop the ERROR_TIME value from being gratuitously updated by various routines. Found possible cause of 'job data files not removed' problem in the Remove_done_jobs() code. There is a possibility of a data file being orphaned if a 'done job' is removed by the spooler at the same time that another processes such as lpq information gathering examines the print job. Rare, but possible. Put warnings in the LPRng-HOWTO section on Samba about the done_jobs option and interaction with SAMBA job status. (Suggested by: Marcus Manske ) Added yet another wakeup and kick to the master server process so that printer pools will respond faster. Sigh... Version LPRng-3.8.12 - Mon May 6 08:21:49 PDT 2002 patch for TCPWRAPPERS added a gratuitous -lwrap to the src/Makefile. (Spotted by: Rabellino Sergio ) Version LPRng-3.8.11 - Thu Apr 4 07:49:30 PST 2002 Subtle problem when a filter fails and produces zero length file. This is now treated as a JABORT level error. The problem is that RFC1179 treats a file length as 0 as a 'read until end of file on socket'. This means that folks who have filters that WILL produce zero length files need to do something to produce at least one byte of 'dummy' output. (Brought to my attention by: Sergij Kovalenko ) Fixed up a portability issue for Solaris 2.6, in linksupport.c. Need to do an unsigned long cast to do comparison of INADDR_NONE. (Original patch from: Dr Andreas F Muller ) Added patches to support TCP wrappers. Use: configure --enable-tcpwrappers (Patch by: Tobias Burnus ) Added a 'Linux Standards Base' (LSB) style startup script for Linux systems. (Provided by: Tobias Burnus ) Missing initialization for statb (Patch by: Rob Joyce ) Clobbering Logfile_LPD in common/lpd.c (Patch by: Hugh McDonald ) Added a call to 'Remove_done_jobs()' in lpd_status.c; then modified Remove_done_jobs to return indication that a job was removed so that lpd_status.c would RESCAN queue... Sigh... OK, but it now works 'right'. (Stale jobs not getting removed noted by: Richard Ems ) The problem of saturating a server when checking for work was re-examined. The new approach is: a) if some work was done, then check for success at lpd_poll_time intervals. If there remains work to be done and there is no process actively doing the work, mark the queue as needing service. b) for the marked queues, start at most 'lpd_poll_servers_started' queues at once, and start these at intervales of 'lpd_poll_start_interval' seconds. The effect of this will be to limit the number of processes that LPD will start at a time. (Pushed to look at the problem by: Johan Bengtsson ) Found a very odd bug... the escape code for '\:' in printcap entries appears to be broken. The fix was to assume that the only places where it would be used was in 'filter' or other options where the 'expand escape sequences' code would be called and would take care of replacing "\:" by a ":". . The 'Printer_device()' routine, when opening a filter as an output device, did not provide 'stdout' for the filter. Some filters such as pap from Appletalk seem to need this as they produce messages on STDOUT (fd 2) as well as STDERR (fd 3). Version LPRng-3.8.10 - Sun Mar 31 11:31:19 PST 2002 printcap.5 had :as and :ae examples reversed (Spotted by the guy with the red pen and the eagle eyes: Craig Small ) Slew of patches sent in by Tim Waugh - silly little kerberos include file patch - can't spell printer patch - si no moleste the files in the spool queue patch (already done) - added configure ability to find 'pr' program - GCC flags -W -Wall -Werror -Wno-unused-parms - also fixed up &*)*(&)*(& unsigned and signed integer casts Added patch to allow tcp wrappers to be used. Configure updated configure --enable-tcpwrappers use tcp wrappers (-lwrap) (Patch from: Tobias Burnus ) The authentication and connection information for permissions checking is now recorded so it can be used for permissions checking. and a couple of new fields have been added. The following permission tags now have the indicated values UNIXSOCKET - true (match or 1) if connection was over a UNIX socket, i.e. - the local host. When SERVICE=P REMOTEHOST - the original remotehost from which the job was sent (previously was the HOST value) REMOTEPORT - the original port from which the job was sent (previously was undefined ) AUTH - true (match or 1) if job sent using authentication AUTHTYPE - authentication type AUTHUSER - value of authentication key for user who originated job. For example, for kerberos this is the user's principle value AUTHFROM - value of authentication key for sender of job. For example, if the job was from the LPR program, this would have the same value as AUTHUSER. However, if it was forwarded from a server, it would have the server's authentication name or value. lpd.perms.in update to match the new entries (Requested by: Toby Blake ) Once again the checkpc file creation stuff is modified so that it can create files in a directory NOT owned by the lpd group/user. This is necessary for log files and other items. Note that this MAY cause problems for log file truncation as you need to copy file contents rather than just renaming them. But it turns out that I am already doing this so it appears to be OK. CAVEAT EMPTOR. (Reported by: Torsten Wiebesiek ) Usage messages now display version information as well as options and available debug flags. Idea shamelessly swiped from somebody else. (Stolen from: 'Guido' Van Rossen) Version LPRng-3.8.9 - Sat Mar 2 15:02:11 PST 2002 The 'unix_socket_path' and 'lpd_port' options have been modified slightly to correct some ambiguous behaviour, and a 'lpd_listen_port' option has been added. lpd -p lpd_listen_port -P unix_socket_path - the -p and -P command line options override the lpd.conf lpd_listen_port and unix_socket_path options - the default values for lpd_listen_port is "", indicating the use the 'lpd_port' value. The value "off" suppresses opening a port or socket. This allows the following operation: No unix socket: lpd -Poff (/etc/lpd.conf unix_socket_path=off) No lpd listening socket: lpd -poff (/etc/lpd.conf lpd_listen_port=off) Note that LPD will still open connections to the remote LPD servers using 'lpd_port'. If you want to override the destination lpd port, you must modify the lpd.conf file. Jeff Chua of FedEx (Federal Express) showed up at my office armed with a set of test scripts and a laptop running LPRng. He demonstrated the problem of the 'missing datafile' during job transfers. I have fixed the problem in this release. See the UTIL/testpr file. (Thanks to: Jeff Chua: ) more autoconf + automake + libtool insanity: WITH_LINK removed STRIP now used by libtool, changed to STRIP_OPTION Added AC_C_VOLATILE (see note on volatile below) (Reported by: Rick Troxel ) Forced a rescan of the input queue when the number of done jobs exceeds 'done_jobs' or the time since the first done job exceeds done_jobs_max_age . This solves a silly problem that shows up when you have a slew of jobs in a queue, the subserver is processing them, and no new jobs arrive while it is processing them. Under these conditions the 'done jobs' would not have been removed until all were done. If you were printing 1000 jobs then you could not submit any new jobs, even though you have done 999 of them... :-) Sigh... these boundary conditions are the pits. Added the 'volatile' option to declarations of static and nonstatic variables updated in signal handlers. You really don't want to hear the frothing about over-enthusiastic optimizing compilers, do you? Ran the Kerberos tests, discovered minor definition problems with krb4_auth.h and Kerberos4 support. Have no way to test this, hope the problem is resolved. The AUTHUSER information received at job submission time was not being stored and used later when printing permissions were checked. (Discovered by: Toby Blake ) Added a 'UTILS/README.ForKerberosHackers' file so that Kerbero Hackers can quickly and brutally set up a test LPRng system. Not for the faint hearted. Carry a dog nummy when you read this stuff... Some users hit themselves in the head and complain about headaches. If the 'lpd_port' value is 0, then checkpc and lpd squawk. (Not telling me who the user was, but reported by: Craig Small ) Version LPRng-3.8.8 - Sat Feb 23 07:35:45 PST 2002 Restored include file functions to lpd.conf. Also put in recursion depth checks so that it will stop if you have a loop. Version LPRng-3.8.7 - Fri Feb 22 12:24:38 PST 2002 Modified the wildcard lookup so that it returns some sane values for defaults, i.e. - '*' is not treated like a real printer and the first 'real' printer is used. Sigh... autoconf, automake, and libtoolize insanity. Each of these facilities has a different version of the config.guess and config.sub files, and will brutally copy them to the distribution directory when you run automake, autoconf, or libtoolize. Problem sort of solved by running through the /usr/local/share/{auto*,libtool} directory and finding latest versions of things. As the CarTalk guys say, "Bo-0H-OH-OH Gus!". Sigh. The 'Service_connection: bad request...' error message now has the IP address of the sender added. (Good idea from: Rainer Tammer ) Makefile.in had the diagnostic options left enabled after regression tests. BAD! Bad Programmer! BAD! No coffee for you today. (Reported by: Petri Kaukasoina among others...) Portability stuff, // comments, and src/Makefile referencing ${SRC}/../UTILS instead of ../UTILS. (Reported by: Hans Peter Verne ) Missing check in lpstat for end of string condition: for( t = Printer_DYN; t && !isspace(cval(t)); ++t ); => for( t = Printer_DYN; !ISNULL(t) && !isspace(cval(t)); ++t ); (Reported by: Villy Kruse ) psbanner was creating a /tmp/before file. (Reported by: Anthony R Iano-Fletcher ) Fixed the 'job done' status message so that it shows the job id. (Suggested by: Christoph Beyer ) Added some sanity checks to handle cases when hold files and control files do not have identifier information in them. Checkpc now checks for duplicate spool directories. Version LPRng-3.8.6 - Fri Feb 8 19:31:52 PST 2002 HF_NAME not getting set when hold file read and it is not in file. This makes updates miserable. (Problem spotted by: Helmut Jarausch ) Fixed typeo in configure where I had unixsocket and unixsocketpath instead of unix_socket and unix_socket_path... (Pointed out by: Craig Small csmall@eye-net.com.au) Modified the host/printer lookup behavior when clients are using 'force_localhost'. You now use the 'original' queue name rather than the 'destination' queue name. Wonder how long this has been there. (Prompted by a problem report from: Andrew Gray" ) Missed a 'AF_UNIX' definition. Now guarded with ifdefs. Corrected LPRngHOWTO accounting information: (Error reported by: "Dirk Krause" ) Example: lpd generates: jobstart - from the lpd.conf 'as=' option jobend - from the lpd.conf 'ae=' option -H - host name -n - user name -P - printer -k - control file name -b - byte count of job/file -t - current printing time -J - Jobname (if present in control file) -C - class (if present in control file) -M - mailname (if present in control file) ifhp filter generates: start/end - of filter, for entire job filestart/fileend - if or other filter, for each file (options above are same) -A - identifier information (if present in control file) -q - process id of filter -p - current value of page counter, 0 indicates no page counter on printer or it is not readable jobstart '-Hh110.private' '-nroot' '-Plp' \ '-kcfA129h110.private' '-b48780' '-t2001-10-19-09:36:36.000' ^^^ bytes in file start '-q26130' '-p105340' '-t2001-10-19-09:36:38.330' \ ^^^^^^^ starting page counter value for job '-Aroot@h110+129' '-nroot' '-Plp' filestart '-q26132' '-p105340' '-t2001-10-19-09:36:38.350' \ ^^^^^^^ starting page counter value for file '-Aroot@h110+129' '-nroot' '-Plp' fileend '-b19' '-T435' '-q26132' '-p105359' '-t2001-10-19-09:43:51.504' ^^^^^^^ ending page countvalue for file ^^^ number of pages printed for this file '-Aroot@h110+129' '-nroot' '-Plp' end '-b19' '-T435' '-q26130' '-p105359' '-t2001-10-19-09:43:51.504' ^^^^^^^ ending page countvalue for job ^^^ number of pages printed for this job '-Aroot@h110+129' '-nroot' '-Plp' jobend '-Hh110.private' '-nroot' '-Plp' \ '-kcfA129h110.private' '-b48780' '-t2001-10-19-09:43:51.000' ^^^ bytes in file Version LPRng-3.8.5 - Tue Jan 22 15:58:46 PST 2002 Added a minor fix to lpq so that it will check all queues. (Courtesy of Jim Trocki ) Version LPRng-3.8.4 - Thu Dec 13 08:25:17 PST 2001 ARGH! ARGH! screwed up lpq -a by forgetting to get the 'all' printer information. Doh! (Spotted by and slapped his forehead by: Patrick Powell ) "Why do we need a TCP/IP port?" quoth the raven, I mean Craig Small . "I have a version that has this facility..." respondeth Patrick ("Mr. Grumpy") Powell. "But I think you will not be happy". I merged the two versions. Be Happy. configure: Added these options --enable-unix_socket (default disabled) --with-unix_socket_path=PATH (default /dev/lprng) /etc/lpd.conf: OPTION TYPE DEFAULT PURPOSE unix_socket FLAG 1 enables/disables the UNIX socket unix_socket_path STR /dev/lprng path to the pipe using this Also: lpd_port = 0 will disable the TCP/IP port lpd -p 0 - disables the TCP/IP port or /etc/lpd.conf lpd_port=0 lpd -P /path - enables, unix socket specified by path or /etc/lpd.conf unix_socket@ lpd -P off - disable unix socket Permissions: Connections to the UNIX socket will appear to come from localhost, (127.0.0.1) port 0. You can use the UNIXSOCKET to check for this condition, or explicitly for localhost/port 0 ACCEPT/REJECT ... UNIXSOCKET Also updated the INSTALL note. checkpc: I was using 'To_daemon()' calls all through the code. This was not needed and would cause a substantial slowdown in operation. I now do exactly ONE call at the start of operations. updated the config.guess and config.sub to the latest version provided by autoconf. Incoming jobs now have a status entry. This is to support IPP and status reporting for incoming jobs. The idea is that you can start transferring a job and then, when the whole job is transferred, the job will be done. To make this happen you need to put an entry in the queue to act as a place holder and reserve the job number for this action. When transfering an IPP job, you can send it in chunks. This now allows the IPP system to send the job header (request), set up the job status, and then the job contents. Just to make life interesting... Found some places where I was using 'sizeof(xxx)' instead of a passed value for an error message buffer. Very short error messages - 3 chars long... :-) LPD now REALLY uses the lock files to prevent multiple instances from running. This might/will/could break on systems that NFS mount their lock directories. Cleaned up the error message about bad print job formats. Clearly there are some REALLY strange printing systems out there. (reported by: Phil Moses ) Checkpc -A XX -r now has nicer format: t1: file 'hfA877', age 24.57 hours > 24.00 hours maximum (Spotted by: (Craig Small) csmall@eye-net.com.au) Added the following to the pass_env options: LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT LC_IDENTIFICATION LC_ALL This should help with LOCALE support. Version LPRng-3.8.3 - Mon Dec 10 20:40:02 PST 2001 Fixed the operation of 'lpr -Pxx' when printcap for xxx has the format: xx:direct:lp=... Sigh... too many special cases... (Pointed out at LISA2001, and fixed on site... Now who was that masked Sysadmin???...) (From the mailing list: James Thomas Klaas ) Removed spurious commas in control file Z options. Configure did not set 'done_jobs_max_age' correctly. (Patch from: Dejan Ilic ) lpc flush now cleans out status as it should have done... GRRR... user pointed this out at LISA 2001... Fixed up a problem with global variable Name. From: Rick Cochran I got LPRng to build under OSX. It required only one patch which seems to be due to the fact that "Name" is declared "extern" all over the place, but is only defined in getopt.c. Since lpstat doesn't use getopt, ld complains. I'm not sure why GNU ld should complain under OSX and not on other platforms. (Patch by: Rick Cochran ) Editted the lpr man page. Updated the information about obsolete options. Updated the installation procedures for FreeBSD, linux, etc. The STANDARD_configuration script now checks to see if there is a /usr/share/man and if so, runs configure with --mandir=/usr/share/man. Man pages now show up in the right place. This was true on *BSD, various LINUX distros, and some versions of SunOS/Solaris. Updated the DISTRIBUTIONS/FreeBSD entry and the postinstall scripts so that the port stuff works better. Now if you do: cd LPRng/DISTRIBUTIONS/FreeBSD* make PREFIX=/usr SYSCONFDIR=/etc You will get the same effect as: cd LPRng sh STANDARD_configuration make clean all install But, as you might suspect, there are some minor gotchas. The man pages usually get installed in /usr/share/man, but when you use the PORT system and override PREFIX it insists on installing them in /usr/man... and various versions of the FreeBSD and OpenPort stuff INSISTS that when generating a port that the originals of the man pages are in the ${PREFIX}/man/manX directories. I gave up and cheated: you get an obnoxious warning to either create /usr/man or to make a symbolic link from to /usr/share/man from /usr/man before installation starts. I know, I know. But I don't have that many brain cells left to fry... Version LPRng-3.8.2 - Mon Dec 3 12:26:52 PST 2001 MAJOR CONFIGURATION CHANGE: LPRng can retain status of last N completed jobs configure --with-done_jobs=N - set done_jobs value, default 1 configure --with-done_jobs_max_age =N - set done_jobs_max_age value, default = 0 (no expiry) Or in the printcap/lpd.conf: :done_jobs=1 :done_jobs_max_age=1 Example: Printer: t1@h110 'Test Printer 1' Queue: no printable jobs in queue Server: no server active Status: job 'cfA231h110.private' removed at 18:25:36.281 Rank Owner/ID Class Job Files Size Time done papowell A 278 /tmp/hi 3 18:25:31 Controlled by: :save_on_error - all jobs with error saved, status not removed :save_when_done - all jobs with no error saved, status not removed :done_jobs=N - last N jobs completed (error or no error) saved :done_jobs_max_age=N - jobs with status older than N seconds removed This is best explained by: On job completion: if( (no error && save_when_done) || (error && save_on_error) || done_jobs > 0 || done_jobs_max_age > 0 ){ do not remove job } When queue updated: if( !(save_on_error || save_when_done) ){ while( done_jobs_max_age >= 0 && the time since completion of oldest done job > done_jobs_max_age ){ remove the oldest done job } while( done_jobs >= 0 && total number of done jobs > done_jobs ){ remove the oldest done job } } Fixed up the order of 'require_explicit_q' in the variable list. Added 'lpd -p port' so that lpd port can be specified at run time. (Suggested by: Chris J. Herbst ) Added 'PrintingCookbook' to the distribution. The 'shorthost' DNS lookup result was not being set correctly if DNS lookup failed and you had to drop back to using IP address. Clearly the shorthost form of IP10.0.0.1 is IP10.0.0.1, not IP10. Added patches to help support Win32 porting using Cygwin: UID 0 is now ROOTUID instead of 0 value. ROOTUID is set by ifdef in portable.h checkpc -f no longer puts out the annoying '/var/run/lpd.515 does not exist' message. List_sep (which is only used in Check_for_rg_group) needs a comma. (Discovered by: Graeme Wood ) Reworked the 'start lpd subprocess' code so that it is a little more civilized. Modified portable.h so that LPRng compiles properly on HPUX 11.xx systems. lpc help fixed up - 'redo - reprints jobs' Cleaned up the 'Make_sort_key' code so it does not do needless malloc. Version LPRng-3.8.1 - Thu Nov 15 16:08:41 PST 2001 The original default actions and values for the LPD_PRINTCAP_PATH have been restored, as it broke too many other things. A work around for the problems with using LPD and database based configuration has been found... ugly, but it works. Chooser also now will wait when it cannot find a queue instead of just exiting. This solves the problem of 'hung' load balance print queues using 'chooser' support. Trim the accounting file information. This now solves the 'mysterious full spool partition' error messages. 'indefinately' is really 'indefinitely' ... so says 'ispell' The 'remove_z' now really removes 'Z' options. (Found by: Ryan Lovett ) The 'require_explicit_q' added for those folks who absolutely require that a queue be specified and do not want them to use a default queue. (Patch to code supplied by: James Thomas Klaas with a little help from Dan Escapa) Grrr... left in a line of code when I was doing some testing of the setuid functions in Win32 and screwed up the setuid stuff. Fixed up a silly problem with file descriptor 0 not bound to /dev/null in lpd subprocesses. Fixed the 'Trim_status_file' routine so that it now treats file descriptor 0 and -1 as 'closed' files. This prevents some silly problems with initialization. Release LPRng 3.8.0 Mon Oct 15 12:09:13 PDT 2001 At line 174 in accounting.c: } else if( safestrncasecmp( s, "hold", 4 ) ){ This should be } else if( !safestrncasecmp( s, "hold", 4 ) ){ otherwise anything send back to lpd from the accounting filter other than accept will result in a JHOLD! (Spotted by: "C. L. McAvaney" ) Added :force_ipaddr_hostname option. This causes the IP address of the remote host to be used for the hostname, overriding the information in the control file. This can be used when you really need the IP address rather than the hostname in the control file. (Needed by: Rick Cochran ) Release LPRng 3.7.9 Mon Oct 15 06:18:43 PDT 2001 Version control strikes again. Sigh... Now all the files are carefully put into place (Fumble fingers by: Patrick Powell ) Release LPRng 3.7.8 Tue Sep 25 12:35:46 PDT 2001 Can't spell... fixed typos in man pages. (Corrections from: Karsten Weiss ) lpd_logger.c - free(sp); s=0 ... this sure does make free() and malloc() unhappy... (Found totally by accident: Patrick Powell ) lpr '-Y' (enable lpr_filter) processing fixed up a bit. Now has better diagnostics and information. An extremely rare but annoying network condition causes LPQ print status to fail. When running as root (setuid root), and doing an LPQ operation, the lpq process will try to bind to a port in the low port range (512 - 1023). This will sometimes fail with a timeout if the port has been recently used and bound to. I have put a bit more 'randomization' into the selection of the port, but there is really nothing that can be done, as the TCP/IP error status does not distinguish between 'connection refused because you just connected from this port' and the remote printer being off line. Sigh... The obvious answer to this is to bind to the low ports only when needed, but this requires users to know when to set the option. I give up. Release LPRng 3.7.7 Fri Sep 14 15:54:48 PDT 2001 checkpc whooped its cookies when running checkpc -f and the device is /dev/null (lp=/dev/null). Apparently I cannot set /dev/null to use blocking IO... Sigh... So I do not count 'changing non-blocking IO to blocking IO' as an error. i8n French Translation (gettext) added. (Supplied by: Francois Mescam ) The files generated by the 'incoming control filter' were not being re-read by the LPRng system. Silly me. (Discovered by: Tuomas Toropainen ) The 'bq_format' option was not being handled correctly for defaults. This option has the value: bq_format=IoIo...D I = original input format (or '*' for wildcard match) o = filter output format D = default (if present), otherwise keep original It now handles the case where no translation is required correctly. (Prompted by a question from: Rainer Tammer ) Did not check to see that I was a client before doing setgroup to daemon. Stupid of me. GRRRR... I now have a test for this in the code. (Warning from: Petri Kaukasoina ) Release LPRng 3.7.6 Fri Sep 7 05:36:00 PDT 2001 There was no call to Getdaemon_group so the default daemon group was 0. This, as they say, was double plus ungood. (Spotted and reported with a cackle of diabolical laughter by: Petri Kaukasoina ) I added a 'half_close' flag so that you can force a 'close(fd)' rather than a 'shutdown(fd,1)' to be done for those problem child network printers that whoop their TCP/IP stacks and die horrible deaths when they get a half closed connection. This is, as they say, a bug in the print server, but I have encountered worse. The same printers also whoop their cookies when reporting status but I don't seem to be doing a half-close on 'lpq' connections so this doesn't seem to be a problem. I have modified the 'lpq' code so it does not do a 'half-close'. Example: lp:lp=host%9100 # happy, well behaved, print spooler box lpb:lp=host%9100:half_close@ # buggy print spooler box Grammar fixed in LPRng-HOWTO. (Red pencil work done by: ) Release LPRng 3.7.5 Sun Sep 2 12:43:39 PDT 2001 I was not closing all open file descriptors. This caused checkpc and lpd (when running as 'spool queue server') to die mysteriously after processing a couple of jobs. (Clue to cause supplied by: Heiko Burghardt ) The lpc -s status only reported number of jobs. Now it also reports queue status, as it used to, and should have. And it reports only the number of printable jobs. (Patch by: Garry Zacheiss ) Patch to accommodate Broken RFC1179 Implemenation #39 from Apple. (Gory details and a patch by: Darius Davis ) The 'Read_fd_len_timeout' and 'Write_fd_len_timeout' code would not pause indefinately if the timeout value was 0. (Noticed by: David E. Cross ) A slew of patches from Crutcher Dunnavant at redhat.com: From the LPRng-3.7.4-23.src.rpm at the RedHat ftp site: LPRng-3.7.4-direct.patch - fixed a typeo in vars.c LPRng-3.7.4-inet_ntop.patch - conflicting/duplicate definition of inet_ntop. NOTE: I also fixed the inet_pton() definition to be consistent with the patch. LPRng-3.7.4-jobfilescan.patch, LPRng-3.7.4-lockfile.patch a little less agressive checkpc operation. Checkpc now does not NOT update the targets of symbolic links. This solves the problem of various tools creating files in the spool directory as well as symbolic links to filters. The FILES need to be accessible by filters running as the LPD user, the targets of the symbolic links should not be touched. LPRng-3.7.4-kerb5.patch - not used, do not want to hardwire paths into configure. Modified RPM config file to add /usr/kerberos/{include,lib} instead LPRng-3.7.4-lockfile.patch - lockfile created now LPRng-3.7.4-manpage.patch - typo in lpr.1 fixed LPRng-3.7.4-nointl.patch - configure using wrong -lintl value. LPRng-3.7.4-nonblock.patch - changed some blocking opens to nonblocking opens in checkpc so that checkpc did not hang. Silly of me not to have done this, as the Check_write() routine even had a nonblocking flag just for this purpose. LPRng-3.7.4-s390.patch, LPRng-3.7.4-setgroups.patch This is a fiddle, not a major problem. The only exploit possible is if the lpd server is started with "extra" groups besides the default one. If you do not install lpd SETUID root (which is the default) then you have to be root to start this (su root OR login as root), and this means that either login or su is not setting up the group membership correctly. But it is better to err on the side of paranoia than be careless. LPRng-3.7.4-shutdown.patch Note: the 'shutdown()' patch was NOT applied as it breaks a slew of other things. Clearly we have some problem printers out there that need to be identified. (Courtesy of: Crutcher Dunnavant ) Updated GETTEXT/i8n support to gettext-0.10.39. The printcap option 'prefix_option_to_option' is declared as a flag in src/common/vars.c in both versions 3.7.4 (line 355) and 3.6.26. { "prefix_option_to_option", 0, FLAG_K, * &Prefix_option_to_option_DYN,0,0}, should be: { "prefix_option_to_option", 0, STRING_K, &Prefix_option_to_option_DYN,0,0}, (From: Anthony R Iano-Fletcher ) Redid the authentication documentation and code... cleaned it up a bit. And comments. And printcap.5 updated, HOWTO updated. Sort of works now. Fixed up '$a' filter options so that :af=xxx is put on command line only if it is NOT a filter. This clears up the mysterious Linux Printfilter deaths. Permission checking now works for SERVICE=X. You can only do remote host and port comparisions (REMOTE_IP=, REMOTE_HOST=, PORT=). This was initiated by a bug report about address mask generation. (From: Willi Burmeister ) 'lpc client' now displays defaults. The changes to use the 'initgroups()' call for setting process group and effective group also cleared up problem reported by some Debian users. You can now put a colon in printcap entry values using: \:. This makes life a little easier for some folks who need to have options of the form "http://...". You can now do: filter=/.../sendftp -d ftp\://some/site The configure defaults for filter_path (PATH value for filters) are now /bin:/usr/bin:/usr/local/bin The configure defaults for filter_ld_path (LD_LIBRARY_PATH value for filters) are now /lib:/usr/lib:/usr/local/lib Reviewed LOTS and LOTS of documentation. Fiddles all over the place. Release LPRng 3.7.4 Wed Dec 27 07:10:27 PST 2000 ARGH ARGH! Distributed the test version and not the release version for 3.7.3 - this has not been a good week. The printcap entry '*:client:rm=IPADDR:force_localhost' now works correctly with lpq -a. Side effect: you do not get status if you do not have a default printer. i.e. - 'lp|*:client:rm=IPADDR' is better. I now kill off process by using SIGHUP, SIGINT, SIGQUIT and SIGCONT. Even Guido thinks this is overkill but expects that there will be some system where even this does not work. Added a check for the VERSION of gdbm as well. ARGH ARGH ARGH... I fixed a problem with signals (SIGINT) killing off the process waiting for a lock on a file descriptor, but I did it wrong. (Pointed out most gleefully, complete with TRUSS output by: Doug Morris AND John Perkins ) Release LPRng 3.7.3 Sun Dec 24 17:47:52 PST 2000 Updated the default printcap file with a simplified set of instructions. There was a 'sleep(1000)' instead of a 'plp_usleep(1000)'. Needless to say, this did slow things down a bit. LPRng HOWTO Section on Samba had 'printcap file' instead of 'printcap name' (Spotted by: Marcel Kunath" ) HPUX compilation without GCC had a gratuitious CFLAGS=-Aa. I removed the flags. (Reported by: Ryan Novosielski ) Release LPRng 3.7.2 Fri Dec 22 10:45:00 PST 2000 Discovered that job moves were not working correctly. Was removing the lpd_port value by mistake. Close_gdbm() was not defined, and the #if HAVE_GDBM_H confused some compilers. (Reported by: Shane Voss ) ifhp.conf got the 'reverse_priority' description wrong. (Proof-reder was: Michael J. Carter ) When I added the user printcap stuff I did not set a return value and the 'tc=' broke. Sigh. (Reported by: gizillions of people, including Michal Kouril ) RFC1179 does not ABSOLUTELY PROHIBIT some print spooler expecting multiple LPQ request. So it does not close the connection after sending status. So I now do a shutdown() to cause it to not expect further commands. (Detective work done by Rainer Tammer ) The 'short_status_date' and 'full_time' options seem to conflict with each other. The 'full_time' means to use full time formats in LPQ status, and the 'short_status_date' means to use short date formats. The 'full_time' option now controls both of these, which is probably what was intended in the first place. (Pointed out by: Bill Kemp ) Get_all_printcap_entries() was not clearing All_line_list so you would get duplicate entries. Solved the 'mystery duplicate printer' problem observed during testing. Natter in the README and INSTALL for Solaris users. Release LPRng 3.7.1 - Tue Nov 28 06:33:32 PST 2000 Major Changes That Effect Backwards Compatibility 1. local printcaps for users - ${HOME}/.printcap This allows users to specify a printcap in their local directories. Of course, you can use the 'user_printcap@' option to disable this. But why bother? 2. job file filtering always enabled The classical 'store and forward' behavior has been changed. If you have a print queue with filters AND you have a file with the format specified for a filter THEN the file is filter and the filtered output is used. This is CONTRADICTORY to 'vintage' BSD and 'legacy' LPRng behavior. If you want to have 'job flattening', that is, to have the job combined into a single file with all the files processed, you need to use 'lpd_bounce'. If you are currently using 'lpd_bounce' you will see no difference in behavior. The bq_format option is used to get the 'new' formats after filtering. Bq_format has the form: OnOnOn...D where O is the original format, n is new format, and D is default if there is the original format is not present. If no default then original is retained. The bq_format default is now 'f', not 'l'. Example: bq_format=f (default) all processed files have 'f' format bq_format=flmf (default) f -> l, m -> f, others unchanged if processed. 3. lpr -k option is now re-enabled to allow lpr to handle pipe input without creating large data files. Note that if you kill programs off then you might end up with a truncated job. You can use: cat | lpr -k OR cat | lpr -k -- - 4. You can now have :lpr= Command Line Options This will prepend the command line option flags to the lpr command. Note that this now allows you to set up a user printcap entry that has command line options suitable for lpr. 5. Super lightweight no spooler printing to devices with filter support. New command line options: -B, -X filter, -Y New printcap option: :direct SEND JOB DIRECTLY TO REMOTE TCP/IP PORT: lpr -Y -Phost%port file1 file2 OR: use :direct flag in printcap In your ${HOME}/.printcap or /etc/printcap file put: lp:direct:lp=h14%9100:remote_support=R:client And use: lpr -Plp file (:direct is effectively the same as -Y) Effectively: ( for i in file1 file2 ; do ${filter} <$i; done ) > h14%9100 where ${filter} is chosen from the printcap entry. Note: if you do not specify a file then this reduces to reading from STDIN, e.g.- ${filter} > h14%9100 NOTE EXTREMELY WELL- for 1 file jobs: The STDOUT of the filter is the TCP/IP port connection. This allows the filter to get status and other information from the remote printer. SEND JOB VIA A PROGRAM (SAMBA smbclient, for example): lpr -Y -P '|/smbclient //server/share' file OR: lp:direct:lp=|/smbclient //server/share:remote_support=R:client lpr -Plp file Effectively: ${filter} temp.$i ; done lpr -Ppr@host temp.file1 temp.file2 ... USER SPECIFIED FILTER: To use a user specified filter: lpr -X filter Example lpr -Y -Phost%port -X userfilter file OR: lp:direct:...:filter=userfilter:client Effectively: cat file | userfilter >host%port NOTE EXTREMELY WELL- for 1 file jobs: The STDOUT of the filter is the TCP/IP port connection. This allows the filter to get status and other information from the remote printer. SPECIAL CASE for lp=queue@host: lpr -X userfilter -Pqueue@host file1 file2 Effectively: send control file; for i in file1 file2 ; do userfilter $i > tempfile send tempfile; done EXTREMELY SPECIAL CASE: -k option The -k option with RFC1179 spooling AND a single file will case the following actions to be taken: send control file send a 'expect BIG file' command cat userfile | filter > server You can also add -X userfilter and get: send control file send a 'expect BIG file' command cat userfile | userfilter > server This is done so that you could run lpr as a filter and send HUGE data files to the printer. This is done by invoking the '0 length file is read to EOF' facility of RFC1179. Unfortunately, this is not supported by all network print spooler boxes, so the 'fakelargefile' option allows you to fake this by sending a very large file number (in K bytes). I suggest using 1000000 - i.e. - a 1 Gigabyte file. Start of a new branch: iNTERNATIONALIZATIOn (i18n) Support Revisted iNTERNATIONALIZATIOn support has been reviewed and incorporated in a much more stable and maintainable manner. Rewrote the ABOUT-NLS.LPRng file. Modified the Makefile to update version information in the po/*.po files as well. Reviewed much of the error message and status messages, and added them to the translation list. Added the N_() facility for 'static' messages and tables. On 4 Sep 2000, a compromise problem with the gettext facility was announced. This was based on the standard 'fprintf' functions, which have a '%n' option to allow values to be written to memory. I have totally eradicated the use of the standard printf, fprintf, and so forth, and use a safe version of snprintf without this capability. This allows LPRng to be used on systems where similar attacks can be launched. In addition, if the executable is running with uid or euid 0 (i.e. - root), then NLSPATH environment variable is unset. This may break some of the 'set process name' code on some systems, but I cannot think of another method that will do this. You can now use FreeBSD/BSDI/ and most likely some other newer versions of the BSD Make in addition to GMake. What a pain this was. If your make supports VPATH it should work. Hopefully. GDBM used to store information. This now makes handling LARGE numbers of files, etc., in a spool queue directory feasible. Needless to say, status generation time is VERY small. There are several caveats on this. If you kill off the lpd server when it is in the middle of updating the database file, you will end up corrupting the database file or having an incomplete one. To resolve this problem, the 'checkpc -f' command can be used, as well as the 'lpc flush' command. Also, the initial queue scan done at system startup will rebuild the databases. IPV6 portability was not quite there. Some minor fiddles. So I stopped playing the violin. Maybe some time in the future. (Fiddling done and patch supplied by: John Perkins ) Fixed the lpq.c status trimming functions to be a little more robust. Also, put back the recursive lpq functionality. (Recursion loss spotted by: Christoph Beyer ) The lpraccnt program is removed from the distribution. The 'monitor' program can be used instead. I wonder why I had two of these in the distribution. The load balance queues are now treated like 'first class' queues and jobs moved to them are treated like incoming jobs. This allows all of the incoming filters to be run, routing to be done, and other abuses far too esoteric to grace these CHANGES notes. This involved doing some very odd things with chdir(), etc. to make sure that the filters would run with the correct directory. Also, status information for load balance queues changed so that you don't get silly messages about non-existent jobs which have been moved to the load balance queue. Fixed up problems when you run out of file space with load balance queues. Fixed up debug and status file information logging with load balance queues. Fixed a really silly design flaw in Setup_printer() that closed the status file just when you did not want it closed - and then truncated it. Debug file is now closed and opened only ONCE during a call to Do_queue(), making it possible to debug the queue service. All in all, a really thorough redoing of the queue handling was necessary to make them into first class citizens. (Motivated by the questions of: Jason Keltz ) lpd now mumbles at you when you try to start it up and it has problems. Of course, most folks do 'lpd >/dev/null 2>&1' but we will ignore them... (Inspired by the well chosen arguments of: and Craig Small ) lpd now CORRECTLY opens output filters - lp=|/path (Spotted by: Seth Chaiklin ) LPRng-HOWTO - Samba example corrected (Correction by: Philippe Weill ) lpd_port=[ipaddr%]port now will cause lpd to bind to the interface with the specified IP address. (Prompted by the whingings of some anonymous Debian user and forwarded by: Craig Small ) checkpc runtime help was wrong. (Spotted by: James P. Dugal ) INSTALL_PREFIX replaced by DESTDIR to be consistent with other distributions and packages. lp -f formname now makes the CLASS information 'formname' as well. (Inspired by: Dave Lovelace ) In LPRng/common/linelist.c, many missing checks for null pointers. (Found in a core dump supplied by: Mike Whitson ) lpr -o option is now the same as lpr -Z option (Suggestion to save sanity of SYSV users by: Joseph Krahn ) lpq did not always have a space before job file size. (Noted by: Jonathan Briggs ) Release LPRng 3.6.26 Fri Oct 13 07:38:38 PDT 2000 unsetenv() is not available on some systems. Fallback to setenv and then putenv() if not present (Found by: Niklas Edmundsson ) Release LPRng 3.6.25 Tue Oct 3 09:19:11 PDT 2000 syslog Compromise - modified syslog to use 'syslog(xx,"%s", msg). gettext Compromise - added the following to Initialize(): if( getuid() == 0 || geteuid() == 0 ) unsetenv("NLSPATH"); IN6_ADDR removed, in fact IPV6 stuff removed. See the various CERT advisories. Sigh... Release LPRng 3.6.24 - Fri Aug 11 08:03:23 PDT 2000 LPRng-HOWTO - added update for Samba print queue configuration. LPRng-HOWTO - added section on how to configure Solaris lp printing to communicate with LPRng. (Changes courtesy of: Gerald Damian ) Typo in gethostinfo.c spotted. (Courtesy of the debugging talents of: Robin Sommer ) And I removed the wrong line so that the data files were not being deleted when a job was completed. Helps to read the control file and get the data file names... (Pointed out by: Thomas Emmel ) There was a 'cut and pasteo' that caused me to use the wrong value to get trim lpq status. (Core dump and clues supplied by: John Perkins ) LPRng HOWTO - added small section on setting up Solaris lp queues to forward jobs to LPRng/BSD printers. IPV6 Support fixed up a bit to actually work... (Spotted during testing, now that we actually have IPV6 working on our router.) Added a 'flush cached status' when a spool server exits. Now you get the correct status when there is no active server. Modified the 'Read_write_timeout' code to be consistent with reading status from parallel port printers the way that the ifhp filter does it. Found a minor sillyness in the 'send_to_logger()' code - I carefully format data and then toss it way. Now I do checks first. Fixed up lpq status generation - only read a small part of the status file for information. Release LPRng 3.6.23 - Fri Aug 11 08:03:23 PDT 2000 The Linux Printing Summit was held from July 27-28, 2000 in San Jose, and was Sponsored by VA Linux. There was an extremely enjoyable interchange of views between all of the various interested factions. You will see some additional changes in LPRng as a result of these meetings and the input from users and developers. Support for status caching has been incorporated in LPRng. In addition, 'spool queue lookup throttling' has been added in order to improve the speed of status gathering. And there are now facilities to control the format of returned status. This is implemented as follows: a) Each queue has a file containing keys corresponding to status queries. For example, if you do 'lpq' then the query key would be "4_" corresponding to the "\004\n" query sent to the server. If you do 'lpq this that' you have the key "4_this_that_" and so forth. b) Corresponding to each query is a file containg the status for the query. If the status is 'stale', that is, older than 'lpq_status_stale' seconds, then the lookup is redone. c) When a job is submitted to a queue, or the status of a job changes, or a control operation is performed on the queue, then the cache is flushed. Currently, this means that the status has to be regenerated for all queries. d) If the queue status was changed less than 'lpq_status_interval' seconds ago, then the cached status (if any) will be used. e) If the process needs to update the print queue, it will attempt to lock the status file. This means that at most one process will be scanning the print queue for status at a time. This has had an extremely good improvement on status reporting, especially under high load conditions and multiple processes attempting to scan the queue. This locking actually improved throughput much to my surprise. A careful analysis showed that by having only one or two processes scanning the directory at a time, the OS was better able to cache and buffer data. In actual fact, the second process would then find the files that it was looking for already in memory or in the buffer cache. Also, if the two processes were getting the same data (lpq -a), the first one would set up the data in the cache and the next one would simply read the cached data. The 'lpc flush' command has been added to flush all of the cached status. This was added for testing and for administrative purposes. A new Super Secret option (well, it is documented now) has has been added to the 'lpq' facility. The following only works with LPRng servers (as of this release, of course): lpq -- -lines=N (in general: lpq -- -opt=v,opt=v) The '-lines=N' is passed directly through to the LPRng lpd server, where used to set the size of the returned status. It is NOT propagated to other servers, BUT it is used to truncate status returned from them. This will effectively give you a VERY compressed status extremely quickly when combined with the caching facility. The -- is used to indicate that the -lines=N is actually an option to be passed through to the server. This capability has been in LPRng, but this is the first documented use of it that will be supported. The addition of this facility has some interesting implications. You can now have a VERY lightweight lpq facility, for getting the status of one printer, if you know the server it is on: echo "\004printer -lines=2 xx xx xx" > nc host 515 (nc is the 'netcat' program written by mudge@avian.org) Of course you do not have authentication, etc., but this is One Of Those Tradeoffs. YOU ARE WARNED: USE THE SOCKET CONNECTION METHOD AT YOUR OWN RISK AND DON'T WHINE WHEN YOU DISCOVER THAT THE LACK OF AUTHENTICATION IS CAUSING YOU PROBLEMS. If this is a problem, use the 'lpq' application and turn on authentication. On the other hand, you can now get printer status WITHOUT the use of an 'lpq' process to format it. I expect the various folks building WebServer interfaces for LPRng print status will be more than happy now, as this works well in a multi-threaded environment, is strictly socket/connection based. Another benifit is that NonLPRng (can you say Microsoft?) based applications can now use the -lines=N entry to select the amount of status that they want returned. This allows remote clients not LPRng based to select the level of verbosity. This work was inspired by the Samba Developers, especially Andrew Tridgell, John Terpstra, and Jeremy Allison, , and their presentations and discussions at the Linux Printing Summit held in San Jose, July 26-31, Sponsored by VALinux. You can now specify a filter for your input files at the user level. This is to support the requirements and/or desires of the various users of print spooling software to have a filter applied at the application end. The syntax is: lpr -X /path file1 file2 equivalent to: for each file in filelist; do tempfile=maketempfile; /path <$file >$tempfile end lpr $tempfile1 $tempfile2 ... The filter is invoked once per job file, on each job file. The options passed to the filter are the usual ones for all LPRng filters. Some will not have any meaning, such as job number, etc., and will not be present or have a '0' value. The filter will run as the user's id, and will not have root capabilities. If this is needed, then the filter must have the capability of acquiring them. This work was inspired by the GIMP Project presentation of Robert Krawitz http://www.tiac.net/users/rlk/ Project lead for The Gimp Print -- http://gimp-print.sourceforge.net at the Linux Printing Summit held in San Jose, July 26-31, Sponsored by VALinux. I ran into problems with the SysV to LPRng option passing. Apparently different versions of SysV printing pass options as S, O, or whathave you values in the control file. The prefix_o_to_z option has been replaced by the more general 'prefix_option_to_option' facililty. This specifies the control file option lines to prefix to a control file option line. For example: prefix_option_to_option=S,O Z will prefix S and O to Z prefix_option_to_option=Z O will prefix Z to O. This now appears to cover all cases, and the LPRng HOWTO has been modified as well. The simple minded 'send mail to user' facility had some problems. I fixed them up, and added a 'sendmail_to_user' flag that allows the facility to be disabled for sending mail to users, but still sends mail to operator. I have also updated the HOWTO with some notes about using this facility. (Patches sent by: Maja Gorecka-Wolniewicz ) Several calls to Print_job(...) assumed that a file will respond with status information, as would a real printer. Not a good assumption. I wonder where my mind is at somedays... The 'Network Grace' timeout should only be used when a server is trying to connect - clients should not have to wait. I have once again changed the checkpc code to be very very very conservative in what it removes from the spool queues. This will make the folks who use netatalk, etc. very happy. The bad news is that files put into these directories by other tools will not get removed. C'est la vie, C'est la guerre... (Patches inpiring the changes sent by: "William R. Knox" ) pclbanner had a stupid typeo left over from debugging. It wrote debugging information out to /tmp/before The 'lpr_bounce' code did not work after the last fix to solve problems with Print_job closing files. Now you can use filters again from lpr. I have added the 'wildcard' print queue names and 'incoming_control_filter' options. Together, they implement a way to put options and other information into the control file when a job is submitted. This method was exploited by Adeel Khurshid while at Fujitsu Network Communications, and is used by the 'apsfilter' by Andreas Klemm and Thomas Bueschgens. Example: lp|lp_*:lp=%P@server lp|lp_*:server :incoming_control_filter=/.../update_z :... When you use lpr -Plp_landscape_ledger you will actually end up sending the job to the lp queue, with the queue name (Q control file line) set to lp_landscape_ledger. This information can be used to update the various control file lines. The LPRng/UTILS/update_z file has an example of a script that will do this. Note that this makes the use of the apsfilter utility even easier. (Inpired by a control filter by: Adeel Khurshid ) I removed a couple of bogus entries that I was putting into the job control file. These appear to be holdovers from some testing. They were put in but never used. Strange, that. The append_z, prefix_z, and other related Z operations are done only when the job is received. This now allows the job to be processed by filters and not have the work undone. sigh. Documentation cleaned up as well. The control file processing has been cleaned up and the redunant and erroneous (sigh) copy of the control file in the job{} data structure has been ruthlessly purged. I sure wish Ruth worked for me, I seem to be doing so much ruthless cleanup. I see the hand of testing and debugging in much of this stuff, and the tracking down of memory leaks as well. You can now use [^x] in the glob patterns. Sigh... The things people do when they get the bit in their teeth. The LPD support for 'lpq' and 'lprm' requests has been modified so that if there are chained queues and each queue is on the server THEN I simply call a routine and do not fork a process. This solves a problem with process exhaustion when somebody had a loop in their printcap. I also put in some tests for this. However, without adding Yet Another Option to the LPRM and LPQ stuff I don't see how I can do it. You can now send up to 'max_jobfiles' (default 52) to the server. Note: you can actually only send 52*52 = 2704 The data files are given names dfAnn -> dfZnn -> dfann -> dfznn -> dgAnn -> dgZnn -> dgann -> dgznn -> dzAnn -> dzZnn -> dzann -> dzznn -> daAnn -> daZnn -> daann -> daznn -> deAnn -> deZnn -> deann -> deznn -> dAAnn -> dAZnn -> dAann -> dAznn -> dZAnn -> dZZnn -> dZann -> dZznn There is now support for the HP extensions: (Courtesy of Richard Hart USG , who sent me the following information) Summary of HP's Extensions to RFC-1179 1. 4-Digit Job Numbers HP preserves the System V-style 4-digit sequence number, or job number, in file names and attributes, while BSD uses 3-digit job numbers. 2. Control and Data File Naming Conventions Control files are named in the following format: cA is the 4-digit sequence number (aka job number). is the originating host name. The data file naming sequence format is: dA through dZ followed by... da through dz followed by... eA through eZ followed by... ea through ez ... etc. ... So the first data file name in a request begins with "dA", the second with "dB", the 27th with "da", the 28th with "db", and so forth. 3. HP-Specific BSD Job Attributes (Control File Lines) The following control file lines are extensions of RFC-1179: R Write to the named login's terminal when the job is complete. This is an alternate to the RFC-1179-style e-mail completion notification. This notification is selected via the lp "-w" option. -- R line -> M line A Specifies the System V-style priority of the request, a single digit from 0-7. -- A value -> priority N B Note that this line begins with an "N", a space, and then a "B". The argument is the banner page title requested via the lp "-t" option. If that option was not given then the argument is null. -- banner -> T banner N O Note that this line begins with an "N", a space, and then an "O". The argument contains the System V-style "-o" options specified in the lp command line. The option names appear without a leading "-o". The first option name begins in the fourth character of the line; each option is separated by a blank. If no "-o" options were given then the argument is null. -- -> appended to Zvalue The following control file lines are generated differently than in standard BSD: J The argument is the System V-style request-ID, for example, "printer-42". Note that leading zeros are not present in the sequence number. If a System V-style title is requested then it is sent using a "N B" attribute, and not the "J" attribute. There is now a new and improved error message for fumble fingers: h4: {1185} % lpq -Pxx Printer: xx@h4 - ERROR: spool queue for 'xx' does not exist on server h4.private non-existent printer or you need to run 'checkpc -f' h4: {1186} % lprm -Pxx ERROR: spool queue for 'xx' does not exist on server h4.private non-existent printer or you need to run 'checkpc -f' h4: {1187} % lpc -Pxx status Printer Printing Spooling Jobs Server Subserver Redirect Status/(Debug) xx@h4: spool queue for 'xx' does not exist on server h4.private non-existent printer or you need to run 'checkpc -f' I hope that this cuts down on the problems reported by people who do not RTFM about 'checkpc -f'. I have added code to track the maximum open file descriptor so that the 'cleanup' code is a little more intelligent. Release LPRng 3.6.22 - Sun Jul 23 17:37:02 PDT 2000 There is yet one more problem with high load levels - I did not set the timeout to reasonable value and the lpd server goes into a tight loop waiting for it. Release LPRng 3.6.21 - Sun Jul 16 16:58:19 PDT 2000 Clean up some Tru64 system warnings about casts. (Supplied by: "Justus J. Addiss" ) Seemed to have found a solution to the parallel port problem by brutally using fstat() to see if we have a device, and if so, then unless it is a tty, assuming that it is a write only device. This is stupid, and I just KNOW that when somebody adds a USB device I will suffer for this. When you have a 'write only' file descriptor, you just do a 'write' with timeout. No select, nothing. Just a write. This seems to solve the problem. Oh yes. You also make sure the file descriptor is non-blocking. (By: Patrick Powell ) There is a bizzare problem with doing select for read on some Solaris systems with certain patch sets on file descriptors that have been set for non-blocking. The select call will actually return and indicate that the device can be read... But when you do, you get -1, and EUNAVAIL or some similar code indicating no data to be read. This is truly bizzare. To ensure that this does not happen, you must do a select on a nonblocking file descriptor. To add injury to insult, this seems to not be reliably reproducible. You really had to be there for this one. I now set all the file descriptors into blocking mode and then do select, then put them in nonblocking mode to do the write or read. The mysterious 'lpc reread' killing lpd was discovered to be caused by trying to free an already freed pointer, which was garbage. This was related to cleaning up the memory leak problem in 3.6.20. Sigh... I cannot spell krbros... krb5... or kb5... and thus cannot invoke the dog in the configuration script. (Happily pointed out by: John Perkins ) Release LPRng 3.6.20 - Sat Jul 8 12:32:38 PDT 2000 One of the silly memory leaks that has been reported, tested for, analyzed, etc., finally was found. The problem was in the child.c file, where I keep track of children processes by dynamically allocating a list. While I carefully cleaned up the list in children of the main LPD process, I never cleaned up the list in the main LPD process. Thus, if you created a large number of children the list would grow a small amount (4 bytes) for each child. This problem was found by brutally using the 'DMALLOC' debugging package, finding every 'malloc' call in the main LPD process and then looking for a matching free call in the main line loop. When one was not found for the case where I had 0 processes I knew that I had found the problem. Sigh. (Stumbled over after staring at the code for a week by: Patrick Powell ) Makefile now checks that POSTINSTALL is 'NO' or 'no' (Noted by: Craig Small ) checkpc -C and checkpc -c file removed. Legacy options and I don't know why they were still there. (Noticed by: Jesper Dangaard Brouer ) The call to 'Remove_tempfile()' routine was removed from the 'cleanup()' when trying to find the above mentioned memory leak and was not put back. Bad Coder! Bad! (Found by: A Earle ) The pclbanner and psbanner had some errors that showed up under bash. Very odd that the ksh and /bin/sh did not whoop on them. (Clever debugging by: David Livingstone ) checkpc -r -A was a little too agressive and it blew away all sorts of files. The -r now only works on job files. I do NOT remove job files unless the -r -A age options are given. This prevents some problems with jobs being moved into a queue just as checkpc is being run from cron. Sigh... Cron. I forgot all about Cron. (Noticed by: Craig Small ) Release LPRng 3.6.19 - Sun Jun 25 11:13:35 PDT 2000 The filter status was not getting used correctly. This was a side effect of trying to clean up aborted jobs and accounting. One step forward, one step back. Sigh. The Tru64 compiler objects to casting pointers to ints, so we have to cast to a long THEN to an int. (Reported by: Justus J. Addiss ) Did not update the 'Tempfile' variable when I was checking multiple print queues. This meant that it was using a stale queue name. Only shows up if the queue directories are on different file systems. (Spotted by the eagle eyes of: Robin Sommer ) Apparently the CHANGES file had 'z_append' instead of 'append_z'. So it is changed. Do we need a Meta-CHANGES file to record changes to the CHANGES file? (Caused by the readings of: Michael J. Carter ) Release LPRng 3.6.18 - Mon Jun 19 09:37:04 PDT 2000 The UTILS/accounting.pl script did not handle malformed lines caused by truncation well. It now does, but insists that you have lines starting with start, filestart, end, fileend for status. This ties into ifhp-3.6.15 Updated the DISTRIBUTIONS/FreeBSD to make the port correctly Updated the DISTRIBUTIONS/RPM to make the port correctly Changed the psbanner font to a more readable font (Artistic criticsm by: Bodo Moeller ) Lowercased DNS lookup return values. (Need discovered by: Alf Wachsmann ) Tru64 cc compiler whoops its cookies on void * conversions... (Reported by: Justus J. Addiss ) Release LPRng 3.6.17 - Sat Jun 17 15:58:21 PDT 2000 Analysis of the Setuid Compromise for LINUX done; LPRng is only susceptible if a non-root user manages to run a client program that in turn runs a program that she has compromised. Since the programs run by LPRng and other servers should owned by root and not writable, this would require the compromiser to have already modified these - by alreadying having root perms. This means that they have already compromised the system. Replaced the agressive 'check at all times and costs' with a) a configure time check for the 'bad linux kernel' b) a run time check done only by clients for a compromise. c) not installing LPD setuid ROOT so that it cannot be started and used as a compromised process. Release LPRng 3.6.16 - Thu Jun 8 15:24:37 PDT 2000 Long numbers and the silly 'is this really and IP address code' conflicted. Fixed it again. (Spotted and reported 32 minutes after the release was out by: Thomas Vogt ) Did not check for null pointer, the following printcap was not read correctly: .junk: stuff:tc=.junk <- ummm... nothing there, CRASH (Spotted and reported 30 minutes after the release was out by: Justus Addiss ) Changed :as and :ae checks so that you can use :as=/path as well as :as=|/path (Inspired by comments from: Sree Lakshmi ) pclbanner did not work under RedHat. (Spotted by: David Kerr Livingstone ) Goofs in the HOWTO spotted. (Spotted by: Zanferrari Domenico ) Updated the HOWTO format. Now using DocBook to generate output. RPM packages not generated correctly If the -Dxxx option is the VERY FIRST on the command line, then you set up the debug options very early in the parsing and operation. This can lead to a GREAT deal of rubbish unless you need it. Release LPRng 3.6.15 Thu Jun 8 15:24:37 PDT 2000 postinstall.generic.sh was sytactically incorrect. (Patch by: Justus Addiss ) RPM Fixes: /usr/docs/LPRng now removed Linux (and possibly other) SETUID BUG compromise detection added. The setuid(n) call is supposed to be a one-way trip to uid n, but this can be compromised by users setting flags. Present in kernels before 2.2.16, and possibly other capabilities based systems. Added a test to make sure that this is really a one-way trip. As far as I can tell, this would only be an issue if the user had a shell script that was executed by LPRng and the script could be replaced by something else. This is possible in systems which are using NFS - I have exercised the compromise and it exists. Release LPRng 3.6.14 Sat May 6 08:46:26 PDT 2000 configure now has --with-lockfile=path. (Courtesy of: Willi Burmeister ) Complete configure options are now: --with-cc=COMPILER select compiler to use --with-ccopts=CFLAGS select compiler command line options --with-linker=LINKER select linker to use --with-ldopts=LDFLAGS select linker command line options --with-cppopts=CPPFLAGS select compiler preprocessor command line options --disable-setuid disable setuid root client and server executables --enable-priv_ports require connections to be from privileged ports --disable-force_localhost force_localhost default to disabled --disable-require_configfiles client programs require lpd.conf, printcap --enable-kerberos enable kerberos support --enable-mit_kerberos4 enable MIT Kerberos 4 support --disable-kerberos_checks disable kerberos library location and checking for support --with-lpddir=DIR lpd executable directory (default ${sbindir}) --with-lpd_conf_path=PATH path of lpd.conf (default: ${sysconfdir}/lpd.conf) --with-lpd_perms_path=PATH path of lpd.perms (default: ${sysconfdir}/lpd.perms) --with-printcap_path=PATH path of printcap (default ${sysconfdir}/printcap) --with-lpd_printcap_path=PATH path of lpd_printcap (default ${sysconfdir}/lpd_printcap) --with-lockfile=PATH lockfile PATH, default /var/run/lpd --with-ld_libary_path=PATH LD_LIBRARY_PATH value --with-filter_path=PATH filter PATH value --with-userid=NAME run LPRng software as this userid, default daemon --with-groupid=NAME run LPRng software as this groupid, default daemon --with-chooser_routine=NAME load balance queue chooser routine name in user object file --with-order_routine=NAME queue order routine name in user object file --with-user_objs=NAME user specified object file --with-user_include=NAME include file with function prototypes for user object file --with-filterdir=DIR filter directory (default ${libexecdir}/filters) --disable-strip disable stripping binaries by default --enable-nls use Native Language Support --with-included-gettext use the GNU gettext library included here --with-catgets use catgets functions if available Terminal clearing now done by using 'clear' program. Configure will look for a clear program and LPQ will fork and exec it. If no clear, then simply send a '^L' or '\014' (form feed) to the stdout. This is due to the horrible support in most OS's for curses, termlib, termcap, term... well, you get the idea. For a true trip through hell, read the configure script for 'vim' and see what they do. Not for me, when this is only a VERY small part of a much larger system. (Changed after finding curses, ncurses, and sys5 curses on a system by: Patrick Powell ) Makefile.bsd is now a VERY small makefile: # List the things you want to generate: all clean install uninstall: gmake $(MAKEFLAGS) $@ I know that some of the BSD folks will hate me for this, but I have decided that trying to support both types of Makefiles and making them work was just too much effort. Also, the BSD folks now have much better supporort for Gmake in their build scripts. Also, see below... Enhanced Install and Package Creation Support. Enhanced Install and Package Creation Support (Laid at the feet of: Craig Small ) One of the problems that is encountered when trying to build a package or do an install is to compile stuff in one directory and then install it in another. The trouble is, you want to install it in a MIRROR directory. For example, you have ${SYSTEMSRC}=/private/src, where the source is, ${BUILD}=/var/tmp/BUILD/ where you are going to build all the stuff, ${MIRROR}=/var/tmp/MIRROR where you want to place what you created The following is generally what is done during distribution creation to do this: cd ${BUILD}/.../LPRng; ${SYSTEMSRC}/.../LPRng/configure --prefix=/usr/local --sysconfdir=/etc make make install XX=${MIRROR} -> puts thing in ${MIRROR}/usr/local ${MIRROR}/etc After trying 9 (nine) different variations on a theme, I now have the following method to do this: make install INSTALL_PREFIX=${MIRROR} POSTINSTALL=NO What is this? The install script/steps will install files in ${INSTALL_PREFIX}${prefix}, ${INSTALL_PREFIX}${sbindir}, etc. etc., where ${prefix}, ${sbindir}, etc, are hardwired by the configure step to the /usr/local/, etc. Now you might wonder why this is done. The reason is that GMAKE, bless its little heart, will use the $PREFIX environment variable value if it is set. So you cannot do ${PREFIX}/${sysconfdir} in install scripts, and if you do not set it on the command line, have it put in the right place. The POSTINSTALL=NO is used to suppress 'true' postinstallation stuff that would copy files into 'unexepect' places, such as '/etc/printcap' or '/etc/lpd.perms' or '/etc/lpd.conf'. Now if you are building a system distribution for raw install, then you want this to be done, and you would use: make install INSTALL_PREFIX=${MIRROR} If you are building, say a FreeBSD 'package' distribution or a RedHat RPM then you would use: make install INSTALL_PREFIX=${MIRROR} POSTINSTALL=NO Now for all of you who want to make a package and need to find the files that LPRng will install, I suggest you look at the following: INSTALL_PREFIX=/var/tmp/LPRng #note that you do NOT export this ( cd $INSTALL_PREFIX; mkdir usr/local/bin usr/local/sbin /usr/local/libexec /etc /usr/local/etc/rc.d .... ) make; make install INSTALL_PREFIX=${INSTALL_PREFIX} (cd $INSTALL_PREFIX; find . -type f | sed -e '/man[0-9]/d' \ -e '/\/info\//'d -e 's/..//' >/tmp/files find . -type f | sed -n -e '/man[0-9]/s,.*man[0-9]/,,p' \ -e 's/..//' >/tmp/manpages You can now find the non-doc files, manpages, etc. etc. etc. and then update the various locations as you need. Clearly this should be done only as root, on a system where you do not have other users running, where somebody cannot do 'ln -s /etc/passwd /tmp/manpages' and so forth. For a truly abusive use of this method, look at the DISTRIBUTIONS/FreeBSD* and DISTRIBUTIONS/Solaris* directories. Yes, I have no shame. (Put into the distribution after telling people 5 times how to use this by: Patrick Powell ) lpr -U option did not work correctly when UID was root. (Patch happily submitted after a long search by: Roberto Togneri ) lpd was mangling jobs with more than 26 files - caseless compare strikes again. (Found with great consternation by: Peter Scheurer ) permissions and filters: When you use a filter for "perms_path" was not executed when a connection to the lpd is made. So there are no rules then and the result of the permission check simply is the default_permission (and it results in having no rules for the 'R'-check as well) By convention, a line containing the name of the printer for which permission is wanted. Now a blank line is written for 'X' rules. Added capability of filter getting permissions to Setup_printer(). (Found by: Robin Sommer ) lpd_jobs: race condition eliminated at the cost of a high system overhead when multiple jobs are spooled to the same queue. (Inspired by: Shawna Chase" ) client connections on Solaris 2.5 systems fail with EADDRNOTAVAIL, and need a 'retry'. Alternative is to use non-priveledged port. (Found by: Peter A. Harris ) innetgr() needs FQDN on some systems, and 'shorthost' on others. Added check to do both. (Reminded by: Robin Sommer ) syslog messages not working. May need to add 'ordering' test to configure for level comparison. (Noticed by: Jurgen Northe ) RFC1179 transfer failures to remote spool queue did not do retries correctly. The 'JFAIL' status was treated as a permanent failure, not a temporary. The 'Service_printer' code now uses the number of send attempts to do a retry and backoff on transfer times: configuration and/or printcap options: send_try: maximum number of times to send to remote (0 = infinite) - default 3 connect_grace: minumum time between attempts - default 0 connect_interval: interval between attempts - default 10 sec max_connect_interval: maximum time to wait - default 60 sec if( attempt > 0 && max_connect_interval > 0 ){ n = connect_interval * (1 << (attempt-1)) + connect_grace; if( n > max_connect_interval ) n = max_connect_interval; sleep(n); } (Discovered by: Christof Drescher ) Default filter options were missing '$b'. (Pointed out by: Jose Carlos Rodrigues Lopes ) The md5 authentication support did not return back 'error' status for lpr operations. (Noticed by: Patrick O'Brien ) The 'IS_OS' macros are now set to the OSVERSION; this makes tests like #if defined(IS_BSDI) && IS_BSDI > 401 possible. Sigh... The filter_path (PATH environment value for filters) added /usr/contrib/bin (Suggested by: Jeffrey C Honig ) UTILS directory needs to be part of the global 'make' so that tools are created with the right paths. (Discovered when fixing a problem found by: Jeffrey C Honig ) check_for_nonprintable default is now OFF due to 85 distinct problems reported by various users. (Email that broke the camel's back sent by: John Hawley ) lp -s was printing status. (Discovered and fix by: Mark.Belton@mgc.com.au) proctitle() code was mangling the envp[] - this only showed up if you happened to set debug level 6 or higher. (Discovered by: Vincent Fox ) Microsoft now sends the IP address as part of the control and data file names. OK. We can handle that. (Pointed out by: Rainer Schoepf ) When using a routing filter, the DATAFILES environment variable contains the data files. The routing filter can modify the datafiles, but cannot remove them or truncat them. The default for bq_format is now 'f' - i.e. - you can reprocess outputs of bounce queues. The old default was l (binary), which was not processable. The 'lpq -s ID' command was not reporting information correctly. It always reported the total printable, not the ones selected by the options. (Discovered by: Patrick Powell ) Retested Kerberos 5 and Kerberos4 stuff with Kerberos 1.1.1, found problems with compilation, fixed them. (Helped by: Mike Whitson ) Updated Version and Copyright information. Added configure --enable-kerberos option for folks who need to build 'non-exportable' binaries. Added a '$(INSTALL_PREFIX) entry to the install scripts to allow folks who want to install the binaries in a different subtree to do so. I might make this 'PREFIX' to fit in better with feedback. More fixing of Kerberos stuff - fixed up the problems with different uses of krb5_xfree. Added tests for the krb4des library. (Helped by: Mike Whitson ) The spool_file_perms option was not being used to set permissions for files in the spool directory. Noted in the Debian LINUX bugs list. It was also noted that the user was trying to set some very odd permissions that would result in a possible security loophole, but Hey! I just do LPRng... Users (not the LPD server) use 0600 permissions, just to avoid those nasty security problems. Nit pick on man pages: SEE ALSO should not reference same man page. (Submitted by: Debian Linux Bug List) checkpc now checks for server printcap entries with lp=xxx and rm=yyy values. This way you at least warn the users when they screw up. (Good suggestion by: Craig Small ) Moved tests for 'setproctitle' in configure around to deal with some problems of libraries being included when they should not have been. Fixed up the distclean. Removed junk files. Move the LPRng_DOCS into the HOWTO, as there were no other files left. Fixed permissions. Did some fiddling to add easier FreeBSD/NetBSD etc. support. Side effect was that testing install is easier. Added a 'INSTALL_PREFIX' to the installation paths that allows me to make sure that things go to the right places. Move the various distribution specific information into DISTRIBUTIONS directory. Made the LPRng and ifhp configure.in mainly identical. Also use the same portable.h file. Fixed (once again) typeos in the man pages, and the installation of compressed man pages. Sigh... Added a 'filter_stderr_to_status_file' flag that causes print filter errors to be written to the status file (:ps=file) rather than to the status log file. Also added truncation of the status file. (Inspired by : "William D. Colburn (aka Schlake)" ) Discovered, as a result of testing the 'filter_stderr_to_status_file' flag that backslash '\' escapes were not being handled correctly on the filter line. Fixed this. If a filter has <,>,;, or | in it, or starts with ( then it is executed by using: :if=/.../filter xxx -> /bin/sh -c '/.../filter xxx' This allows you to do things like '/.../filter 2>>status' Updated checkpc to check for matching () for filters. Modified the src/linksupport/connection() code so that the lpq and other clients do not try binding to port 515. This can cause problems when used with Samba. The code in linksupport.c that set SO_REUSEADDR and SO_KEEPALIVE was also tidied up. lpc -a now works sort of correctly and the documentation has been changed to reflect it. The LPC=xx permissions checking did not require a 'C' operation. Also, cleaned up some message printing. Make_passthrough was examined and a couple of changes made to handling the case when the filter path contained a meta character. The path now has parenthesis put around it. By default, this form of invocation does NOT have options passed to it. Added a '$*' parameter to provide all the default command line options. This now allows you to do: :if=(/some/path $* | output filter) New functionality: remove_z, prefix_z, and append_z (Inspired by a comment by: Richard Kaszeta ) remove_z=pattern,pattern,... remove the -Z option specified by the pattern. Example: -Ztest,this,thing + remove_z=th*,out -> -Ztest append_z=option,option,... appends this to the -Z options Example: -Ztest + append_z=landscape -> -Ztest,landscape prefix_z=option,option,... prefixes this to the -Z options Example: -Ztest + prefix_z=landscape -> -Zlandscape,test Example of use: You want to have a set of queues where you can have the queue set the functionality: landscape:append_z=landscape:lp=remote@host portrait:append_z=portrait:lp=remote@host lpr will add these options before the job is sent. OR you have a 'bounce queue' situation where you want to add -Z options as the job goes through: portrait:append_z=portrait :lp=remote@host:server lpd will put these options into the job file ON RECEPTION. Also, before sending to a remote queue as well. Kinda bombproof, but covers most situations. If you have force_localhost then you want to connect to the server with the primary name of the printcap entry. The clients were using the lp=pr@remote pr value instead. CONFIGURATION OPTION: ld_library_path and filter_path you can set these values through configure. Portability Support: DISTRIBUTION directory and init files Put the init scripts for