]> git.donarmstrong.com Git - deb_pkgs/autorandr.git/blobdiff - autorandr.py
In batch mode, set groups to group membership of target user.
[deb_pkgs/autorandr.git] / autorandr.py
index 80d61ef87eea574544367e130bdd224086444d7b..a2c6f8274e17c7782e95375419a848254b5e1010 100755 (executable)
@@ -1101,7 +1101,7 @@ def dispatch_call_to_sessions(argv):
             # so it should be safe. Also, note that since the environment
             # is taken from a process owned by the user, reusing it should
             # not leak any information.
-            os.setgroups([])
+            os.setgroups(os.getgrouplist(pwent.pw_name, pwent.pw_gid))
             os.setresgid(pwent.pw_gid, pwent.pw_gid, pwent.pw_gid)
             os.setresuid(pwent.pw_uid, pwent.pw_uid, pwent.pw_uid)
             os.chdir(pwent.pw_dir)
@@ -1111,7 +1111,7 @@ def dispatch_call_to_sessions(argv):
                 os.execl(sys.executable, sys.executable, autorandr_binary, *argv[1:])
             else:
                 os.execl(autorandr_binary, autorandr_binary, *argv[1:])
-            os.exit(1)
+            sys.exit(1)
         os.waitpid(child_pid, 0)
 
     for directory in os.listdir("/proc"):