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

Jane Austine janeaustine50 at hotmail.com
Fri Jul 26 10:42:47 EDT 2002


"Donn Cave" <donn at u.washington.edu> wrote in message news:<ahptae$22qg$1 at nntp6.u.washington.edu>...
> Quoth janeaustine50 at hotmail.com (Jane Austine):
> | >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.
>  ...
> | It seems like when popen forks for a new shell, euid is all cleared.
> 
> Yes, I think it's the shell, all right.  All I can say is, popen2()
> works for me - *IF* I use the list of parameters as above.  It doesn't
> help to just use popen2 instead of popen, and give it the same command
> string.
> 
> 	Donn Cave, donn at u.washington.edu

Well, it didn't work with list of parameters as above. But thank you
anyway!

Changjune Kim's suggestion worked just right.

After a couple of research I found out this: Bash-2.x requires the
`-p` option to run setuid.  If that is not supplied, bash disables its
setuid status.



More information about the Python-list mailing list