0

I installed cups-pdf 3.0 beta 2 on a Redhat 7 OS.

I compiled the code manually (as per the instructions on their site) after I installed cups-devel-1.6.3-17.el7_1.1. I am running cups-devel-1.6.3-17.el7_1.1. I disabled SELinux temporarily to just to make sure it doesn't interfere with this.

I created a printer called Cups-PDF using this command:

/usr/sbin/lpadmin -p Cups-PDF -v cups-pdf:/ -m CUPS-PDF_opt.ppd -D "PDF Virtual printer" -E

where CUPS-PDF_opt.ppd is a file in the distribution archive.

I have/had the following problems:

  1. The printer definition disappeared after I restarted cups. Not sure why and I had to recreate it every time I restarted cups. But now it's in printers.conf. Perhaps it was because SELinux was enabled at one point.
  2. cups-pdf doesn't seem to read the cups-pdf.conf file which I copied in /etc/cups. This is the default location in the cups-pdf.h file for the configuration file. The files are generated in /var/spool/cups instead of /var/spool/cups-pdf/${USER}.
  3. echo "Test" | lpr -P Cups-PDF generates a text file not a pdf file. When I print the http://localhost:631/printers/Cups-PDF?which_jobs=all page in FireFox, then it works fine, a file is generated in the /var/spool/cups folder and if I set it's extension to pdf it opens almost ok. When I open it on Windows with Acrobat Reader, it shows an error: the font 'DSXFCQ+ NimbusSansL' contains a bad /BBox.

What am I doing wrong? I also checked the security permissions on files and they seem ok. All the print commands that I tried were ran using root.

Thanks

Just an update: I checked messages and I still get this:

Jan  8 18:17:58 computer setroubleshoot: failed to retrieve rpm info for /usr/lib/cups/backend/cups-pdf
Jan  8 18:17:58 computer setroubleshoot: SELinux is preventing /usr/lib/cups/backend/cups-pdf from remove_name access on the directory cups2pdf-3920. For complete SELinux messages. run sealert -l 497551b3-64a7-466e-8f91-1b8b3dff4884
Jan  8 18:17:58 computer python: SELinux is preventing /usr/lib/cups/backend/cups-pdf from remove_name access on the directory cups2pdf-3920.

*****  Plugin catchall (100. confidence) suggests   **************************

If you believe that cups-pdf should be allowed remove_name access on the cups2pdf-3920 directory by default.
Then you should report this as a bug.
You can generate a local policy module to allow this access.
Do
allow this access for now by executing:
# grep cups-pdf /var/log/audit/audit.log | audit2allow -M mypol
# semodule -i mypol.pp

Another update: After I followed the suggestion from this last log message it started working properly.

2
  • if it started working properly, I suggest you answer your own question. If others have something to add, they will answer too. Jan 9, 2016 at 3:41
  • Yes, I followed your advice, however, I am not 100% happy. I can't exactly explain what happened. Even I originally set SELinux to Permissive mode I still got that message. Does it make sense? I find this stuff finicky. Maybe I don't understand what Permissive implies. That's a possibility too.
    – boggy
    Jan 9, 2016 at 22:04

1 Answer 1

0

The issue seemed to be related to SELinux. After granting the remove_name access as per the second update in my message it started working.

In case someone else needs it here is the te file that I used to configure SELinux for cups-pdf. It is based on one of the links off of the product page: http://cups-pdf.de/documentation.shtml.

module cups_pdf 3.0beta2;

require {
    class dir { add_name create getattr remove_name search setattr write };
    class file { create getattr read setattr unlink write open};

    type cupsd_t;
    type home_root_t;
    type user_home_dir_t;
    type user_home_t;
    type print_spool_t;
    type unconfined_home_dir_t;
    type unconfined_home_t;
    type var_spool_t;
}

allow cupsd_t home_root_t:dir { getattr search };

allow cupsd_t user_home_dir_t:dir { getattr search };
allow cupsd_t user_home_t:dir { add_name create getattr remove_name search setattr write };
allow cupsd_t user_home_t:file { create getattr open read setattr unlink write };

allow cupsd_t unconfined_home_dir_t:dir { getattr search };
allow cupsd_t unconfined_home_t:dir { add_name create getattr remove_name search setattr write };
allow cupsd_t unconfined_home_t:file { create getattr open read setattr unlink write };

allow cupsd_t var_spool_t:dir { add_name create getattr remove_name search setattr write  };
allow cupsd_t var_spool_t:file { create getattr open read setattr unlink write };

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .