diff options
| author | Michael Biebl <biebl@debian.org> | 2016-05-11 17:09:14 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-05-11 17:09:14 +0200 |
| commit | c74718aa5a356199a1ff957b2579153d54be9dd5 (patch) | |
| tree | cf3ade8c1e7322792ec140f09ee5e083382c5c48 /src/nm-auth-subject.c | |
| parent | 6bb523977deede318916fe01c78f776d215cebff (diff) | |
| parent | 73e152af6e3fb4f5848bfb8394484026ff119003 (diff) | |
Merge tag 'upstream/1.2.2'
Upstream version 1.2.2
Diffstat (limited to 'src/nm-auth-subject.c')
| -rw-r--r-- | src/nm-auth-subject.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/nm-auth-subject.c b/src/nm-auth-subject.c index 494d52d3..86b873f0 100644 --- a/src/nm-auth-subject.c +++ b/src/nm-auth-subject.c @@ -360,9 +360,18 @@ constructed (GObject *object) priv->unix_process.start_time = nm_utils_get_start_time_for_pid (priv->unix_process.pid, NULL, NULL); if (!priv->unix_process.start_time) { - /* could not detect the process start time. The subject is invalid, but don't - * assert against it. */ - _clear_private (priv); + /* Is the process already gone? Then fail creation of the auth subject + * by clearing the type. */ + if (kill (priv->unix_process.pid, 0) != 0) + _clear_private (priv); + + /* Otherwise, although we didn't detect a start_time, the process is still around. + * That could be due to procfs mounted with hidepid. So just accept the request. + * + * Polkit on the other side, will accept 0 and try to lookup /proc/$PID/stat + * itself (and if it fails to do so, assume a start-time of 0 and proceed). + * The only combination that would fail here, is when NM is able to read the + * start-time, but polkit is not. */ } return; default: |