> All those helpers are taken from setuplxc.py, btw.
>
> The su contextmanager has an issue: the euid and egid are not set back
> properly when there is an error in the with block, for some reason.
Trapping the error (re-raised inside the generator) using a try/finally statement should solve this.
E.g. http://pastebin.ubuntu.com/836410/
> All those helpers are taken from setuplxc.py, btw.
>
> The su contextmanager has an issue: the euid and egid are not set back
> properly when there is an error in the with block, for some reason.
Trapping the error (re-raised inside the generator) using a try/finally statement should solve this. pastebin. ubuntu. com/836410/
E.g. http://