Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
cdrecord not taking SUID root?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
red_over_blue
Guru
Guru


Joined: 16 Dec 2002
Posts: 310

PostPosted: Wed May 28, 2003 7:12 pm    Post subject: cdrecord not taking SUID root? Reply with quote

Hello all,

I am having a problem with cdrecord being run as a normal user. When run as a normal user, I get the following error. But as you can see, cdrecord is SUID root and I belong to the cdrw group. I posted the same thing here, but as the title says SOLVED! its not getting any attention :) Thanks for any suggestions you might have.

Code:

cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
Starting to write CD/DVD at speed 8 in real TAO mode for single session.
Last chance to quit, starting real write    8 seconds.
cdrecord: fifo had 64 puts and 0 gets.
cdrecord: fifo was 0 times empty and 1 times full, min fill was 0%.

john@limbo john $ ls -l /usr/bin/cdrecord
-rwsr-x---    1 root     cdrw       328148 May 25 23:55 /usr/bin/cdrecord

john@limbo john $ groups
users wheel audio cdrw apache usb portage cdrecording
Back to top
View user's profile Send private message
puggy
Bodhisattva
Bodhisattva


Joined: 28 Feb 2003
Posts: 1992
Location: Oxford, UK

PostPosted: Wed May 28, 2003 8:42 pm    Post subject: Reply with quote

I've got xcdroast and arson installed. It seems that they both have their own ways of making cdrecord work for them and whenever I let one of them have it its way, the other doesn't like it. Could it be anything like this?

Puggy
_________________
Where there's open source , there's a way.
Back to top
View user's profile Send private message
red_over_blue
Guru
Guru


Joined: 16 Dec 2002
Posts: 310

PostPosted: Wed May 28, 2003 9:53 pm    Post subject: Reply with quote

I'm not sure. This is all from the CLI simply using the cdrecord command. I don't get the errors as root, so if I SUID root cdrecord, I shouldn't get the errors as a normal user... but I do!
Back to top
View user's profile Send private message
red_over_blue
Guru
Guru


Joined: 16 Dec 2002
Posts: 310

PostPosted: Thu May 29, 2003 10:56 pm    Post subject: Reply with quote

I hate to bump this, but I just "coastered" another CD because of a bugger under-run when I forgot to use cdrecord as root.

What am I doing wrong?
Back to top
View user's profile Send private message
AgenT
Apprentice
Apprentice


Joined: 18 May 2003
Posts: 280

PostPosted: Fri May 30, 2003 1:13 pm    Post subject: Reply with quote

I too get this error:

Code:

cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.


Even if I have chmod u+s /usr/bin/cdrecord (which I think it was by default):

Code:

chmod u+s /usr/bin/cdrecord
ll /usr/bin/cdrecord -rwsr-xr-x    1 root     root       328148 May 20 13:27 /usr/bin/cdrecord*


Any ideas? Anyone? This happens as non-root of course... :?
Back to top
View user's profile Send private message
Tarball
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2002
Posts: 142
Location: Cheshire, UK

PostPosted: Sat May 31, 2003 1:49 pm    Post subject: Reply with quote

I have this problem also. What version of cdrtools are you guys using? It seems like it's a problem with version 2.01_alpha14. I emerged version 1.11.33-r1 and let xcdroast do it's stuff WRT setting up permissions and that seems to be OK.
Here's the output from the two different versions using the same command:

1.11a33
Code:

{ecco} cd_image/BeOS% cdrecord -v speed=32 -dummy -driveropts=bunrproof BeOS5PEMaxEditionV2.img
Cdrecord 1.11a33 (i686-pc-linux-gnu) Copyright (C) 1995-2002 Jörg Schilling
TOC Type: 1 = CD-ROM
scsidev: '0,1,0'
scsibus: 0 target: 1 lun: 0
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.6'
Driveropts: 'bunrproof'
atapi: 1
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   :
Vendor_info    : 'CD-RW   '
Identifikation : 'CDR-6S52        '
Revision       : '6SG1'
Device seems to be: Generic mmc CD-RW.
Using generic SCSI-3/mmc CD-R driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Drive buf size : 1422080 = 1388 KB
FIFO size      : 4194304 = 4096 KB
Track 01: data   620 MB
Total size:      712 MB (70:32.56) = 317442 sectors
Lout start:      712 MB (70:34/42) = 317442 sectors
Current Secsize: 2048
ATIP info from disk:
  Indicated writing power: 5
  Is not unrestricted
  Is not erasable
  Disk sub type: Medium Type B, low Beta category (B-) (4)
  ATIP start of lead in:  -11524 (97:28/26)
  ATIP start of lead out: 359849 (79:59/74)
Disk type:    Short strategy type (Phthalocyanine or similar)
Manuf. index: 13
Manufacturer: Multi Media Masters & Machinary SA
Blocks total: 359849 Blocks current: 359849 Blocks remaining: 42407
Forcespeed is OFF.
Starting to write CD/DVD at speed 32 in dummy TAO mode for single session.
Last chance to quit, starting dummy write in 0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
BURN-Free is OFF.
Starting new track at sector: 0
Track 01:  620 of  620 MB written (fifo 100%) [buf  99%]  32.9x.
Track 01: Total bytes read/written: 650117120/650117120 (317440 sectors).
Writing  time:  157.896s
Average write speed  26.8x.
Min drive buffer fill was 97%
Fixating...
WARNING: Some drives don't like fixation in dummy mode.
Fixating time:   17.506s
cdrecord: fifo had 10240 puts and 10240 gets.
cdrecord: fifo was 0 times empty and 6838 times full, min fill was 79%.


2.01a14
Code:

{ecco} cd_image/BeOS% cdrecord -v speed=32 -dummy -driveropts=bunrproof BeOS5PEMaxEditionV2.img
Cdrecord 2.01a14 (i686-pc-linux-gnu) Copyright (C) 1995-2003 Jörg Schilling
TOC Type: 1 = CD-ROM
scsidev: '0,1,0'
scsibus: 0 target: 1 lun: 0
Linux sg driver version: 3.1.24
Using libscg version 'schily-0.7'
Driveropts: 'bunrproof'
atapi: 1
Device type    : Removable CD-ROM
Version        : 0
Response Format: 2
Capabilities   :
Vendor_info    : 'CD-RW   '
Identifikation : 'CDR-6S52        '
Revision       : '6SG1'
Device seems to be: Generic mmc CD-RW.
Current: 0x0009
Profile: 0x000A
Profile: 0x0009 (current)
Profile: 0x0008
Profile: 0x0002 (current)
Using generic SCSI-3/mmc   CD-R/CD-RW driver (mmc_cdr).
Driver flags   : MMC-3 SWABAUDIO BURNFREE FORCESPEED
Supported modes: TAO PACKET SAO SAO/R96P SAO/R96R RAW/R16 RAW/R96P RAW/R96R
Drive buf size : 1422080 = 1388 KB
FIFO size      : 4194304 = 4096 KB
Track 01: data   620 MB
Total size:      712 MB (70:32.56) = 317442 sectors
Lout start:      712 MB (70:34/42) = 317442 sectors
Current Secsize: 2048
ATIP info from disk:
  Indicated writing power: 5
  Is not unrestricted
  Is not erasable
  Disk sub type: Medium Type B, low Beta category (B-) (4)
  ATIP start of lead in:  -11524 (97:28/26)
  ATIP start of lead out: 359849 (79:59/74)
Disk type:    Short strategy type (Phthalocyanine or similar)
Manuf. index: 13
Manufacturer: Multi Media Masters & Machinary SA
Blocks total: 359849 Blocks current: 359849 Blocks remaining: 42407
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler
cdrecord: Permission denied. WARNING: Cannot set priority using setpriority().
cdrecord: WARNING: This causes a high risk for buffer underruns.
Forcespeed is OFF.
Starting to write CD/DVD at speed 32 in dummy TAO mode for single session.
Last chance to quit, starting dummy write    0 seconds. Operation starts.
Waiting for reader process to fill input buffer ... input buffer ready.
BURN-Free is OFF.
Starting new track at sector: 0
Track 01:  620 of  620 MB written (fifo 100%) [buf  98%]  33.0x.
Track 01: Total bytes read/written: 650117120/650117120 (317440 sectors).
Writing  time:  157.847s
Average write speed  26.8x.
Min drive buffer fill was 96%
Fixating...
WARNING: Some drives don't like fixation in dummy mode.
Fixating time:   17.529s
cdrecord: fifo had 10240 puts and 10240 gets.
cdrecord: fifo was 0 times empty and 6851 times full, min fill was 78%.
Back to top
View user's profile Send private message
Nicom
Guru
Guru


Joined: 30 Jan 2003
Posts: 380

PostPosted: Mon Jun 02, 2003 3:27 am    Post subject: Reply with quote

I'm having the same problem.
Back to top
View user's profile Send private message
Yama
Tux's lil' helper
Tux's lil' helper


Joined: 21 Jul 2002
Posts: 135
Location: Sydney, Australia

PostPosted: Wed Jun 11, 2003 5:49 am    Post subject: cdrtools downgrade fixed it Reply with quote

Tarball wrote:
I have this problem also. What version of cdrtools are you guys using? It seems like it's a problem with version 2.01_alpha14. I emerged version 1.11.33-r1 and let xcdroast do it's stuff WRT setting up permissions and that seems to be OK.

That seems to have worked for me as well. I was getting "Cannot set RR-scheduler" errors with cdrtools-2.01_alpha14, even after setting the sticky bit and placing the cdrecord executable in the cdrw group (of which my user is a member). This problem only arose in the last month or two, so there must have been a problem with something I did recently. Downgrading cdrtools to 1.11.40 made the errors go away. I assume this is a bug with cdrtools-2.x.
Back to top
View user's profile Send private message
Tarball
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2002
Posts: 142
Location: Cheshire, UK

PostPosted: Wed Jun 11, 2003 10:08 am    Post subject: Reply with quote

I've just been trying to mask app-cdr/cdrtools-1.11.33 but it comes up as a dependancy for Xcdroast. Is xcdroast still using this older version of cdrtools because of this problem??

I've just downloaded the 2.01a14 version from the cdrtools homepage, compiled it, set the permissions and tried that and it doesn't seem to exihibit the problem?!?! Can someone confirm this? I'm playing about with it logged in to my machine remotely and there isn't a cdr in the drive so I just want to make sure that cdrecord's complaints about 'no disc' isn't hiding the initial problem.


Ok, I just tried compiling 2.01a15 source and running that on a drive with a disc in it. The problem still occurs.
Back to top
View user's profile Send private message
Tarball
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2002
Posts: 142
Location: Cheshire, UK

PostPosted: Wed Jun 11, 2003 12:08 pm    Post subject: Reply with quote

Right, I think I have found the reason for this problem, in the change log for cdrtools-2.01a13 (the version in which this problem first occurs) I have found the following change:

Quote:
-Cdrecord now resets euid to the uid of the caller (if called suid root)
before it opens data files.


I think this is also kinda related to https://forums.gentoo.org/viewtopic.php?t=54904&highlight=cdrecord+setuid

In light of this, what would be the correct way to set-up/use cdrecord???
Back to top
View user's profile Send private message
Tarball
Tux's lil' helper
Tux's lil' helper


Joined: 19 Jun 2002
Posts: 142
Location: Cheshire, UK

PostPosted: Fri Jun 27, 2003 7:30 pm    Post subject: Reply with quote

I am just running cdrecord as I would normally but I now have a VT connected to my serial port which I leave top running on. I noticed that top reports cdrecord running as priority RT. Does this perhaps mean that the error message is just misleading and that cdrecord is running with real time sheduling after all?!?!
Back to top
View user's profile Send private message
peacekeeper
n00b
n00b


Joined: 28 Aug 2003
Posts: 25

PostPosted: Sun Aug 31, 2003 10:18 pm    Post subject: interesting... Reply with quote

this is what I found...

in other distributions, /usr/bin/cdrecord is a bash file that picks the right executable depending on the kernel version, either cdrecord.mmap for 2.4 or cdrecord.shm for 2.2.

other people have been able to solve the problem by just doing "chmod +s cdrecord.*"

now in gentoo /usr/bin/cdrecord is a binary file. my guess is that the ebuild substitutes cdrecord.mmap for cdrecord. The problem may be something with that.... but I still don't know how to fix it :(
Back to top
View user's profile Send private message
simbal
n00b
n00b


Joined: 30 Aug 2003
Posts: 7

PostPosted: Sun Sep 28, 2003 5:39 pm    Post subject: Reply with quote

Quote:
cdrecord: Operation not permitted. WARNING: Cannot set RR-scheduler

Don't worry about this error.
When cdrecord starts, it sets the priority to the maximum.
After that, the effective user ID is changed to the real user ID (for security reasons). However, it tries to lower the priority by 1 later on :roll:, which is then no longer possible and leads to this error message.
So the only problem is that cdrecord runs with a little too much priority.

It is however required to SUID root cdrecord, because a normal user can never switch a process to realtime priority.

--
simbal
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo 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