Univention Bugzilla – Bug 51196
cups-printers listener fails to create printer due to overquoting
Last modified: 2020-05-06 14:40:05 CEST
While writing a test case fo shares/printer I got this error in listener.log: ============================================================ 13.03.20 10:04:51.094 LISTENER ( WARN ) : cups-printers: info: univention-lpadmin -u 'deny:Administrator,@Printer Admins' -p sexjtrmwku -L 26nj93mq33 -m foomatic-rip/Generic-PCL_4_Printer-gutenprint-ijs-simplified.5.2.ppd -D ea2im3i3by -v parallel://11.249.129.5 -E lpadmin: Unknown allow/deny option "'deny:Administrator,@Printer Admins'". The command "/usr/sbin/lpadmin -u 'deny:Administrator,@Printer Admins' -p sexjtrmwku -L 26nj93mq33 -m foomatic-rip/Generic-PCL_4_Printer-gutenprint-ijs-simplifi ed.5.2.ppd -D ea2im3i3by -v parallel://11.249.129.5 -E -h localhost" returned 1 13.03.20 10:04:51.417 LISTENER ( ERROR ) : cups-printers: Failed to execute the univention-lpadmin command. Please check the cups state. ============================================================ The printer share was created like this: ============================================================ Creating shares/printer object with /usr/sbin/udm-test shares/printer create --position cn=printers,dc=ar41i1,dc=qa --set setQuota=0 --set ACLtype=deny --set description=ea2im3i3by --set producer=cn=Generic,cn=cups,cn=univention,dc=ar41i1,dc=qa --set ACLUsers=uid=Administrator,cn=users,dc=ar41i1,dc=qa --set sambaName=kjv9escg5k --set jobPrice=495 --set 'ACLGroups=cn=Printer Admins,cn=groups,dc=ar41i1,dc=qa' --set 'uri=parallel:// 11.249.129.5' --set location=26nj93mq33 --set spoolHost=master10.ar41i1.qa --set pagePrice=18 --set model=foomatic-rip/Generic-PCL_4_Printer-gutenprint-ijs-simplified.5.2.ppd --set name=sexjtrmwku ============================================================ My initial assessment showed that lpadmin is run via listner.run, which uses os.spawnv and shouldn't need shell quoting. On the other hand the quoting in important if the command get's run as a shell script. I'll append a patch.
Created attachment 10343 [details] patch
Reproducible: udm shares/printer create --position cn=printers,$(ucr get ldap/base) --set setQuota=0 --set ACLtype=deny --set description=ea2im3i3by --set producer=cn=Generic,cn=cups,cn=univention,$(ucr get ldap/base) --set ACLUsers=uid=Administrator,cn=users,$(ucr get ldap/base) --set sambaName=kjv9escg5k --set jobPrice=495 --set "ACLGroups=cn=Printer Admins,cn=groups,$(ucr get ldap/base)" --set 'uri=parallel:// 11.249.129.5' --set location=26nj93mq33 --set spoolHost=$(hostname -f) --set pagePrice=18 --set model=foomatic-rip/Generic-PCL_4_Printer-gutenprint-ijs-simplified.5.2.ppd --set name=foo univention-printserver (12.0.1-16) d58b10bfefe7 | Bug #51196: fix quoting error in cups-printer listener module univention-printserver.yaml 7091d23e6a08 | YAML Bug #51196 FYI: the package seems missing a dependency on univention-samba(?). It otherwise always prints into the listener.log: /usr/bin/python: No module named univention.lib.share_restrictions
Verified.
<http://errata.software-univention.de/ucs/4.4/585.html>