[cups.bugs] [HIGH] STR #2459: Patch to allow comment chars in password fields

Daniel M. Lambea dmlambea at gmail.com
Thu Jul 26 09:38:26 PDT 2007


DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

SMB-connected printers can have comment chars as part of the password,
which makes CUPS unable to work with these printers. Bug relates to the
comment char (currently '#') being used as part of the SMB password which
makes the rest of the line to be discarded.

Code currently exist to allow the first occurrence of that char to be
properly loaded if prepended with '\\', but it is applied to the first
occurrence only, disabling consecutive escape sequences and a possible
comment field in the trailing part of the configuration line. Combination
of the control char, '\\\\', is not being taken into account.

Workaround is to update the CUPS password field in a running cupsd, but
the bug will appear every time the server tried to load the printers.conf
file.

Attached patch allows CUPS to load lines containing comment chars,
unescaping them if prepended with '\\', and also unescaping '\\\\'
properly. Also, a cupsFilePrintfEsc() function has been added to allow
CUPS to write back the configuration file with all comment chars escaped.
The function cupsdSaveAllPrinters() is now instructed to use the escaped
version cupsFilePrintEsc().

Link: http://www.cups.org/str.php?L2459
Version: 1.2.12
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: cups-1.2.x-escape.patch.tgz
URL: <https://lists.cups.org/pipermail/cups/attachments/20070726/49726d07/attachment.ksh>


More information about the cups mailing list