[Re] euid/egid eaten up by os.popen

Jane Austine janeaustine50 at hotmail.com
Thu Jul 25 16:03:50 EDT 2002


>I bet you're running Linux.  My suggestion is to try popen2, and

Yes, Red Hat 7.3

>specify the command as a list of arguments.  For example, if you
>have been writing
>   fp = os.popen('id')
>then try
>   fp, ignore = popen2.popen2(['id'])

Have done that and it didn't work still.

>
>The same goes for system(), incidentally - spawnv() will work better.
>
>The problem is evidently caused by bash.  If you contrive to run
>bash to interpret the command string on some other platform, it
>will happen the same way - it's only a Linux bug because Linux uses
>bash here.
>
>Donn Cave, donn at u.washington.edu

It seems like when popen forks for a new shell, euid is all cleared.



More information about the Python-list mailing list