File LPRng-3.8.28.diff of Package lprng

--- configure.in
+++ configure.in
@@ -1421,6 +1421,7 @@
 AC_MSG_RESULT(using $SHELL (FORCED))
 
 AM_GNU_GETTEXT([external])
+AM_GNU_GETTEXT_VERSION(0.12)
 
 dnl XX AC_MSG_RESULT([LIBS $LIBS, INTLLIBS $INTLLIBS])
 dnl XX  if test "${USE_NLS}" = yes; then
@@ -1880,7 +1881,6 @@
 src/Makefile
 src/pclbanner
 src/psbanner
-po/Makefile.in
 ],
 [
 for i in  \
--- lpd.conf.SuSE
+++ lpd.conf.SuSE
@@ -0,0 +1,26 @@
+# See "man lpd.conf" for a list of options you can set here.
+#     check_for_nonprintable
+#   means the 'check_for_nonprintable' option default value is on or 1
+#   To set it to OFF or 0, change this to read:
+#     check_for_nonprintable@
+check_for_nonprintable@
+client_config_file=/etc/lpd.conf
+filter_ld_path=/lib:/usr/lib:/usr/X11R6/lib:/usr/local/lib
+filter_path=/bin:/usr/bin:/usr/local/bin:/usr/sbin:/usr/local/sbin:/usr/lib/filters:/usr/X11R6/bin
+mail_operator_on_error=root
+pr=/usr/bin/pr
+printcap_path=/etc/printcap
+# If you distribute your printcap entries through NIS,
+# use the following line instead:
+#printcap_path=|/usr/lib/yp/match_printcap
+printer_perms_path=/etc/lpd.perms
+server_config_file=/etc/lpd.conf
+server_user=lp
+user=lp
+group=lp
+# If your printer doesn't print the job remove the "@" from the following
+# line. (for example necessary for HP4M with a JetDirect Card)
+send_data_first@
+mc#0
+send_try#0
+max_connect_interval#10
--- lpd.perms.SuSE
+++ lpd.perms.SuSE
@@ -0,0 +1,2 @@
+# See "man lpd.perms" for a list of options you can set here.
+DEFAULT ACCEPT
--- man/lpd.conf.n
+++ man/lpd.conf.n
@@ -548,8 +548,12 @@
 the send_failure_action value is used to determine what to do on failure.
 .TP
 \fBsend_try\fR (default: 3)
-Numbers of times to try to send a job to the printer or remote host.
-A 0 value means an infinite number of times.
+Numbers of times to try to send a job to the printer or remote host. A
+pause of
+max(max_connect_interval, connect_interval*2^max(8, number of attempts - 1))
+seconds is inserted between consecutive attempts.
+A 0 or/and a negative value means an infinite number of times, but
+no pause is inserted for a negative value.
 .TP
 \fBsendmail\fR (default: "/usr/lib/sendmail -oi -t")
 If the argument is empty then all mail_related
--- printcap
+++ printcap
@@ -1,3 +1,16 @@
+# /etc/printcap: printer capability database. See printcap(5).
+# You can use the filter entries df, tf, cf, gf etc. for
+# your own filters. See the printcap(5) manual page for further
+# details.
+#
+# Default Postscript printer on "print-serv"
+#lp|ps|postscript:\
+#        :client:lp=postscript@print-serv
+#lp|ps|postscript:\
+#        :server:oh=print-serv:\
+#        :sd=/var/spool/lpd/ps:\
+#        :lp=/dev/lp1:\
+#        :sh:mx#0
 ## The Super Quick Guide to LPRng Printcaps
 ##  Patrick Powell <papowell@lprng.com>
 ##     Thu Nov 15 13:31:08 PST 2001
@@ -7,9 +20,9 @@
 #    The printcap entry below sets defaults.  Add default options
 #    or other entries here
 #
-.common:
-   :sd=/var/spool/lpd/%P
-   :sh:mx=0:mc=0
+#.common:
+#   :sd=/var/spool/lpd/%P
+#   :sh:mx=0:mc=0
 #
 #   [Translation:
 #   .common - the period (.) causes LPRng to treat this as a 'information
--- rc.lpd
+++ rc.lpd
@@ -0,0 +1,153 @@
+#! /bin/sh
+# Copyright (c) 1995-2000 SuSE GmbH Nuernberg, Germany.
+#
+# Author: Thorsten Kukuk <feedback@suse.de>
+#
+# init.d/lpd
+#
+#   and symbolic its link
+#
+# /usr/sbin/rclpd
+#
+# System startup script for the lpd daemon
+#
+### BEGIN INIT INFO
+# Provides: lpd
+# Required-Start: $network $remote_fs syslog
+# Required-Stop: $network
+# Default-Start: 2 3 5
+# Default-Stop: 0 1 4 6
+# Description: Start lpd to allow printing
+### END INIT INFO
+
+LPD_BIN=/usr/sbin/lpd
+test -x $LPD_BIN || exit 5
+
+# Shell functions sourced from /etc/rc.status:
+#      rc_check         check and set local and overall rc status
+#      rc_status        check and set local and overall rc status
+#      rc_status -v     ditto but be verbose in local rc status
+#      rc_status -v -r  ditto and clear the local rc status
+#      rc_failed        set local and overall rc status to failed
+#      rc_reset         clear local rc status (overall remains)
+#      rc_exit          exit appropriate to overall rc status
+. /etc/rc.status
+
+# First reset status of this service
+rc_reset
+
+# Return values acc. to LSB for all commands but status:
+# 0 - success
+# 1 - misc error
+# 2 - invalid or excess args
+# 3 - unimplemented feature (e.g. reload)
+# 4 - insufficient privilege
+# 5 - program not installed
+# 6 - program not configured
+#
+# Note that starting an already running service, stopping
+# or restarting a not-running service as well as the restart
+# with force-reload (in case signalling is not supported) are
+# considered a success.
+
+case "$1" in
+    start)
+	echo -n "Starting lpd"
+	## Start daemon with startproc(8). If this fails
+	## the echo return value is set appropriate.
+
+	## first run checkpc
+        #
+	checkpc -f
+
+	# startproc should return 0, even if service is
+	# already running to match LSB spec.
+	startproc $LPD_BIN
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    stop)
+	echo -n "Shutting down lpd"
+	## Stop daemon with killproc(8) and if this fails
+	## set echo the echo return value.
+
+	killproc -TERM $LPD_BIN -p /var/run/lpd.printer
+
+	# Remember status and be verbose
+	rc_status -v
+	;;
+    try-restart)
+	## Stop the service and if this succeeds (i.e. the
+	## service was running before), start it again.
+	$0 status >/dev/null && $0 restart
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    restart)
+	## Stop the service and regardless of whether it was
+	## running or not, start it again.
+	$0 stop
+	$0 start
+
+	# Remember status and be quiet
+	rc_status
+	;;
+    force-reload)
+	## Signal the daemon to reload its config. Most daemons
+	## do this on signal 1 (SIGHUP).
+	## If it does not support it, restart.
+
+	echo -n "Reload service lpd"
+	$0 stop
+       $0 start
+	rc_status
+
+	;;
+    reload)
+	## Like force-reload, but if daemon does not support
+	## signalling, do nothing (!)
+
+	# If it supports signalling:
+	echo -n "Reload service lpd"
+	killproc -HUP $LPD_BIN
+	rc_status -v
+
+	# If it does not support reload:
+	#exit 3
+	;;
+    status)
+	echo -n "Checking for lpd: "
+	## Check status with checkproc(8), if process is running
+	## checkproc will return with exit status 0.
+
+	# Status has a slightly different for the status command:
+	# 0 - service running
+	# 1 - service dead, but /var/run/  pid  file exists
+	# 2 - service dead, but /var/lock/ lock file exists
+	# 3 - service not running
+
+	# If checkproc would return LSB compliant ret values,
+	# things could be a little bit easier here. This will
+	# probably soon be the case ...
+	rc_checkproc() {
+		checkproc $1 || {
+			test -e $2 && return 1 || return 3
+		}
+	}
+	rc_checkproc $LPD_BIN /var/run/lpd.printer
+	rc_status -v
+	;;
+    probe)
+	## Optional: Probe for the necessity of a reload,
+	## give out the argument which is required for a reload.
+
+	test /etc/lpd.conf -nt /var/run/lpd.printer && echo reload
+	;;
+    *)
+	echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
+	exit 1
+	;;
+esac
+rc_exit
--- src/common/checkpc.c
+++ src/common/checkpc.c
@@ -579,12 +579,22 @@
 		} else if(!S_ISREG(statb.st_mode)) {
 			WARNMSG("'%s' filter '%s' not a file", id, s);
 		} else {
-			n = statb.st_mode & 0111;
+			n = statb.st_mode & 0777;
 			if( !(n & 0001)
 				&& !((n & 0010) && statb.st_gid == DaemonGID )
 				&& !((n & 0100) && statb.st_uid == DaemonUID ) ){
 				WARNMSG("'%s' filter '%s' does not have execute perms",
 					id, s );
+				if( Fix )
+				{
+				    if( statb.st_uid == DaemonUID ) n |= 0100;
+				    else if( statb.st_gid == DaemonGID ) n |=0010;
+				    else n |=0001;
+
+				    WARNMSG("setting perms of '%s' filter '%s' to '0%o'", id, s, n);
+				    Fix_perms(s, n);
+				}
+
 			}
 		}
 	}
--- src/common/fileopen.c
+++ src/common/fileopen.c
@@ -169,6 +169,12 @@
 			fd = tfd;
 		}
     }
+        if (create) {
+                if (fchown(fd, DaemonUID, DaemonGID) < 0) {
+                        LOGERR(LOG_ERR) "Checkwrite: fchown of '%s' failed", file);
+                        status = -1;
+                }
+        }
 	if( status < 0 ){
 		close( fd );
 		fd = -1;
--- src/common/lpd_jobs.c
+++ src/common/lpd_jobs.c
@@ -2537,7 +2537,7 @@
 		if( device_fd < 0 ){
 			DEBUG1( "Printer_open: open '%s' failed, max_attempts %d, attempt %d '%s'",
 				lp_device, max_attempts, attempt, Errormsg(err) );
-			if( max_attempts && attempt <= max_attempts ){
+			if( !max_attempts || attempt <= max_attempts ){
 				n = 8;
 				if( attempt < n ) n = attempt;
 				n = interval*( 1 << n );
openSUSE Build Service is sponsored by