<s> from os import * <EOL> from os import _exit <EOL> import os <EOL> class FakeOS : <EOL> def __init__ ( self ) : <EOL> self . orig_uid = os . getuid ( ) <EOL> self . orig_gid = os . getgid ( ) <EOL> def setgroups ( * args ) : <EOL> return <EOL> def getuid ( ) : <EOL> return <NUM_LIT:0> <EOL> def setuid ( arg ) : <EOL> self . uid = arg <EOL> self . setuid_called = <NUM_LIT:1> <EOL> def setgid ( arg ) : <EOL> self . gid = arg <EOL> self . setgid_called = <NUM_LIT:1> <EOL> def clear ( ) : <EOL> self . uid = orig_uid <EOL> self . gid = orig_gid <EOL> self . setuid_called = <NUM_LIT:0> <EOL> self . setgid_called = <NUM_LIT:0> <EOL> fake = FakeOS ( ) <EOL> setgroups = fake . setgroups <EOL> getuid = fake . getuid <EOL> setuid = fake . setuid <EOL> setgid = fake . setgid <EOL> clear = fake . clear </s>
