kdesu patch
Matthias Welwarsky
matze at stud.fbi.fh-darmstadt.de
Tue Jun 4 11:39:27 BST 2002
On Tuesday 04 June 2002 11:37, Stephan Kulow wrote:
> Hi!
>
> Some tools expect /sbin to be part of the root path as "su"
> adds them (I'm not sure if it's set by some environment files
> or if it's added by su itself - "su -" surely sets it through the
> profile)
>
> Anyway, kdesu doesn't behave like that, so /sbin is missing.
> Anyone objecting against the following patch?
>
> Greetings, Stephan
>
> --- stub.cpp 2002/03/04 00:59:16 1.17
> +++ stub.cpp 2002/06/04 09:33:20
> @@ -118,7 +118,13 @@
> } else if (line == "command") {
> writeLine(m_Command);
> } else if (line == "path") {
> - writeLine(getenv("PATH"));
> + QCString path = getenv("PATH");
> + if (m_User == "root")
I always wondered if it's a good idea to hardcode "root" into some binary.
"root" is just a convention, and I've frequently seen administrators renaming
"root" to "ruth" or something ;) So checking for UID=0 is a better idea.
regards,
matze
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: signature
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20020604/112f425a/attachment.sig>
More information about the kde-core-devel
mailing list