ports/74312: [patch] cups-lpr does not fully replaces the standard lpr binaries
Gustavo De Nardin
nardin at inf.ufsc.br
Wed Nov 24 04:40:33 UTC 2004
>Number: 74312
>Category: ports
>Synopsis: [patch] cups-lpr does not fully replaces the standard lpr binaries
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: sw-bug
>Submitter-Id: current-users
>Arrival-Date: Wed Nov 24 04:40:32 GMT 2004
>Closed-Date:
>Last-Modified:
>Originator: Gustavo De Nardin
>Release: FreeBSD 5.3-RELEASE i386
>Organization:
>Environment:
System: FreeBSD lenore.brujeria 5.3-RELEASE FreeBSD 5.3-RELEASE #0: Fri Nov 5 04:19:18 UTC 2004 root at harlow.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386
>Description:
Apparently, there are programs (at least the native FreeBSD JDK port) that,
when running on BSD systems, rely on the existence of the lpr system binaries
at their standard locations (/usr/{bin,sbin}/{lpc,lpr}) to check/provide a printing
system.
print/cups-lpr, when instructed to replace the base lpr system (CUPS_OVERWRITE_BASE=yes),
only moves the base lpr utils "out of way", making it's binaries available instead,
by mere effect of $PATH search.
This is not enough to satisfy java/jdk14 (and possibly more programs?), which look
for the binaries at their specific paths (e.g. '/usr/sbin/lpc'). Thus, the replacement
should be done by symlinks substituting the binaries at the original locations,
then behaving more like the original ones.
Additionally, print/cups-lpr's 'lpc' command does not behave like the real lpc,
treating 'all' as a printer name in the command 'status all', and so listing no
printers, or possibly only a printer named 'all'. The 'status all' command is also
needed for the java/jdk14 printing system to work. This has already been reported
to the CUPS project (http://www.cups.org/str.php?L1004), but not corrected yet.
>How-To-Repeat:
Install java/jdk14. Install print/cups-lpr with CUPS_OVERWRITE_BASE=yes. Configure
a printer not named 'all'. Run any Java program that uses the JDK printing system.
Try to print something on it.
>Fix:
Apply these patches to print/cups-lpr.
--- pkg-install.diff begins here ---
--- cups-lpr.orig/pkg-install Sun Nov 14 21:09:33 2004
+++ cups-lpr/pkg-install Thu Nov 18 00:59:59 2004
@@ -10,7 +10,7 @@
case $2 in
POST-INSTALL)
for FILE in ${REPLACES_BINARIES}; do
- [ -e "${FILE}" ] && chmod 000 "${FILE}"
+ [ -e "${FILE}" ] && mv "${FILE}" "${FILE}.bak" && ln -s "/usr/local/${FILE#/usr/}" "${FILE}"
done
;;
esac
--- pkg-install.diff ends here ---
--- pkg-deinstall.diff begins here ---
--- cups-lpr.orig/pkg-deinstall Thu Dec 4 08:05:06 2003
+++ cups-lpr/pkg-deinstall Thu Nov 18 01:04:50 2004
@@ -10,6 +10,7 @@
case $2 in
POST-DEINSTALL)
for FILE in ${REPLACES_BINARIES}; do
+ [ -L "${FILE}" ] && rm "${FILE}"
[ -e "${FILE}.bak" ] && mv "${FILE}.bak" "${FILE}"
done
;;
--- pkg-deinstall.diff ends here ---
--- patch-berkeley::lpc.c begins here ---
--- cups-lpr.orig/files/patch-berkeley::lpc.c__status_all Wed Dec 31 21:00:00 1969
+++ cups-lpr/files/patch-berkeley::lpc.c__status_all Mon Nov 15 17:57:00 2004
@@ -0,0 +1,18 @@
+--- berkeley/lpc.c.orig Wed Feb 25 17:14:50 2004
++++ berkeley/lpc.c Mon Nov 15 17:54:38 2004
+@@ -339,6 +339,15 @@
+ }
+
+ /*
++ * A single 'all' printer name is special, meaning all printers.
++ */
++
++ if (dests != NULL && compare_strings(dests, "all", 3) == 0)
++ {
++ dests = NULL;
++ }
++
++ /*
+ * See if this is a printer we're interested in...
+ */
+
--- patch-berkeley::lpc.c ends here ---
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list