Re: cdrtools cdrecord/cdrecord.c
Matthias Andree <matthias.andree@gmx.de> wrote:
> Joerg Schilling schrieb am 2006-01-22:
>
> > First: this is not a bug inside cdrecord that needs to be fixed but a recently
> > introduced bug in Linux that needs a workaround.
>
> I don't care how you call it. It's a problem between cdrecord and Linux
> that needs to be fixed.
>
> Since you insisted that setuid would work in Linux (which it doesn't),
> I'm showing you what works for me ATM. I'm not claiming it's appplicable
> as is, I wanted to hear how your review is going.
Do you like to test this workaround:
------- scsi-linux-sg.c -------
*** /tmp/sccs.Zpaa0n So Jan 22 18:41:31 2006
--- scsi-linux-sg.c So Jan 22 18:41:11 2006
***************
*** 896,902 ****
--- 896,909 ----
register int f;
int val;
int old;
+ int errsav = geterrno();
+ uid_t cureuid = geteuid();
+
+ if (cureuid != 0)
+ seteuid(0);
+ seterrno(errsav);
+
/*
* First try to raise the DMA limit to a moderate value that
* most likely does not use up all kernel memory.
***************
*** 960,965 ****
--- 967,977 ----
}
}
}
+
+ errsav = geterrno();
+ if (cureuid != 0)
+ seteuid(cureuid);
+ seterrno(errsav);
return ((long)newmax);
}
#endif
Jörg
--
EMail:joerg@schily.isdn.cs.tu-berlin.de (home) Jörg Schilling D-13353 Berlin
js@cs.tu-berlin.de (uni)
schilling@fokus.fraunhofer.de (work) Blog: http://schily.blogspot.com/
URL: http://cdrecord.berlios.de/old/private/ ftp://ftp.berlios.de/pub/schily
Reply to: