diff options
author | Lennart Poettering <lennart@poettering.net> | 2011-04-13 21:43:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2011-04-13 21:43:36 +0200 |
commit | ded803353137a5b33d3fc460790c0e9b5cb257c1 (patch) | |
tree | 801017fbbc86614f070b342c52ac581b419602dd /src | |
parent | ask-password: support passwords without timeouts (diff) | |
download | systemd-ded803353137a5b33d3fc460790c0e9b5cb257c1.tar.xz systemd-ded803353137a5b33d3fc460790c0e9b5cb257c1.zip |
ask-password: use kill(PID, 0) before querying a password
Diffstat (limited to 'src')
-rw-r--r-- | src/tty-ask-password-agent.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/tty-ask-password-agent.c b/src/tty-ask-password-agent.c index 4a29abacbb..d7e1ebaef6 100644 --- a/src/tty-ask-password-agent.c +++ b/src/tty-ask-password-agent.c @@ -291,6 +291,13 @@ static int parse_password(const char *filename, char **wall) { } } + if (pid > 0 && + kill(pid, 0) < 0 && + errno == ESRCH) { + r = 0; + goto finish; + } + if (arg_action == ACTION_LIST) printf("'%s' (PID %u)\n", message, pid); else if (arg_action == ACTION_WALL) { |