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)