[cups] cupsd(8) and all jobs ended up as from user 'anonymous'

Matthias Apitz guru at unixarea.de
Wed May 15 22:30:23 PDT 2019


El día lunes, mayo 13, 2019 a las 12:39:23p. m. +0200, Matthias Apitz escribió:

> No, it does not work with usernames like 'cups' or 'sisis' or 'sybase' .
> The error message in the cupsd log is:
> 
> D [07/May/2019:12:59:58 +0200] Create-Job client-error-attributes-or-values-not-supported: Ung\303\274ltiger Auftragsnamenwert: \\\"job-name\\\": Bad name value \\\"(stdin)\\\" - bad control character (PWG 5100.14 section 8.1).\n
> 
> I could roll back the update to 2.3b8 and trace the complete dialog
> between lpr(1) and cupsd(8) about this. The username is read correctly
> as, for example here 'sybase':
> 
...

The problem comes from the lpr command itself: When I issue the
following command:

$ /usr/local/sisis-pap/cups2/bin/lpr -JJOBNAME -PVPDF testfile

and tracing it with strace as:

$ strace -o lpr-23b5.tr -s1024  /usr/local/sisis-pap/cups2/bin/lpr -JJOBNAME -PVPDF testfile

I can see about 'JOBNAME' in the trace output as:

$ grep JOBNAME lpr-23b5.tr
execve("/usr/local/sisis-pap/cups2/bin/lpr", ["/usr/local/sisis-pap/cups2/bin/lpr", "-JJOBNAME", "-PVPDF", "testfile"], 0x7ffd7e1a3c70 /* 51 vars */) = 0
sendto(3, "\2\0\0\5\0\0\0\4\1G\0\22attributes-charset\0\5utf-8H\0\33attributes-natural-language\0\5de-deE\0\vprinter-uri\0\35ipp://localhost/printers/VPDFB\0\24requesting-user-name\0\4cupsB\0\10job-name\0\7JOBNAME\2!\0\6copies\0\4\0\0\0\1#\0\nfinishings\0\4\0\0\0\3!\0\20job-cancel-after\0\4\0\0*0D\0\16job-hold-until\0\7no-hold!\0\fjob-priority\0\4\0\0\0002B\0\njob-sheets\0\4noneB\0\0\0\4none!\0\tnumber-up\0\4\0\0\0\1\3", 322, 0, NULL, 0) = 322
recvfrom(3, "HTTP/1.1 200 OK\r\nConnection: Keep-Alive\r\nContent-Language: de_DE\r\nContent-Length: 358\r\nContent-Type: application/ipp\r\nDate: Thu, 16 May 2019 05:17:00 GMT\r\nKeep-Alive: timeout=10\r\nAccept-Encoding: gzip, deflate, identity\r\nServer: CUPS/2.3 IPP/2.1\r\nX-Frame-Options: DENY\r\nContent-Security-Policy: frame-ancestors 'none'\r\n\r\n\2\0\0\0\0\0\0\4\1G\0\22attributes-charset\0\5utf-8H\0\33attributes-natural-language\0\5de-deA\0\16status-message\0vUng\303\274ltiger Auftragsnamenwert: \"job-name\": Bad name value \"JOBNAME\" - bad control character (PWG 5100.14 section 8.1).\5B\0\10job-name\0\7JOBNAME\2E\0\7job-uri\0\27ipp://localhost/jobs/62!\0\6job-id\0\4\0\0\0>#\0\tjob-state\0\4\0\0\0\4A\0\21job-state-message\0\0D\0\21job-state-reasons\0\fjob-incoming\3", 2048, 0, NULL, NULL) = 679

i.e. the value for job-name is sent as '\7JOBNAME\2!\0' where the \7 is the length of
'JOBNAME', but the \2 is the "bad control character" the cupsd is
complaining about. The job itself gets accepted, but the provides user-name value,
sent as '\24requesting-user-name\0\4cupsB\0 is not inserted in the job
environment and so it ends up as 'anonymous'.


-- 
Matthias Apitz, ✉ guru at unixarea.de, http://www.unixarea.de/ +49-176-38902045
Public GnuPG key: http://www.unixarea.de/key.pub
May, 9: Спаси́бо освободители! Thank you very much, Russian liberators!


More information about the cups mailing list