Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 77943 - gentoo-dev-sources-2.6.10-r4 doesn't allow non-root users to write/erase cd's with k3b
Summary: gentoo-dev-sources-2.6.10-r4 doesn't allow non-root users to write/erase cd's...
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: x86 Linux
: High normal (vote)
Assignee: Gentoo Kernel Bug Wranglers and Kernel Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-01-14 00:08 UTC by Maciej Zieba
Modified: 2005-01-27 02:59 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Maciej Zieba 2005-01-14 00:08:04 UTC
Hi,

I have gentoo-dev-sources-2.6.10-r4 kernel and k3b-0.11.18

When I run k3b as root my cd writer (LiteOn SOHR-5238S) is detected and I can write CDs without any problems. But when I run k3b as a normal (non-root) user my writer isn't detected, not even as a CD-ROM...

Mounting and reading from CDs works.

The relevant line in fstab:
/dev/cdrom    /mnt/cdrom    auto    noauto,users,ro 0 0

I haven't tried writing command line tools (cdrecord/cdrdao) but here's the output of "cdrecord dev=/dev/cdrom -checkdrive" for non-root user:


bash-2.05b$ cdrecord dev=/dev/cdrom -checkdrive
Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 J
Comment 1 Maciej Zieba 2005-01-14 00:08:04 UTC
Hi,

I have gentoo-dev-sources-2.6.10-r4 kernel and k3b-0.11.18

When I run k3b as root my cd writer (LiteOn SOHR-5238S) is detected and I can write CDs without any problems. But when I run k3b as a normal (non-root) user my writer isn't detected, not even as a CD-ROM...

Mounting and reading from CDs works.

The relevant line in fstab:
/dev/cdrom    /mnt/cdrom    auto    noauto,users,ro 0 0

I haven't tried writing command line tools (cdrecord/cdrdao) but here's the output of "cdrecord dev=/dev/cdrom -checkdrive" for non-root user:


bash-2.05b$ cdrecord dev=/dev/cdrom -checkdrive
Cdrecord-Clone 2.01 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schilling
cdrecord: Warning: Running on Linux-2.6.10-gentoo-r4
cdrecord: There are unsettled issues with Linux-2.5 and newer.
cdrecord: If you have unexpected problems, please try Linux-2.4 or Solaris.
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
cdrecord: Permission denied. Cannot open '/dev/cdrom'. Cannot open SCSI driver.
cdrecord: For possible targets try 'cdrecord -scanbus'. Make sure you are root.
cdrecord: For possible transport specifiers try 'cdrecord dev=help'.


I didn't have this problem with 2.6.9 kernels...

Please let me know if there are any other details needed.

Regards,
Crocodil

Reproducible: Always
Steps to Reproduce:
1.
2.
3.
Comment 2 Daniel Drake (RETIRED) gentoo-dev 2005-01-14 00:31:33 UTC
Please check that you have write permissions to /dev/cdrom
Comment 3 Maciej Zieba 2005-01-14 01:28:06 UTC
Hi,

This is how it was:

bash-2.05b$ ls -al /dev/cdrom
lr-xr-xr-x  1 root root 13 Jan 14 09:07 /dev/cdrom -> cdroms/cdrom0

bash-2.05b$ ls -al /dev/cdroms/cdrom0 
lr-xr-xr-x  1 root root 33 Jan  1  1970 /dev/cdroms/cdrom0 -> ../ide/host0/bus1/target0/lun0/cd

bash-2.05b$ ls -al /dev/ide/host0/bus1/target0/lun0/cd
brw-rw----  1 root root 22, 0 Jan  1  1970 /dev/ide/host0/bus1/target0/lun0/cd

So I did as you suggested:
chmod o+rw  /dev/ide/host0/bus1/target0/lun0/cd

And now k3b does detect the writer :) "cdrecord dev=/dev/cdrom -checkdrive" works well now also.

But why is it so? I never had to chmod it before and it worked... My non-root user does belong to cdrom and cdrw groups.

Regards,
Crocodil
Comment 4 Daniel Drake (RETIRED) gentoo-dev 2005-01-17 16:34:14 UTC
Security has been tightened up due to potential problems. As of recent kernels, you now need write access to the device to be able to write cd's (doesn't seem too unreasonable, yes? :)
Comment 5 Maciej Zieba 2005-01-18 01:42:51 UTC
Come to think about it, it's very reasonable! :) Simply, it's something (I believe) not many people yet know about... ;)

Thank you again for your help.
Comment 6 Kornelis 2005-01-26 19:10:41 UTC
I'm having the same problem, but "chmod o+rw"-ing it didn't solve anything :/

Here are my outputs of "cdrecord dev=/dev/cdrom -checkdrive" as root and as a normal user (myself):

Root:

# cdrecord dev=/dev/cdrom -checkdrive
Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 J
Comment 7 Kornelis 2005-01-26 19:10:41 UTC
I'm having the same problem, but "chmod o+rw"-ing it didn't solve anything :/

Here are my outputs of "cdrecord dev=/dev/cdrom -checkdrive" as root and as a normal user (myself):

Root:

# cdrecord dev=/dev/cdrom -checkdrive
Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schillin
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.8'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 1
Vendor_info    : 'PLEXTOR '
Identifikation : 'CD-R   PX-W1610A'
Revision       : '1.05'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED SINGLESESSION HIDECDR
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R

Myself:

$ cdrecord dev=/dev/cdrom -checkdrive
Cdrecord-Clone 2.01a28 (i686-pc-linux-gnu) Copyright (C) 1995-2004 Jörg Schillin
scsidev: '/dev/cdrom'
devname: '/dev/cdrom'
scsibus: -2 target: -2 lun: -2
Warning: Open by 'devname' is unintentional and not supported.
Linux sg driver version: 3.5.27
Using libscg version 'schily-0.8'.
Device type    : Removable CD-ROM
Version        : 0
Response Format: 1
Vendor_info    : 'PLEXTOR '
Identifikation : 'CD-R   PX-W1610A'
Revision       : '1.05'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE
Supported modes:

Any other interesting outputs:
$ groups kornelis
wheel audio cdrom games cdrw users portage kornelis

"kornelis" is my normal user account...

$ uname -a
Linux Jezus 2.6.10-gentoo-r4 #1 Sun Jan 9 03:23:25 CET 2005 i686 Intel(R) Pentium(R) 4 CPU 2.00GHz GenuineIntel GNU/Linux

:/
Comment 8 Daniel Drake (RETIRED) gentoo-dev 2005-01-27 02:59:51 UTC
Please post output of "ls -l /dev/cdrom" and check for any "unknown opcodes" in dmesg.