diff options
author | 2023-07-16 11:57:08 +0000 | |
---|---|---|
committer | 2023-07-16 11:57:08 +0000 | |
commit | 2ebb09e346544785d1b4e27d7b779a2a7476ca3e (patch) | |
tree | 9871d689a1aa76836e8cb99ad69f845ed92a8680 /src/jailcheck/utils.c | |
parent | bleachbit.profile: allow erasing Trash contents (diff) | |
parent | feature: add doas support in firecfg and jailcheck (diff) | |
download | firejail-2ebb09e346544785d1b4e27d7b779a2a7476ca3e.tar.gz firejail-2ebb09e346544785d1b4e27d7b779a2a7476ca3e.tar.zst firejail-2ebb09e346544785d1b4e27d7b779a2a7476ca3e.zip |
Merge pull request #5900 from kmk3/firecfg-support-doas
feature: add doas support in firecfg and jailcheck
Diffstat (limited to 'src/jailcheck/utils.c')
-rw-r--r-- | src/jailcheck/utils.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/jailcheck/utils.c b/src/jailcheck/utils.c index 97fe8833b..930820604 100644 --- a/src/jailcheck/utils.c +++ b/src/jailcheck/utils.c | |||
@@ -26,7 +26,10 @@ | |||
26 | #define BUFLEN 4096 | 26 | #define BUFLEN 4096 |
27 | 27 | ||
28 | char *get_sudo_user(void) { | 28 | char *get_sudo_user(void) { |
29 | char *user = getenv("SUDO_USER"); | 29 | char *doas_user = getenv("DOAS_USER"); |
30 | char *sudo_user = getenv("SUDO_USER"); | ||
31 | char *user = doas_user ? doas_user : sudo_user; | ||
32 | |||
30 | if (!user) { | 33 | if (!user) { |
31 | user = getpwuid(getuid())->pw_name; | 34 | user = getpwuid(getuid())->pw_name; |
32 | if (!user) { | 35 | if (!user) { |