def dropRootPrivs(fn):
def wrapped_fn(*args, **kwargs):<EOL><INDENT>q = multiprocessing.Queue()<EOL>p = multiprocessing.Process(target=_dropPrivsReturnViaQueue, args=(q, fn, args, kwargs))<EOL>p.start()<EOL>r = None<EOL>e = None<EOL>while True:<EOL><INDENT>msg = q.get()<EOL>if msg[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>r = msg[<NUM_LIT:1>]<EOL><DEDENT>if msg[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>e = msg[<NUM_LIT:1>](msg[<NUM_LIT:2>])<EOL><DEDENT>if msg[<NUM_LIT:0>] == '<STR_LIT>':<EOL><INDENT>if e is not None:<EOL><INDENT>raise e <EOL><DEDENT>return r<EOL><DEDENT><DEDENT><DEDENT>return wrapped_fn<EOL>
decorator to drop su/sudo privilages before running a function on
        unix/linux.
        The *real* uid is modified, so privileges are permanently dropped for
        the process. (i.e. make sure you don't need to do

        If there is a SUDO_UID environment variable, then we drop to that,
        otherwise we drop to nobody.