On 02/11/10 10:17 AM, Darren J Moffat wrote:
On 11/02/2010 16:04, Padraig O'Briain wrote:
I have logged 14520 for this.

Interesting comment in portable.get_userid()

73 # If the software is being executed with pfexec, the uid or euid will
74 # likely be 0 which is of no use. Since the os.getlogin() interface
75 # provided by Python breaks in a number of interesting ways, their
76 # recommendation is to pull the username from the environment instead.

What is "breaks in a number of interesting ways" because looking at the
environment variables isn't safe because they can be set by the
unprivileged user and unlike the LD_ ones they aren't cleared on
setuid(2) calls - otherwise portable.get_userid() wouldn't have worked
at anyway!

Yes, which is why it's so annoying that the interfaces python provides for this are utterly broken. This function follows the current recommendations from the python community. Either way though, this should use portable.get_userid(), and if/when we have a better way to do this specifically for Solaris, that can be hidden inside the portable module instead of relying on python's broken interfaces.

--
Shawn Walker
_______________________________________________
pkg-discuss mailing list
[email protected]
http://mail.opensolaris.org/mailman/listinfo/pkg-discuss

Reply via email to