From 8254a475893e746eb667c0666a69a871d7fc4732 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 13 Apr 2011 21:24:17 +0200 Subject: [PATCH] ask-password: properly accept empty passwords from agent --- src/ask-password-api.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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; } -- 2.30.2