Re: pkexec : patch for safe "--keep-user-env" option

2016-02-27 Thread Jean-Philippe Guillemin
Indeed $SUDO_USER works for applications that check $SUDO_USER, for example, the following work similarly in the case of lxdm-config : pkexec /usr/bin/env USER=$USER /usr/bin/lxdm-config pkexec /usr/bin/env SUDO_USER=$USER /usr/bin/lxdm-config pkexec --keep-user-env /usr/bin/lxdm-config Note : t

Re: pkexec : patch for safe "--keep-user-env" option

2016-02-27 Thread Colin Walters
On Sat, Feb 27, 2016, at 07:01 AM, Jean-Philippe Guillemin wrote: > Hi, Many X applications require root privileges, but at the same time > want to keep the original $USER env variable Isn't the more correct precedent for this the `SUDO_USER` environment variable? _

Re: pkexec : patch for safe "--keep-user-env" option

2016-02-27 Thread Jean-Philippe Guillemin
The patch : diff -rNaud polkit-0.105/src/programs/pkexec.c polkit-0.105-new/src/programs/pkexec.c --- polkit-0.105/src/programs/pkexec.c 2012-04-24 18:05:34.0 +0200 +++ polkit-0.105-new/src/programs/pkexec.c 2016-02-27 13:15:21.683832135 +0100 @@ -76,6 +76,7 @@ " --hel

pkexec : patch for safe "--keep-user-env" option

2016-02-27 Thread Jean-Philippe Guillemin
Hi, Many X applications require root privileges, but at the same time want to keep the original $USER env variable. This option (see attached patch), while preserving the sanitized environment, and also while still honoring the org.freedesktop.policykit.exec.allow_gui annotate key : allow the user