Bug 53702 - support cups-pdf scheme printers without destination
support cups-pdf scheme printers without destination
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: UMC - Printers
UCS 5.0
Other Linux
: P5 normal (vote)
: UCS 5.0-0-errata
Assigned To: Florian Best
Felix Botner
:
: 24070 (view as bug list)
Depends on: 53598
Blocks:
  Show dependency treegraph
 
Reported: 2021-08-24 15:38 CEST by Florian Best
Modified: 2021-09-15 17:41 CEST (History)
2 users (show)

See Also:
What kind of report is it?: Development Internal
What type of bug is this?: 5: Major Usability: Impairs usability in key scenarios
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Florian Best univentionstaff 2021-08-24 15:38:33 CEST
UDM has to support a printer uri with empty destination for `cups-pdf` scheme printers.

+++ This bug was initially created as a clone of Bug #53598 +++

current setup creates a PDFDrucker like this

DN: cn=PDFDrucker,cn=printers,dc=five,dc=local
  ACLtype: allow all
  description: Moderierter PDF-Drucker
  location: None
  model: None
  name: PDFDrucker
  producer: cn=misc,cn=cups,cn=univention,dc=five,dc=local
  sambaName: None
  spoolHost: master.five.local
  uri: cups-pdf:/ .

with this, only one job is stored in "/var/spool/cups-pdf/%U" 

-> lp -d PDFDrucker /etc/fstab # (4x)
-> find
/var/spool/cups-pdf/Administrator/fstab__ol_cups-pdf_root.pdf

and it is an empty pdf

with this setup (model, uri!)

DN: cn=PDFDrucker,cn=printers,dc=five,dc=local
  ACLtype: allow all
  description: Moderierter PDF-Drucker
  location: None    
  model: cups-pdf/CUPS-PDF_noopt.ppd
  name: PDFDrucker
  producer: cn=PDF,cn=cups,cn=univention,dc=five,dc=local  
  sambaName: None     
  spoolHost: master.five.local
  uri: None

it works

-> lp -d PDFDrucker /etc/fstab # (4x)
-> find
find /var/spool/cups-pdf/Administrator/
/var/spool/cups-pdf/Administrator/
/var/spool/cups-pdf/Administrator/job_39-fstab__ol_cups-pdf_Administrator.pdf
/var/spool/cups-pdf/Administrator/job_37-fstab__ol_cups-pdf_Administrator.pdf
/var/spool/cups-pdf/Administrator/job_38-fstab__ol_cups-pdf_Administrator.pdf
/var/spool/cups-pdf/Administrator/job_36-fstab__ol_cups-pdf_Administrator.pdf

so probably 99ucs-school-umc-printermoderation.inst has to be modified (installation, update)
Comment 1 Florian Best univentionstaff 2021-08-24 16:05:55 CEST
fixed so far:

univention-directory-manager-modules.yaml
131f19cf6f50 | YAML Bug #53702

univention-directory-manager-modules (15.0.11-19)
27132afb2c74 | Bug #53702: support cups-pdf scheme printers without destination
Comment 2 Felix Botner univentionstaff 2021-08-24 16:11:57 CEST
another problem

if you have a printer like this

dn: cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new
cn: PDFDrucker
description: Moderierter PDF-Drucker
univentionPrinterSpoolHost: slave.five.new
univentionPrinterACLtype: allow all
objectClass: top
objectClass: univentionObject
objectClass: univentionPrinter
univentionObjectType: shares/printer
univentionPrinterModel: cups-pdf/CUPS-PDF_noopt.ppd
univentionPrinterURI: cups-pdf:/.

changing the uri with udm seems to be broken

-> udm shares/printer modify --dn "cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new" --set 'uri="cups-pdf:/" ""'

instead we end up with

dn: cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new
cn: PDFDrucker
description: Moderierter PDF-Drucker
univentionPrinterSpoolHost: slave.five.new
univentionPrinterACLtype: allow all
objectClass: top
objectClass: univentionObject
objectClass: univentionPrinter
univentionObjectType: shares/printer
univentionPrinterModel: cups-pdf/CUPS-PDF_noopt.ppd
univentionPrinterURI: cups-pdf:/.
univentionPrinterURI: cups-pdf:/
Comment 3 Florian Best univentionstaff 2021-08-24 22:21:46 CEST
Are you sure?
I cannot reproduce this.
Can you give me access to the system / IP.
Comment 4 Felix Botner univentionstaff 2021-08-24 23:31:31 CEST
(In reply to Florian Best from comment #3)
> Are you sure?
> I cannot reproduce this.
> Can you give me access to the system / IP.

10.200.7.124 (school slave), 10.200.7.123 master
Comment 5 Florian Best univentionstaff 2021-08-25 00:48:45 CEST
OK, the problem exists only on a DC Slave. Maybe related to the LDAP ACL's.
Comment 6 Florian Best univentionstaff 2021-08-25 01:05:21 CEST
(In reply to Florian Best from comment #5)
> OK, the problem exists only on a DC Slave. Maybe related to the LDAP ACL's.

Yes, the problem is that the settings/printeruri object is not replicated to the DC slave.
Therefor unmapping of the value fails (it returns):

>>> univention.admin.handlers.shares.printer.unmapPrinterURI(['cups-pdf:/.'])
('', '')

and if one modifies the value, the modlist contains a add instruction instead of a replace:

(Pdb) ml
[('univentionPrinterURI', b'', b'cups-pdf:/')]

See also Bug #20255, Bug #24070.
Comment 7 Florian Best univentionstaff 2021-08-25 10:05:16 CEST
This problem will be fixed in UCS@school at Bug #53598.
Comment 8 Felix Botner univentionstaff 2021-08-25 10:17:58 CEST
OK - yaml
OK - univention-directory-manager-modules - PrinterURI

LDAP:

# PDFDrucker, printers, school1, five.new
dn: cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new
univentionPrinterURI: cups-pdf:/


old udm
DN: cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new
  uri: None

fixed udm
DN: cn=PDFDrucker,cn=printers,ou=school1,dc=five,dc=new
  uri: cups-pdf:/


-> udm shares/printer create --set name=myprinter --set model=cups-pdf/CUPS-PDF_noopt.ppd --set spoolHost=slave.five.new --set uri="cups-pdf:/"

dn: cn=d1,cn=printers,ou=DEMOSCHOOL,dc=five,dc=new
cn: d1
univentionPrinterSpoolHost: slave.five.new
univentionPrinterURI: cups-pdf:/
univentionPrinterModel: foomatic-db-compressed-ppds:0/ppd/foomatic-ppd/Alps-MD-1000-md2k.ppd
univentionPrinterACLtype: allow all
objectClass: top
objectClass: univentionPrinter
objectClass: univentionObject
univentionObjectType: shares/printer
Comment 9 Florian Best univentionstaff 2021-08-25 10:33:53 CEST
*** Bug 24070 has been marked as a duplicate of this bug. ***