You are not logged in.

#1 2014-04-17 13:13:09

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Cups and permissions problem.

Hi guys, i'm facing a strange issue with a new arch installation.
Usb printers aren't recognized by cups unless i give the device file (/dev/bus/usb/something/something) property to the user "daemon".
I wrote an udev rule to do that everytime the printer is connected, and now it works, but i'm still curious to understand why it happens.
By default, the device file is created by udev, owned by root and with group lp with "correct" read and write permissions, and since the "daemon" user is in the lp group, i'd expect it to work, but it is not.

#grep daemon /etc/passwd /etc/group
/etc/passwd:daemon:x:2:2:daemon:/sbin:/bin/false      #<-- user daemon exists
/etc/passwd:git:x:999:999:git daemon user:/:/bin/bash
/etc/group:bin:x:1:root,bin,daemon
/etc/group:daemon:x:2:root,bin,daemon
/etc/group:adm:x:4:root,daemon
/etc/group:lp:x:7:daemon                          #<-- user daemon is in the lp group!

It seems that when "daemon" try to access the device file, it is denied, unless it is in the lp group which, in turn, has read and write access to the device file.

Is there some test i can do to investigate the issue deeper?

Thanks for reading.

Last edited by kokoko3k (2014-04-17 13:34:25)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#2 2014-04-25 09:00:55

develop
Member
Registered: 2014-04-25
Posts: 14

Re: Cups and permissions problem.

Well, Arch is not Ubutu-based => you will have to work little bit harder to get things working the way you want here......

Offline

#3 2014-04-25 12:34:03

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: Cups and permissions problem.

Eh?


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#4 2014-04-25 14:50:23

\hbar
Member
Registered: 2014-03-15
Posts: 165

Re: Cups and permissions problem.

Strange... Did you logout/login since you added daemon to the lp group? Can you show us the permissions on the file (the line you get when running ls -l /dev/bus/usb/something/something (after having deactivated the udev rule)).

Offline

#5 2014-04-28 06:27:23

kokoko3k
Member
Registered: 2008-11-14
Posts: 2,393

Re: Cups and permissions problem.

Sorry for the late reply,
Yes i did logout and reboot the machine several times during my tries.
Device file permissions are "crw-rw-r-- 1 root lp" without the rule
and becomes "crw-rw-r-- 1 daemon lp" after applying it.

Last edited by kokoko3k (2014-04-28 06:27:53)


Help me to improve ssh-rdp !
Retroarch User? Try my koko-aio shader !

Offline

#6 2014-04-28 10:13:00

Lone_Wolf
Member
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,911

Re: Cups and permissions problem.

breaking down the output :

c :   character device
permissions
owner : rw-
group: rw-
other : r--
Links : 1

the permissions for owner and group members are the same at filesystem-level .
that indicates another mechanism then file permissions causes this.
My guess was capabilities https://wiki.archlinux.org/index.php/Capabilities , but they only seem to apply to regular files, not devices.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

Board footer

Powered by FluxBB