pkexec doesn't respect relative commands passed from where the running terminal session is actually ran from
(More on this in the detailed description)
Desired behaviour
pkexec should respect relative parameters given to commands that are elevated by pkexec
Reproducer
# As unprivileged user
cd ~
pkexec mkdir -p testing/polkit
Detailed description
Running pkexec as a substitute for sudo or doas (I personally use doas but I noticed this behavior about pkexec) causes an issue if you use commands using relative contexts.
In the example above, pkexec actually cause polkit to make folders in /root rather than where the command was ran from; this isn't ideal behavior for an authentication program.
In GitLab by @N3k0-san on Aug 29, 2023, 24:04
Current behaviour, description of the problem
pkexec
doesn't respect relative commands passed from where the running terminal session is actually ran from(More on this in the detailed description)
Desired behaviour
pkexec
should respect relative parameters given to commands that are elevated bypkexec
Reproducer
Detailed description
Running pkexec as a substitute for sudo or doas (I personally use doas but I noticed this behavior about pkexec) causes an issue if you use commands using relative contexts.
In the example above,
pkexec
actually cause polkit to make folders in/root
rather than where the command was ran from; this isn't ideal behavior for an authentication program.Version of polkit: 122
Version of OS: Gentoo (LLVM-OpenRC Profile)
Anything else related to the issue: Associated Gentoo Bug Report