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 : the problem when using "env" is that "/usr/bin/env" is matched
by org.freedesktop.policykit.exec.path , so it's not a solution (all
programs in need to keep $USER would get the same action policy) : that's
why I wrote this patch.

Using $SUDO_USER or $USER both require a patch

JP


2016-02-27 16:29 GMT+01:00 Colin Walters <walt...@verbum.org>:

>
>
>
> 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?
>
>
>
> _______________________________________________
> polkit-devel mailing list
> polkit-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/polkit-devel
>
>
_______________________________________________
polkit-devel mailing list
polkit-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/polkit-devel

Reply via email to