gnustep-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: NSUserName() returns wrong user and..


From: Richard Frith-Macdonald
Subject: Fwd: NSUserName() returns wrong user and..
Date: Fri, 21 Nov 2003 06:37:20 +0000


Any thoughts on this?

Does anyone object to changing NSUserName() to return the name
associated with geteuid() rather than the LOGNAME environment
variable?

Should the name be (as currently) cached, or should the function
check the effective user id every time it is called?

At present there is an extra function GSSetUserName() which can
be used to manually set the username and reset the user defaults
system ... but if NSUserName() rechecked geteuid() every time it
was called, it could reset the user defaults system itsself.

Begin forwarded message:

From: Matt Rice <address@hidden>
Date: Sat Nov 8, 2003  12:25:08 PM Europe/London
To: address@hidden
Subject: NSUserName() returns wrong user and..

two seperate things in this email... srry
1)
basically NSUserName() depends on the LOGNAME
environment
variable which isn't updated when using su (unless you
use su -) getlogin() has the same issue..
this can cause issues like where NSHomeDirectory()
returns the wrong home directory and you get access
denied messages or worse, if you're su'd to root you
write files to someone else's ~ then they get access
denied messages when attempting to write to root owned
stuff in their home directory.

attached are some patches for make/user_home.c and
base/Source/NSUser.m which switches around the order
of the calls

here is a url which makes me believe this is the
correct behavior and that the docs are just unspecific
with their definition of current user

http://cocoa.mamasam.com/COCOADEV/2003/09/2/73680.php

2)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]