Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
USB Cdrom only as root [solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Sun Dec 12, 2021 2:46 pm    Post subject: USB Cdrom only as root [solved] Reply with quote

Hi folks:

I have a usb cdrw I can't access as user, only as root. I added myself to all the groups I can think of thusly:

Code:
gid=100(users) groups=100(users),6(disk),10(wheel),18(audio),19(cdrom),27(video),35(games),97(input),250(portage),272(plugdev)


And the dialog "Failed to initialize cdrom" went away when starting Grip. But it still only works as root.

Root gets:

Code:


grip -v &
[1] 26801
bartali /home/jesnow # Using config file [.grip]
Drive status is 4
Checking for a new disc
Drive status is 4
Drive status is 4
CDStat found a disc, checking tracks
We have a valid disc!


Whereas user gets:

Code:


jesnow@bartali ~ $ grip -v &
[1] 26615
jesnow@bartali ~ $ Using config file [.grip]
Drive status is -1
Drive doesn't support drive status check (assume CDS_NO_INFO)
Checking for a new disc
Drive status is -1
Drive doesn't support drive status check (assume CDS_NO_INFO)
CDStat said no disc
Checking for a new disc
Drive status is -1



Soooo. I strongly suspect udev, but that is so opaque I have to call for help. Why can't they make the udev default settings just a little looser?

How can I give myself access to my cdrom?

Thanks,
Jon.


Last edited by jesnow on Fri Dec 31, 2021 5:34 pm; edited 1 time in total
Back to top
View user's profile Send private message
Telemin
l33t
l33t


Joined: 25 Aug 2005
Posts: 753
Location: Glasgow, UK

PostPosted: Sun Dec 12, 2021 3:43 pm    Post subject: Reply with quote

Have you also added yourself to the usb group?

I agree the hardware permissions system is a bit opaque but it's a hard problem to solve, hence the existence of projects like polkit, sudo etc.
_________________
The Geek formerly known as -Freestyling-
When you feel your problem has been solved please add [Solved] to the topic title.
Please adopt an unanswered post
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sun Dec 12, 2021 4:01 pm    Post subject: Reply with quote

jesnow,

Being in the disk group is a bad thing.
If your normal user needs raw access to block devices, bypassing filesystem permissions control you need to look at a different way to do it.

A normal user with membership of the disk group can read /etc/shadow and drop all your password hashes through johntheripper.
How to do that is left as an exercise for the reader. :)

To write to optical media, you need to be in the cdrw group too.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Sun Dec 19, 2021 9:29 pm    Post subject: Reply with quote

Hi Neddy:

It's a little moot since I as user am the only user. But it's true that I as user should not have the powers I as root do, that's the whole point of not doing everything as root. It's interesting that "groups" as user is giving me different output than grep jesnow /etc/group.

Code:

bartali /home/jesnow/garb # grep jesnow /etc/group
disk:x:6:root,adm,jesnow
wheel:x:10:root,jesnow
audio:x:18:jesnow,root,sasnow
cdrom:x:19:jesnow
video:x:27:root,jesnow,sasnow,motion
cdrw:x:80:jesnow
usb:x:85:jesnow
input:x:97:jesnow
portage:x:250:portage,jesnow
games:x:35:jesnow
jesnow:x:1001:
plugdev:x:272:usbmux,jesnow
bartali /home/jesnow/garb # exit
exit
jesnow@bartali ~/garb $ groups
disk wheel audio cdrom video games input users portage plugdev
jesnow@bartali ~/garb $



Interestingly "groups" jesnow" as root gives the correct result.

In the end all I want to do is rip some cd's, this is not rocket science. I feel like the problem is probably in udisks2 somewhere.

Cheers,
Jon.

NeddySeagoon wrote:
jesnow,

Being in the disk group is a bad thing.
If your normal user needs raw access to block devices, bypassing filesystem permissions control you need to look at a different way to do it.

A normal user with membership of the disk group can read /etc/shadow and drop all your password hashes through johntheripper.
How to do that is left as an exercise for the reader. :)

To write to optical media, you need to be in the cdrw group too.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 54028
Location: 56N 3W

PostPosted: Sun Dec 19, 2021 9:40 pm    Post subject: Reply with quote

jesnow,

Are you in a group (cdrom) that points to the /dev/sgX ttat is the CDROM.

CDROMs have a block device, /dev/srX and a character device /dev/sgY.

As there is no filesystem on a CDDA ROM, it is read using block lists and commands are set to the drive over the character device.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
jesnow
l33t
l33t


Joined: 26 Apr 2006
Posts: 856

PostPosted: Mon Dec 20, 2021 4:44 am    Post subject: Reply with quote

That was it. Many thanks. I think I already posted my eternal gratitude, so I will delete the duplicate if it appears
cheers,
Jon.

NeddySeagoon wrote:
jesnow,

Are you in a group (cdrom) that points to the /dev/sgX ttat is the CDROM.

CDROMs have a block device, /dev/srX and a character device /dev/sgY.

As there is no filesystem on a CDDA ROM, it is read using block lists and commands are set to the drive over the character device.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum