Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#1536 - cdrtools 2.01-1: cdrecord required to run as root with kernel 2.6.8.1

Attached to Project: Arch Linux
Opened by Chris (colnago) - Sunday, 26 September 2004, 22:03 GMT
Last edited by Judd Vinet (judd) - Tuesday, 28 September 2004, 04:46 GMT
Task Type Bug Report
Category Packages: Current
Status Closed
Assigned To dorphell (dorphell)
Architecture not specified
Severity Medium
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Votes 0
Private No

Details

cdrecord (in cdrtools 2.01) only works as a privelledged user. This is true even if kernel 2.6.8.1 patches are applied, as cdrecord.c itself checks. Applying a patch (hack?) such as the following allows for use as a normal user. Note that k3b now uses cdrecord (in k3b 0.11.17) rather than cdrdao (in k3b 0.11.16) and is thus broken for kernel 2.6.8.1 users as well.

Example patch follows, it just comments out the 3 sections:
---------------------------------------------------------
--- cdrtools-2.01/cdrecord/cdrecord.c 2004-09-08 10:26:35.000000000 -0700
+++ cdrecord.c 2004-09-26 12:22:54.000000000 -0700
@@ -492,8 +492,9 @@
/*
* XXX Below this point we do not need root privilleges anymore.
*/
- if (geteuid() != getuid()) { /* AIX does not like to do this */
+ /*if (geteuid() != getuid()) { /* AIX does not like to do this */
/* If we are not root */
+ /*
#ifdef HAVE_SETREUID
if (setreuid(-1, getuid()) < 0)
#else
@@ -504,8 +505,8 @@
#endif
#endif
comerr("Panic cannot set back effective uid.\n");
- }
- /*
+ }*/
+ /*
* WARNING: We now are no more able to do any privilleged operation
* unless we have been called by root.
*
@@ -1009,10 +1010,10 @@
* even on OS that do not support getreuid() which is *BSD
* and SUSv3 only.
*/
- if (oeuid != getuid()) {
+ /*if (oeuid != getuid()) {
if (setreuid(-1, oeuid) < 0)
errmsg("Could set back effective uid.\n");
- }
+ }*/
#endif
/*
* fork() here to start the extra process needed for
@@ -1027,11 +1028,12 @@
/*
* XXX Below this point we never need root privilleges anymore.
*/
- if (geteuid() != getuid()) { /* AIX does not like to do this*/
+ /*if (geteuid() != getuid()) {*/ /* AIX does not like to do this*/
/* If we are not root */
- if (setreuid(-1, getuid()) < 0)
+ /* if (setreuid(-1, getuid()) < 0)
comerr("Panic cannot set back effective uid.\n");
- }
+ }*/
+
#endif
}
if ((*dp->cdr_set_speed_dummy)(scgp, dp, &speed) < 0) {
This task depends upon

Closed by  dorphell (dorphell)
Saturday, 16 October 2004, 16:45 GMT
Reason for closing:  Won't implement
Comment by Chris (colnago) - Tuesday, 28 September 2004, 03:14 GMT
A user on the forum noted that if you do not chmod u+s the cdrecord executable (k3b tries to get you to do this), then there is no problem and no need to apply this patch. Looking at the permission checks, this is obviously true, so maybe not so much of a bug, sorry.

The drawback is the lowered priority w/o suid (and possible buffer underruns?).

Loading...