Hello Tim, Tim Waugh [2009-07-16 23:31 +0100]: > The requirements for this are a bit fiddly: > > * if CUPS < 1.4 is to be supported, we need to give group lp read/write > access to the usblp device node
This is provided by 50-udev-default.rules: KERNEL=="parport[0-9]*", GROUP="lp" SUBSYSTEM=="printer", KERNEL=="lp*", GROUP="lp" SUBSYSTEM=="ppdev", GROUP="lp" SUBSYSTEM=="usb", KERNEL=="lp*", NAME="usb/%k", SYMLINK+="usb%k", GROUP="lp" KERNEL=="lp[0-9]*", GROUP="lp" KERNEL=="irlpt[0-9]*", GROUP="lp" > * additionally, the HPLIP "toolbox" program seems to want direct access > to this node as well, so potentially the console user will get > read/write access as well using an ACL (although how that can work for > fast user switching without hal I'm not entirely sure) This was recently fixed in udev 145: 70-acl.rules: ENV{ID_HPLIP}=="1", ENV{ACL_MANAGE}="1" Analoguous to the old hal fdis, the hplip package now needs to ship rules like ATTRS{idVendor}=="03f0", ATTRS{idProduct}=="c302", GROUP="lp", ENV{ID_HPLIP}="1" for this to work. This was done in the Ubuntu package, but I don't know about the upstream status. Till? > * otherwise, the CUPS usb backend can use libusb so group lp needs > read/write access to the /dev/bus/usb/xxx/yyy node How to identify non-hplip USB devices which are printers and talked to via cups and libusb? Can we rely on printers setting a correct USB class (7 according to [1])? Or do they need some magic ioctls and other poking to identify them as printers? It seems to me that 50-udev-default.rules could just add a rule like SUBSYSTEMS=="usb", ATTRS{bInterfaceClass}=="07", GROUP="lp" Kay, do you think that's appropriate? How did that work in the pre-udev world? hal didn't do anything to change the group of raw USB devices. I don't think that auto ACLs are appropriate here, since cupsd isn't on a "local console" in the ConsoleKit sense, so it wouldn't get auto-ACLs. > Can udev set ACLs easily, or should that be done by the callout program? udev has support for automatic ACLs, similar to the ones that hal provided. Projects need to ship udev rules which identify particular devices (ID_GPHOTO2, ID_HPLIP, etc.) and 70-acl.rules in udev then assigns the ACL_MANAGE=1 tag (the latter is done centrally in udev just in case the implementation of ACL setting changes). Thanks, Martin [1] http://www.usb.org/developers/defined_class/#BaseClass07h -- Martin Pitt | http://www.piware.de Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
signature.asc
Description: Digital signature
_______________________________________________ devkit-devel mailing list devkit-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/devkit-devel