Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 69619 - Latest versions of cups-pdf produce no output
Summary: Latest versions of cups-pdf produce no output
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: x86 Linux
: High normal
Assignee: Printing Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-10-31 06:46 UTC by Jonathan Pappworth
Modified: 2004-12-20 12:46 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
net-print/cups-pdf 1.6.4 patch (cups-pdf-1.6.4.ebuild.patch,478 bytes, patch)
2004-11-28 19:16 UTC, Ian Perry
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Pappworth 2004-10-31 06:46:47 UTC
When I try to convert files to pdf the output directory gets created but there are no files in it. The log file on one machine reports this error
"[ERROR] failed to set file mode for PDF file"
I have also tried this on two other machines they both create the output directories but produce no error in the log and don't create the pdf file.

Reproducible: Always
Steps to Reproduce:
1.emerge >=net-printer/cups-pdf-1.5.2
2.try to print something to the printer from cups
3.

Actual Results:  
Directories for output are created in /var/spool/cups-pdf
drwxrwxrwx  2 lp          lp            4096 Oct 31 14:36 ANONYMOUS
drwxr-xr-x  2 root        root          4096 Oct 31 14:36 SPOOL

Log file reports

Sun Oct 31 14:36:31 2004  [STATUS] spool directory created (/var/spool/cups-
pdf/SPOOL)
Sun Oct 31 14:36:31 2004  [STATUS] anonymous output directory created 
(/var/spool/cups-pdf/ANONYMOUS)

Nothing else
reverting back to cups-pdf-1.3.1 resolves the problem, this version is no 
longer available through portage.


Expected Results:  
expected a file Test_Page.pdf to be created in /var/spool/cups-pdf/ANONYMOUS

 # emerge info
Portage 2.0.51-r2 (default-x86-1.4, gcc-3.3.4, glibc-2.3.4.20040808-r1, 2.6.4-
willow-park i686)
=================================================================
System uname: 2.6.4-willow-park i686 Pentium III (Coppermine)
Gentoo Base System version 1.4.16
distcc 2.16 i686-pc-linux-gnu (protocols 1 and 2) (default port 3632) 
[disabled]
Autoconf: sys-devel/autoconf-2.59-r5
Automake: sys-devel/automake-1.8.5-r1
Binutils: sys-devel/binutils-2.14.90.0.8-r1
Headers:  sys-kernel/linux-headers-2.4.21-r1,sys-kernel/linux-headers-2.4.19-r1
Libtools: sys-devel/libtool-1.5.2-r5
ACCEPT_KEYWORDS="x86"
AUTOCLEAN="yes"
CFLAGS="-O2 -march=pentium3 -pipe"
CHOST="i686-pc-linux-gnu"
COMPILER=""
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share
/config /var/qmail/control /var/www/localhost/htdocs"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=pentium3 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoaddcvs ccache distlocks sandbox"
GENTOO_MIRRORS="http://www.mirrorservice.org/sites/www.ibiblio.org/gentoo 
http://ftp.heanet.ie/pub/gentoo/"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="apache2 apm arts avi berkdb bitmap-fonts crypt cups encode f77 foomaticdb 
gdbm gif gtk2 imlib java jpeg kerberos ldap libg++ libwww mad mikmod motif 
mpeg mysql ncurses nls pam pdflib perl png pthreads python quicktime readline 
samba sdl slang spell ssl tcpd truetype x86 xml2 xmms xv zlib"

app-text/ghostscript-7.07.1-r7
net-print/cups-1.1.20-r4
net-print/cups-pdf-1.5.2
Comment 1 Jonathan Pappworth 2004-11-02 00:12:46 UTC
I have solved this by forcing cups to run as root. I think this is necessary for cups-pdf to work. If this is the case perhaps an info line at the end of the ebuild to inform people of this change.
Comment 2 Ian Perry 2004-11-21 20:59:06 UTC
As reported at http://forums.gentoo.org/viewtopic.php?p=1790664#1790664 the problem can be fixed with a one-line header modification. In the ebuild, changing

        sed -i -e "s:CPLOGTYPE 7:CPLOGTYPE 2:" \
                   -e "s:nobody:lp:" cups-pdf.h

to
        sed -i -e "s:CPLOGTYPE 3:CPLOGTYPE 2:" \
                   -e "s:CPSH \"-s /bin/sh\":CPSH \"\":" \
                   -e "s:nobody:lp:" cups-pdf.h

makes everything work as it should, no need to make cups run as root.

(I also made a change to the CPLOGTYPE variable, since it's set to 3 in 0.6.4 instead of 7.)
Comment 3 Ian Perry 2004-11-21 21:01:28 UTC
Whoops, made two mistakes:

- I'm talking about 1.6.4, not 0.6.4
- The CPLOGTYPE change may not apply to 1.5.2, which seems to be the focus of this bug. I haven't checked.
Comment 4 Ian Perry 2004-11-28 19:16:27 UTC
Created attachment 44906 [details, diff]
net-print/cups-pdf 1.6.4 patch
Comment 5 Rafal Dejewski 2004-12-17 03:45:32 UTC
The patch works. Please put it in portage. Thanks!
Comment 6 Shirish Jain 2004-12-18 02:13:16 UTC
Hi,

got bitten by the same bug. I fixed it by using "sudo" as my users on AD/Samba/Winbind do not have shell access on the "cups" server. This change works (tested in my environment) for users without shell. Dont know what security implications this may bring.

please test, and if u think its good idea, feel free to include in the "cups-pdf" ebuild. This will also require to add a dependency for 'sudo' in be ebuild as well.

hope this helps,

Shirish
>>
diff between my working version and 1.6.4 source is as follows:

25c25
< #define CPSU "/usr/bin/sudo"
---
> #define CPSU "/bin/su"
32c32
< #define CPSH "-S /bin/sh"
---
> #define CPSH "-s /bin/sh"
42c42
< #define CPGSCALL "%s -u \"%s\" %s -c \"%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH \
---
> #define CPGSCALL "%s - \"%s\" %s -c \"%s -q -dCompatibilityLevel=%s -dNOPAUSE -dBATCH \
Comment 7 Heinrich Wendel (RETIRED) gentoo-dev 2004-12-20 12:46:02 UTC
sorry for the delay, fixed