Merge pull request #10293 from poettering/cryptsetup-fixes

two tiny cryptsetup-generator fixes
This commit is contained in:
Yu Watanabe 2018-10-06 23:35:28 +09:00 committed by GitHub
commit dcf0b8a5be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 3 deletions

View File

@ -152,8 +152,10 @@ static int create_disk(
return log_oom();
}
if (keydev && !password)
return log_error_errno(-EINVAL, "Keydev is specified, but path to the password file is missing: %m");
if (keydev && !password) {
log_error("Key device is specified, but path to the password file is missing.");
return -EINVAL;
}
r = generator_open_unit_file(arg_dest, NULL, n, &f);
if (r < 0)
@ -190,7 +192,7 @@ static int create_disk(
netdev ? "remote-cryptsetup.target" : "cryptsetup.target");
if (password) {
if (STR_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
if (PATH_IN_SET(password, "/dev/urandom", "/dev/random", "/dev/hw_random"))
fputs("After=systemd-random-seed.service\n", f);
else if (!STR_IN_SET(password, "-", "none")) {
_cleanup_free_ char *uu;