LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   permissions on dvb card (https://www.linuxquestions.org/questions/fedora-35/permissions-on-dvb-card-432770/)

kudos 04-07-2006 02:39 PM

permissions on dvb card
 
Hi there

i am trying to get my DVB cards setup under FC5

i have them seen and they are working, now i just need to get the permissions set correct on the device.

right now root owns the device under /dev/dvb
as shown by
drwxr-xr-x 4 root root 80 Apr 7 20:07 dvb

how do i go about chanigng this so that my normal user (mythtv) can access this, if i change group any one could access that was a member of that group right? say group called video


i dove into udev file 50-udev.rules

i have changed the line
Quote:

# DVB
KERNEL=="dvb", MODE="0666"
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", \
NAME="%c", MODE="0660"
to
Quote:

# DVB
KERNEL=="dvb", GROUP="video", MODE="0666"
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", \
NAME="%c", MODE="0660"
but i still get /dev/dvb shown as being own by root etc
drwxr-xr-x 4 root root 80 Apr 7 20:07 dvb


what else can i change or have done wrong?
any help would be grate

many thanks
Rob

charlweed 11-04-2006 10:38 AM

Same here.
 
Hi kudos, have you fixed this yet?
This is driving me nuts. How much more arcane linux black magic do I have to grok before I can use mythtv?

Anyway, like you, I tried merely inserting GROUP="mythtv" but the devices under /dev/dvb/adapter0 were all still crw-------

I figured that the existing code was not actually selecting under adapter0, so I tried
# DVB
KERNEL=="dvb/*", GROUP="mythtv", MODE="0660"
KERNEL=="dvb/adapter*", GROUP="mythtv", MODE="0660"
KERNEL=="dvb/adapter*/*", GROUP="mythtv", MODE="0660"
KERNEL=="dvb/adapter0/*", GROUP="mythtv", MODE="0660"
KERNEL=="dvb", GROUP="mythtv",MODE="0660"
SUBSYSTEM=="dvb", PROGRAM="/bin/sh -c 'K=%k; K=$${K#dvb}; printf dvb/adapter%%i/%%s $${K%%%%.*} $${K#*.}'", \
NAME="%c",GROUP="mythtv", MODE="0660"

but that did not work either.

I'm going to try putting the GROUP code after the PROGRAM code, but I am not optimistic.

Is there any way to know what the final value of PROGRAM is? Maybe that is the place to insert logic to change permissions.

charlweed 11-04-2006 05:11 PM

Y.m.b.m.
 
Exactly as I feared, yes, I had to learn Yet More Black Magic.
All the docs on udev, including the web tutorial, the man pages and the release notes etc. in /usr/share/doc/udev-084/ are not applicable.
The problem is that FC5 makes all the group and permission entries in udev/rules.d useless, because after every match is done, it runs pam_console_apply on the newly created devices.
pam_console_apply explicitly sets the permissions on each device as defined by the files

"/etc/security/console.perms"
and everything in
"/etc/security/console.perms.d/*"
Low numbered (lexically sorted) files have precedence.



SO, a fix is to create a file
"/etc/security/console.perms.d/10-local.perms"

And insert the following lines:


#This text tells pam_console_apply to
#make the the /dev/dvb device, and all
#its subsystems, to be owned by
#user root, and group mythtv. User and
#group have read-write access, and others
# have no access.

# device classes -- these are shell-style globs
<dvb>=/dev/dvb* \
/dev/dvb/* \
/dev/dvb/adapter*/*

# permission definitions
<console> 0660 <dvb> 0660 root.mythtv
<xconsole> 0660 <dvb> 0660 root.mythtv



You can replace “mythtv” above with the group that you want. I found that I also needed the <xconsole> login expression.
This is a configuration bug apparently only in FC5.

Oh, for future readers, here is how to test udev rules for mythtv devices. It's all the stuff under /sys/class/dvb/*, WITHOUT the "/sys". Try

udevtest /class/dvb/dvb0.demux0
udevtest /class/dvb/dvb0.dvr0
udevtest /class/dvb/dvb0.frontend0
udevtest /class/dvb/dvb0.net0

where the "0" suffix is whatever you actully find in
/sys/class/dvb/dvb*

Good luck!

riskboy 11-05-2006 10:47 AM

I was suffering exactly the same issue with FC6 (ahead of getting MythTV to work). I couldn't get your 10-local.perms solution to work myself.

In the end, I resorted to editing the /etc/security/console.perms.d/50-default.perms file and changing the entry containing "<dvb>" to the value I required. i.e.:

<console> 0600 <dvb> 0660 root.mythtv

That appears to have worked.

However, I have to give thanks to you because there's no way I would have found the location of the appropriate files. I too had been pulling my hair out wondering why the udev docs were getting me nowhere!

ewest02 12-09-2006 10:10 PM

permissions on udev devices in general
 
Quote:

Originally Posted by riskboy
In the end, I resorted to editing the /etc/security/console.perms.d/50-default.perms file and changing the entry containing "<dvb>" to the value I required. i.e.:

<console> 0600 <dvb> 0660 root.mythtv

That appears to have worked.

However, I have to give thanks to you because there's no way I would have found the location of the appropriate files. I too had been pulling my hair out wondering why the udev docs were getting me nowhere!

Yes indeed! I too was facing much angst and hair loss. I could not get udev configured to create sound devices with group "audio". No way, no how. However once I modified the 50-default.perms file the devices were created with perms 0660 and group "audio". Hurray!

...sheesh. Got to love those subsystem interactions. No wonder that linux has not become an OS for the masses.

--Eric


All times are GMT -5. The time now is 12:26 AM.