Bug 214925

Summary: udev ignores "MODE:="0666" in rules, sets to 0660 instead
Product: [Fedora] Fedora Reporter: charlie redditt <redcharlie>
Component: udevAssignee: Harald Hoyer <harald>
Status: CLOSED NOTABUG QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 5   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-10 05:17:01 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Description charlie redditt 2006-11-09 19:01:33 EST
Description of problem:
I can chmod 0666 /dev/hdc (my dvdburner) but udev resets to 0660 at reboot.
I need mode 0666 on my burner device so regular users can use k3b

I can set it to mode 0666 as root, but it is not persistent.

I have added the following rule to /etc/udev/rules.d/50-udev.rules
KERNEL=="hdc", MODE:="0666"

and output of udevtest /block/hdc shows following line:
create_node: creating device node '/dev/hdc', major = '22', minor = '0', mode =
'0666', uid = '0', gid = '6'

Funny thing is, I can take my rule out and udevtest /block/hdc will show it
creating  /dev/hdc as mode 0640, when in reality it is ALWAYS 0660, not 0666 nor

Version-Release number of selected component (if applicable):

How reproducible:
add a udev rule to change permission of the device for my burner
restart udev, nothing changes

chmod 666 burner
reboot, and it goes back to mode 660

Steps to Reproduce:
1. ls -l /dev/hdc # (or wherever dvdr is , should be mode 660 )
2. echo 'KERNEL=="hdc", MODE:="0666"' >> /etc/udev/rules.d/50-udev.rules
3. udevtest /block/hdc # make sure rule is okay, should show MODE = 0666
4. chmod 666 /dev/hdc #just for good measure, not necessary
5. ls -l /dev/hdc # will be mode 666 now
6. udevcontrol reload_rules
7. udevstart
Actual results:
ls -l /dev/hdc  # will be mode 660 after steps above 

Expected results:
ls -l /dev/hdc  # should be mode 666 after steps above 

Additional info:
This is just an annoyance, I need mode 666 for regular users to be able to use
k3b to burn cd's or dvd's
Comment 1 Harald Hoyer 2006-11-10 05:17:01 EST
 ":=" is wrong... "=" is correct

but... permissions are set by pam_console described in

The console user, who first logs on the console will own the device.. no need
for 0666
Comment 2 charlie redditt 2006-11-10 14:12:38 EST
from man 7 udev
 ":=     Assign a value to a key finally; disallow any later changes, 
     which may be used to prevent changes by any later rules."

lo and behold, yes, if I log in at the console, I own the drive and k3b works!

My trouble is that I almost always connect to my machine via VNC.  I suppose I
could login on a tty and leave it (rather than always running a local X server
that I'll never use).

I changed the <cdrom> line in 50-default.perm  to default to 0666 instead of
0660, and k3b works via VNC now, regardless of whether or not I'm logged in or not.