From d840718ef10fa38c18b432f031fcc03aedee9c9a Mon Sep 17 00:00:00 2001 From: smitsohu Date: Wed, 25 Nov 2020 17:07:53 +0100 Subject: [PATCH] revisit join-or-start hidepid fix cf. 9eb9e8d4c1b8995f0e7af4d604f3becd5dc91f62 No need to expect pid's in profile files. --- src/firejail/profile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/firejail/profile.c b/src/firejail/profile.c index dc37a2820..ff8b47102 100644 --- a/src/firejail/profile.c +++ b/src/firejail/profile.c @@ -1497,7 +1497,10 @@ int profile_check_line(char *ptr, int lineno, const char *fname) { if (checkcfg(CFG_JOIN) || getuid() == 0) { // try to join by name only pid_t pid; - if (!read_pid(ptr + 14, &pid)) { + EUID_ROOT(); + int r = name2pid(ptr + 14, &pid); + EUID_USER(); + if (!r) { if (!cfg.shell && !arg_shell_none) cfg.shell = guess_shell();