mirror of
https://github.com/sudo-project/sudo.git
synced 2025-08-22 09:57:41 +00:00
Fix getting ppid in get_process_ttyname for Linux.
The ppid field in /proc/self/stat is the fourth and not the third. The latter is the process state (S, R, etc.). Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@green-communications.fr>
This commit is contained in:
parent
01b1410d61
commit
5794e511da
@ -301,7 +301,7 @@ get_process_ttyname(char *name, size_t namelen)
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (field == 3) {
|
||||
if (field == 4) {
|
||||
ppid =
|
||||
(int)sudo_strtonum(cp, INT_MIN, INT_MAX, NULL);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user