Bug#427559: problems with your proposal of suid root backend runner
Martin, you suggest a suid root backend to launch other CUPS
backends as root.
This is not really possible as far as I know, for several reasons :
- Your suid backend MUST be present in /usr/lib/cups/backend
for CUPS to accept to launch it. (unless you modify CUPS
heavily)
- This suid wrapper would need to obey the backend arguments
handling (man backend), and so would probably have to
autodetect existing backends, the way PyKota, Tea4CUPS, or
Jasmine do. As an alternative you could do as accsnmp does,
(no autodetection) and rely to the end user to manually
specify the Device URIs.
So your suid wrapper would have to output, for example, a list
of Device uris like : yourwrapper://cups-pdf:// for each backend
in /usr/lib/cups/backend/ otherwise you wouldn't have any way
to tell your wrapper which real backend to run (the number and
value of a backend's arguments is fixed and defined in CUPS'
documentation).
- There's a 30 seconds timeout during the launch of a backend
in autodetection mode. When a lot of backends exist in
/usr/lib/cups/backend, this may not be sufficient to
autodetect them all (let's say cupspykota://tea4cups://ipp://
and the like, and the other way around tea4cups://cupspykota://ipp//
and for each backend).
the easiest way was certainely to
chown root.root mybackend
chmod 700 mybackend
as specified in CUPS' documentation.
don't forget that many CUPS backends are written in scripting languages,
and won't support being suid root.
hoping this helps the discussion
bye
Jerome Alet
Reply to: