summaryrefslogtreecommitdiff
diff options
authorPMR <pmr@pmr-lander>2020-04-03 08:46:25 +0000
committerPMR <pmr@pmr-lander>2020-04-03 08:46:25 +0000
commitc261799159d320cc96fbfa124cd5fabcd4a18ba4 (patch)
treee8a3d07a28194199677bdb8600215f23d85a5f0d
parentae6dc340a022b6ea1dd4774c52ea234297c4b37c (diff)
parent45b4ffa95161e1fb80406f8fb02b96b84e20267f (diff)
Merge #381631 from ~sylvain-pineau/plainbox-provider-checkbox:pm_test_remote_fix
-rwxr-xr-xbin/pm_test12
1 files changed, 7 insertions, 5 deletions
diff --git a/bin/pm_test b/bin/pm_test
index b03e6804..3dcdf289 100755
--- a/bin/pm_test
+++ b/bin/pm_test
@@ -36,11 +36,13 @@ def main():
sys.exit(1)
# Obtain name of the invoking user.
- uid = os.getenv('SUDO_UID') or os.getenv('PKEXEC_UID')
- if not uid:
- sys.stderr.write('Unable to determine invoking user\n')
- sys.exit(1)
- username = pwd.getpwuid(int(uid)).pw_name
+ username = os.getenv('NORMAL_USER')
+ if not username:
+ uid = os.getenv('SUDO_UID') or os.getenv('PKEXEC_UID')
+ if not uid:q
+ sys.stderr.write('Unable to determine invoking user\n')
+ sys.exit(1)
+ username = pwd.getpwuid(int(uid)).pw_name
LoggingConfiguration.set(args.log_level, args.log_filename, args.append)
logging.debug('Invoking username: %s', username)