summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2011-04-13 21:24:17 +0200
committerLennart Poettering <lennart@poettering.net>2011-04-13 21:24:17 +0200
commit8254a475893e746eb667c0666a69a871d7fc4732 (patch)
tree3ab0b37e7208d0427b96da13c2f6dcbac5826574 /src
parentdf18d8c8959bbd9d7b866c6946aa856e462a06b3 (diff)
ask-password: properly accept empty passwords from agent
Diffstat (limited to 'src')
-rw-r--r--src/ask-password-api.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ask-password-api.c b/src/ask-password-api.c
index da967ab7a1..384cfc8f80 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;
}