You are not logged in.

#1 2013-02-07 17:44:58

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Why the different permissions for /dev/sr0 and /dev/cdrom ?

Why are /dev/sr0 permissions set to "root" and "optical" while /dev/cdrom are "root" and "root" ?  Why the greater restrictions on /dev/cdrom ?

Offline

#2 2013-02-07 17:46:44

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Why the different permissions for /dev/sr0 and /dev/cdrom ?

/dev/cdrom should be a symlink to /dev/sr0


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#3 2013-02-07 17:58:49

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: Why the different permissions for /dev/sr0 and /dev/cdrom ?

It is a symlink:

$ ls -l /dev/sr0
brw-rw----+ 1 root optical 11, 0 Feb  7 11:40 /dev/sr0
$ ls -l /dev/cdrom 
lrwxrwxrwx 1 root root 3 Feb  7 11:40 /dev/cdrom -> sr0

just different permissions.

Offline

#4 2013-02-07 18:04:36

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Why the different permissions for /dev/sr0 and /dev/cdrom ?

Umm yeah, because it's a link to another file so when an application reads the symlimk it's actually reading /dev/sr0 including it's permissions.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#5 2013-02-07 18:09:31

cjpembo
Member
Registered: 2008-08-06
Posts: 105

Re: Why the different permissions for /dev/sr0 and /dev/cdrom ?

Ok.  I wasn't sure that /dev/cdrom would simply inherit the /dev/sr0 permissions: I mistakenly thought that you could make a link and set different permissions on the link.

Thanks.

Offline

#6 2013-02-07 18:44:08

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Why the different permissions for /dev/sr0 and /dev/cdrom ?

Well I guess you could use chgrp on a symlink, but only to protect the symlink itself which is pointless here as it's root:root anyway, and why wouldn't you just use root:root on symlinks you don't want users to tamper with?  If you do manage to think of an occasion where you need to change the ownership of symlinks you could use chgrp...

EDIT/ Doh even that is useless as you can't really protect symlinks as AFAIK permission will be set by parent directory...

Also, if the /dev/cdrom symlink did manage to disappear it would just be recreated on the next boot by systemd/udev!

Last edited by Meyithi (2013-02-07 19:02:00)


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

Board footer

Powered by FluxBB