( as root )
import pwd,posix
user=pwd.getpwnam( username )
posix.setuid( user[2] )
posix.chdir( user[-2] )
Now *how* do you exec a users .profile so you can get the proper
environment variables set and read back into python ?
I've tried:
posix.popen( "ksh -c '. ./profile ; env'" , 'r' ).readlines()
( and a few other variations ) but I get the OLD variables!
- Steve Majewski (804-982-0831) <sdm7g@Virginia.EDU>
- UVA Department of Molecular Physiology and Biological Physics