turn find-owner into root daemon so we can open control files
[safeq] / doc / cups-pdf.txt
1 We are using cups-pdf to create printer which is shared on windows using ipp.
2
3 Since we are not getting users from windows in our setup, we need cups-pdf
4 PostProcessing hook to look find user from pGinaSessions.
5
6
7 sudo vi /etc/cups/cups-pdf.conf
8
9 PostProcessing /srv/safeq/cups-pdf-find-owner.sh
10
11
12
13 To make this work, you also have to edit apparmor:
14
15 sudo vi /etc/apparmor.d/usr.sbin.cupsd
16
17 edit end of file, under /usr/lib/cups/backend/cups-pdf {
18 add permission for script execution:
19 ...
20   /var/spool/cups/** r,
21   /var/spool/cups-pdf/** rw,
22
23   # safeq ffzg -- added to allow execution of PostProcessing
24   /srv/safeq/cups-pdf-find-owner.sh uxr,
25 }
26
27
28
29 Replace apparmor roule with updated:
30
31 apparmor_parser -r /etc/apparmor.d/usr.sbin.cupsd
32
33 Or reload all roules:
34
35 /etc/init.d/apparmor restart
36
37
38
39 This script will use bash to trigger socket connection with params to
40 real implementation which has to wait for a while for cups control file
41 to appear since we need it to extract IP address of client machine.
42 Another problem is that PostProcessing directive is run as nobody
43 and we need root permissions to read control files, so we need to run
44 daemon part via sudo:
45
46 sudo ./cups-pdf-find-owner.pl
47
48 (since suidperl is no longer a thing)
49