gnustep-dev
[Top][All Lists]
Advanced

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

Re: Fwd: NSUserName() returns wrong user and..


From: David Ayers
Subject: Re: Fwd: NSUserName() returns wrong user and..
Date: Fri, 21 Nov 2003 15:43:29 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007

Richard Frith-Macdonald wrote:

Any thoughts on this?

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

I see no legitmate reason to use an environment variable to to control the current user. In fact 'su user' (without the -) also changes the whoami output and cd changes to the new users home directory.

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

I think caching should be left up to the application. If it asks mulitple times, there could be a good reason for it.

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.

Actually, I see no inherent connection between querying the user name and updating the user defaults. I'd rather ask if this function should actually /do/ the setting of the user (i.e. call setuid) rather than merely syncronize with the current user id.

To support 'external' setuid maybe we could extract the syncronization in a GSSyncronizeUser() or similar function. OTOH we could discourage that and say that we provide GSSetUserName() for that, and then, I guess, we could again cache the user name for NSUserName().

Cheers,
David

PS: We might want to call the funtion to set the user GSSetUser() and deprecate GSSetUserName().







reply via email to

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