aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/firecfg/main.c5
-rw-r--r--src/jailcheck/main.c2
-rw-r--r--src/jailcheck/utils.c5
-rw-r--r--src/man/firecfg.1.in4
-rw-r--r--src/man/jailcheck.1.in5
5 files changed, 14 insertions, 7 deletions
diff --git a/src/firecfg/main.c b/src/firecfg/main.c
index a6cae995e..4ec81c5b3 100644
--- a/src/firecfg/main.c
+++ b/src/firecfg/main.c
@@ -289,7 +289,10 @@ static void set_links_homedir(const char *homedir) {
289} 289}
290 290
291static const char *get_sudo_user(void) { 291static const char *get_sudo_user(void) {
292 const char *user = getenv("SUDO_USER"); 292 const char *doas_user = getenv("DOAS_USER");
293 const char *sudo_user = getenv("SUDO_USER");
294 const char *user = doas_user ? doas_user : sudo_user;
295
293 if (!user) { 296 if (!user) {
294 user = getpwuid(getuid())->pw_name; 297 user = getpwuid(getuid())->pw_name;
295 if (!user) { 298 if (!user) {
diff --git a/src/jailcheck/main.c b/src/jailcheck/main.c
index 93d334c7a..6cc5cf904 100644
--- a/src/jailcheck/main.c
+++ b/src/jailcheck/main.c
@@ -86,7 +86,7 @@ int main(int argc, char **argv) {
86 86
87 // user setup 87 // user setup
88 if (getuid() != 0) { 88 if (getuid() != 0) {
89 fprintf(stderr, "Error: you need to be root (via sudo) to run this program\n"); 89 fprintf(stderr, "Error: you need to be root (via sudo or doas) to run this program\n");
90 exit(1); 90 exit(1);
91 } 91 }
92 user_name = get_sudo_user(); 92 user_name = get_sudo_user();
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
28char *get_sudo_user(void) { 28char *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) {
diff --git a/src/man/firecfg.1.in b/src/man/firecfg.1.in
index 42add6a41..a85fbc5da 100644
--- a/src/man/firecfg.1.in
+++ b/src/man/firecfg.1.in
@@ -23,7 +23,9 @@ The integration covers:
23- programs started by clicking on file icons in file manager - only Cinnamon, KDE, LXDE/LXQT, MATE and XFCE 23- programs started by clicking on file icons in file manager - only Cinnamon, KDE, LXDE/LXQT, MATE and XFCE
24desktop managers are supported in this moment 24desktop managers are supported in this moment
25.RE 25.RE
26 26.PP
27Note: The examples use \fBsudo\fR, but \fBdoas\fR is also supported.
28.PP
27To set it up, run "sudo firecfg" after installing Firejail software. 29To set it up, run "sudo firecfg" after installing Firejail software.
28The same command should also be run after 30The same command should also be run after
29installing new programs. If the program is supported by Firejail, the symbolic link in /usr/local/bin 31installing new programs. If the program is supported by Firejail, the symbolic link in /usr/local/bin
diff --git a/src/man/jailcheck.1.in b/src/man/jailcheck.1.in
index e889ea91b..eea5987b7 100644
--- a/src/man/jailcheck.1.in
+++ b/src/man/jailcheck.1.in
@@ -24,9 +24,8 @@ them from inside the sandbox.
24\fB5. Seccomp test 24\fB5. Seccomp test
25.TP 25.TP
26\fB6. Networking test 26\fB6. Networking test
27.TP 27.PP
28The program is started as root using sudo. 28The program should be started using \fBsudo\fR or \fBdoas\fR.
29
30.SH OPTIONS 29.SH OPTIONS
31.TP 30.TP
32\fB\-\-debug 31\fB\-\-debug