diff options
author | Lukas Nykryn <lnykryn@redhat.com> | 2012-08-20 14:39:08 +0200 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2012-08-23 13:53:30 +0200 |
commit | a34faf579d2be139b0b9e8cd0c73ad4d918ef736 (patch) | |
tree | 098f3d4f4b2a7611b7e2b8f1a8ae29cff5ca39b7 /src | |
parent | b5fb37899d34ec16f2a88dc3a8be3f4f7bf12ef3 (diff) |
login: check return of parse_pid and parse_uid
Diffstat (limited to 'src')
-rw-r--r-- | src/login/logind-inhibit.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c index 96b7c6cd7e..60b6237ce5 100644 --- a/src/login/logind-inhibit.c +++ b/src/login/logind-inhibit.c @@ -219,11 +219,17 @@ int inhibitor_load(Inhibitor *i) { if (mm >= 0) i->mode = mm; - if (uid) - parse_uid(uid, &i->uid); + if (uid) { + r = parse_uid(uid, &i->uid); + if (r < 0) + goto finish; + } - if (pid) - parse_pid(pid, &i->pid); + if (pid) { + r = parse_pid(pid, &i->pid); + if (r < 0) + goto finish; + } if (who) { cc = cunescape(who); |