Bug 151867 - detecting that the user isn't part of the cdrom group
Summary: detecting that the user isn't part of the cdrom group
Status: REPORTED
Alias: None
Product: k3b
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Debian testing Linux
: NOR wishlist
Target Milestone: ---
Assignee: k3b developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-11-04 22:09 UTC by Francois Marier
Modified: 2014-10-18 07:45 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Francois Marier 2007-11-04 22:09:54 UTC
Version:           1.0.4 (using KDE KDE 3.5.8)
Installed from:    Debian testing/unstable Packages
OS:                Linux

Hi Sebastian,

On Debian, users who want to be able to burn CDs or DVDs must be part of the "cdrom" group since this is the group which owns the appropriate devices.  I'm sure there are distros that do similar things.

Would it be possible to add a check in K3b that would verify that the user has the right to read and write on the device file and suggest a missing group when that's not the case?

The strings could me modified by each distro of course, but the basic check would be there.

Francois

(also filed as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=401057)
Comment 1 Sebastian Trueg 2007-11-05 09:02:10 UTC
I have no idea how K3b should be able to detect which group is the "CD" group. 
So I don't think this is feasible.
Comment 2 Francois Marier 2007-11-05 10:55:05 UTC
How about looking up the group of the CD/DVD device and then checking that the user is part of that group?

  $ ls -l /dev/hdb | cut -d' ' -f4
  cdrom

  $ groups username
  username : username dialout cdrom floppy audio src video plugdev users powerdev netdev
Comment 3 Sebastian Trueg 2007-11-05 11:02:10 UTC
And how do I know which device is the cd device? For example for me it 
is /dev/hda, /dev/sr0, /dev/sr1, and /dev/sr2 while on the laptop is 
it /dev/hdb...
Comment 4 Francois Marier 2007-11-05 11:08:59 UTC
Doesn't K3b already detect the burning device?  Or does it only get the ATAPI/SCSI  address on the bus?
Comment 5 Sebastian Trueg 2007-11-05 11:21:42 UTC
Aha. So you mean only for write permissions? Well, that k3b already does. You 
get a warning in case you do not have proper permissions for a device (that 
could be detected).
Comment 6 Francois Marier 2007-11-05 11:35:15 UTC
That's right. What I had in mind was a warning like:

"You don't have write permissions on your 'Sony CD Recorder'.  Perhaps you need to ask your system administrator to add you to the 'cdrom' group?"
Comment 7 Sebastian Trueg 2007-11-05 13:38:32 UTC
Well, K3b already warns about missing write permissions. I could check the 
group the device is in and propose to add the user to that group but there 
will be situations in which that is wrong, too...
Comment 8 Francois Marier 2007-11-05 21:39:07 UTC
True.  I don't think there's a single fix for all distros since they deal with these things differently.

It may be worth mentioning though since on some distros that's the correct way to do things.  Of course, then package maintainers can adapt the default K3b detection to suit their systems.