From: Lennart Poettering Date: Wed, 13 Apr 2011 19:24:17 +0000 (+0200) Subject: ask-password: properly accept empty passwords from agent X-Git-Tag: v25~57 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=8254a475893e746eb667c0666a69a871d7fc4732 ask-password: properly accept empty passwords from agent --- diff --git a/src/ask-password-api.c b/src/ask-password-api.c index da967ab7a..384cfc8f8 100644 --- a/src/ask-password-api.c +++ b/src/ask-password-api.c @@ -481,7 +481,13 @@ int ask_password_agent( if (passphrase[0] == '+') { char **l; - if (!(l = strv_parse_nulstr(passphrase+1, n-1))) { + if (n == 1) + l = strv_new("", NULL); + else + l = strv_parse_nulstr(passphrase+1, n-1); + /* An empty message refers to the empty password */ + + if (!l) { r = -ENOMEM; goto finish; }