From cd62ed35b12905d4206542a136ecd4edffa32497 Mon Sep 17 00:00:00 2001 From: Fabio Erculiani Date: Sat, 7 Aug 2010 19:10:26 +0200 Subject: [PATCH] [entropy.const] const_regain_privileges: do not raise ValueError if process is already privileged --- libraries/entropy/const.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libraries/entropy/const.py b/libraries/entropy/const.py index 37aeedd8c..87fef833c 100644 --- a/libraries/entropy/const.py +++ b/libraries/entropy/const.py @@ -954,15 +954,13 @@ def const_regain_privileges(): @raise entropy.exceptions.SecurityError: if unprivileged uid/gid cannot be retrieived. - @raise ValueError: if program is already running as unsupported unprivileged - users. @todo: when Python 2.7, see os.getresuid() """ cur_uid = os.getuid() if cur_uid == 0: # already running privileged - raise ValueError("already running as privileged user") + return # privileges can be dropped # set like this, otherwise we won't get back all our privs!