The current code causes assertion in strv_parse_nulstr() if
read_credential() results in an error different from ENXIO or ENOENT
(strace shows I'm getting EACCES):
# homectl create waldo --real-name=Waldo --disk-size=200M
Before:
Assertion 's || l <= 0' failed at src/basic/nulstr-util.c:32, function strv_parse_nulstr_full(). Aborting.
After:
Failed to acquire password: Permission denied
Follow-up-for:
8806bb4bc7fa15d6ca46e81b8d535730209a3b66
r = read_credential(req->credential, (void**) &buffer, &size);
if (IN_SET(r, -ENXIO, -ENOENT)) /* No credentials passed or this credential not defined? */
return -ENOKEY;
+ if (r < 0)
+ return r;
l = strv_parse_nulstr(buffer, size);
if (!l)