Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 461456 - media-gfx/sane-backends: udev rule 41-libsane.rules uses group "scanner" for all-in-one printer
Summary: media-gfx/sane-backends: udev rule 41-libsane.rules uses group "scanner" for ...
Status: RESOLVED DUPLICATE of bug 462346
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal minor (vote)
Assignee: Patrick Kursawe (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-11 21:00 UTC by Jan Essert
Modified: 2013-03-24 13:54 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Essert 2013-03-11 21:00:10 UTC
My USB printer (Canon Pixma MP560) is a scanner as well.
Since one of the last udev upgrades (don't known which, exactly, sorry), the corresponding /dev/bus/usb device is generated as

crw-rw-r--+ 1 root scanner

instead of (presumably) belonging to the lp group.
This breaks printing, the cups web interface shows "waiting for printer to become available".
As soon as I do a chmod 666, the printer works.

Reproducible: Always




Portage 2.1.11.55 (default/linux/amd64/13.0/desktop, gcc-4.7.2, glibc-2.16.0, 3.8.2-gentoo x86_64)
=================================================================
System uname: Linux-3.8.2-gentoo-x86_64-Intel-R-_Core-TM-2_Duo_CPU_E6750_@_2.66GHz-with-gentoo-2.2
KiB Mem:     4046960 total,    715492 free
KiB Swap:    8256616 total,   8187220 free
Timestamp of tree: Mon, 11 Mar 2013 19:45:01 +0000
ld GNU ld (GNU Binutils) 2.23.1
ccache version 3.1.9 [enabled]
app-shells/bash:          4.2_p45
dev-java/java-config:     2.1.12-r1
dev-lang/python:          2.6.8-r1, 2.7.3-r3, 3.2.3-r2
dev-util/ccache:          3.1.9
dev-util/cmake:           2.8.10.2-r1
dev-util/pkgconfig:       0.28
sys-apps/baselayout:      2.2
sys-apps/openrc:          0.11.8
sys-apps/sandbox:         2.6
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.9.6-r3, 1.11.6, 1.13.1
sys-devel/binutils:       2.23.1
sys-devel/gcc:            4.6.3, 4.7.2-r1
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.8 (virtual/os-headers)
sys-libs/glibc:           2.16.0
Repositories: gentoo zugaina amielke-overlay aidecoe sunrise sabayon systemd steam-overlay Jans_lokales_Overlay
Installed sets: @fenics
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-10.3 skype-4.0.0.7-copyright"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/polkit-1/actions /usr/share/themes/oxygen-gtk/gtk-2.0 /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php5.4/ext-active/ /etc/php/cgi-php5.4/ext-active/ /etc/php/cli-php5.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -mtune=native -O2 -fomit-frame-pointer -pipe -ggdb -floop-interchange -floop-strip-mine -floop-block"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --quiet-build y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch protect-owned sandbox sfperms splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="de_DE.utf8"
LDFLAGS="-Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/zugaina /var/lib/layman/amielke-overlay /var/lib/layman/aidecoe /var/lib/layman/sunrise /var/lib/layman/sabayon /var/lib/layman/systemd /var/lib/layman/steam /usr/local/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa amd64 avahi berkdb branding bzip2 cairo cdda cdr cli cracklib crypt css cups cxx dbus dirac djvu dri dts dvb dvd dvdr emboss encode exif fam firefox flac fortran gdbm gif gstreamer handbook hbci iconv imap ipod ipv6 jpeg jpeg2k kde kdehiddenvisibility kipi latex lcms libnotify lzma mad matroska metis mmx mng modules mp3 mp4 mpeg mpi mtp mudflap multilib musepack ncurses nls nptl ogg openexr opengl openmp opus pam pango pch pcre pdf png policykit pop ppds pulseaudio qt3support qt4 readline romio samba schroedinger sdl semantic-desktop session smtp speex spell sse sse2 sse3 ssl ssse3 startup-notification svg systemd tcpd theora threads tiff truetype udev udisks unicode upower usb v4l v4l2 vcd vim-syntax vorbis vpx wxwidgets x264 xattr xcb xcomposite xft xml xv xvid zeroconf zlib" ABI_X86="64" ALSA_CARDS="ice1712" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump" CAMERAS="directory ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" DRACUT_MODULES="mdraid" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ubx" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="de en" LIRC_DEVICES="devinput" PHP_TARGETS="php5-3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_2" QEMU_SOFTMMU_TARGETS="x86_64" RUBY_TARGETS="ruby18 ruby19" SANE_BACKENDS="pixma" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 1 Samuli Suominen (RETIRED) gentoo-dev 2013-03-12 22:14:54 UTC
The file /lib/udev/rules.d/41-libsane.rules is coming from media-gfx/sane-backends and media-gfx/sane-backends ebuild is creating group "scanner" to which you are supposed to add yourself
With this all-in-one device I'm not sure if this is even a bug, but reassigning to sane-backends maintainers for review
Comment 2 Samuli Suominen (RETIRED) gentoo-dev 2013-03-12 22:15:51 UTC
As in, sys-fs/udev is not responsible for rules shipped from other packages
Comment 3 Patrick Kursawe (RETIRED) gentoo-dev 2013-03-14 20:07:39 UTC
Well... is there any chance to deal with this problem by using ACLs? I think giving access to anybody could be a problem for some users. Suggestions are welcome.
Comment 4 Jan Essert 2013-03-14 21:55:08 UTC
Actually, I would not mind if the printer was in the 'scanner' group, and cups would still print to it.

Does anybody know how to achieve this?

cups is configured to print from the network, so the user using the printer does not actually exist on the system.

Of course, I can always hack the 41-libsane.rules locally, all local users are allowed to print and to scan anyway, but maybe the other solution would be helpful to others.
Comment 5 Samuli Suominen (RETIRED) gentoo-dev 2013-03-15 08:26:35 UTC
(In reply to comment #3)
> Well... is there any chance to deal with this problem by using ACLs? I think
> giving access to anybody could be a problem for some users. Suggestions are
> welcome.

If use has sys-auth/consolekit installed the file /lib/udev/rules.d/70-udev-acl.rules is put in place, and if the user is local and
`ck-list-sessions` says the user is 'active = TRUE' then the elevated ACL gets used from the 70-udev-acl.rules, for example, ALSA works without being in audio group

I suppose it wouldn't be too hard to copy relavent lp/scanner line from 50-default-udev.rules over to 70-udev-acl.rules and making it work... So scanner and lp could always be used when CK sees the user as default

Just my 2 cents. Good luck!
Comment 6 Samuli Suominen (RETIRED) gentoo-dev 2013-03-19 12:07:30 UTC
(In reply to comment #0)
> crw-rw-r--+ 1 root scanner

That + in the end implies it has ACL, and I noticed this in /lib/udev/rules.d/70-udev-acl.rules from sys-auth/consolekit[acl]:

# SCSI and USB scanners
ENV{libsane_matched}=="yes", TAG+="udev-acl"

That propably added the + there and all local users should be able to use the device, even without being in scanner group, long as ConsoleKit is working correctly (and your user is listed as 'active = TRUE' by ck-list-sessions)
Comment 7 Samuli Suominen (RETIRED) gentoo-dev 2013-03-19 18:25:03 UTC
Reporter:

Please look at bug and the patch in:

https://bugs.gentoo.org/show_bug.cgi?id=462346#c1

Let me know if that restores the behavior it had with 197 and earlier and the group "lp" comes back as main handler of this node

If so, this can be duplicated to that bug as it's one and the same issue
Comment 8 Samuli Suominen (RETIRED) gentoo-dev 2013-03-20 05:43:30 UTC
Try udev-198-r2 (or 9999)
Comment 9 Jan Essert 2013-03-24 12:55:41 UTC
Sorry, I could not test this, as I was away.
But thank you, this has indeed fixed the problem.
Comment 10 Samuli Suominen (RETIRED) gentoo-dev 2013-03-24 13:53:30 UTC

*** This bug has been marked as a duplicate of bug 462346 ***
Comment 11 Samuli Suominen (RETIRED) gentoo-dev 2013-03-24 13:54:24 UTC
(In reply to comment #9)
> Sorry, I could not test this, as I was away.
> But thank you, this has indeed fixed the problem.

no problem. thank you for testing, and I was indeed "wrong", the problem was in udev, not sane's udev rules.
sorry about that. :)