From: "Hamzeh Nasajpour" <h.nasajpour@pantherx.org>
To: 52011@debbugs.gnu.org
Subject: bug#52011: pkexec: PATH environment variable
Date: Sun, 21 Nov 2021 11:33:05 +0330 [thread overview]
Message-ID: <46b16bf3-e41c-4ccf-9817-879df6eeb8cb@www.fastmail.com> (raw)
The `PATH` environment variable is hard-code here:
https://github.com/freedesktop/polkit/blob/master/src/programs/pkexec.c#L882-L886
We don't have any executable in these paths in guix:
```
/usr/sbin:/usr/bin:/sbin:/bin:/root/bin
```
Replicate the issue:
1. Run the `pkexec`
2. Enter your password
3. run `echo $PATH` in the opened terminal
4. You will see this path: `/usr/sbin:/usr/bin:/sbin:/bin:/root/bin`
5. You can't run most of the commands. (`ls`, `passwd`, `chpasswd` and so on.)
Expected Behavior:
Running all of the commands without any error.
Isn't it? Should not we patch the `PATH` environment variable in `pkexec` source codes? Either way, some applications like `lxqt-admin-user` and `lxqt-admin-time` has an issue and they can't run the commands via `pkexec`. I get this error when I want to change user password via `lxqt-admin-user`. It's using `pkexec` to change password.
```
/run/current-system/profile/bin/lxqt-admin-user-helper: line 7: exec: passwd: not found
```
--
Hamzeh Nasajpour
PantherX Team
next reply other threads:[~2021-11-21 8:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-21 8:03 Hamzeh Nasajpour [this message]
2021-11-21 14:52 ` bug#52011: pkexec: PATH environment variable Liliana Marie Prikler
2021-11-28 7:39 ` Hamzeh Nasajpour
2022-09-09 16:10 ` Liliana Marie Prikler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=46b16bf3-e41c-4ccf-9817-879df6eeb8cb@www.fastmail.com \
--to=h.nasajpour@pantherx.org \
--cc=52011@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).