revisit join-or-start hidepid fix

cf. 9eb9e8d4c1

No need to expect pid's in profile files.
This commit is contained in:
smitsohu 2020-11-25 17:07:53 +01:00
parent 85c0544781
commit d840718ef1

View file

@ -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();