Skip to content

Commit

Permalink
Merge pull request systemd#27714 from yuwata/cryptenroll-password
Browse files Browse the repository at this point in the history
cryptenroll-password: tiny cleanups
  • Loading branch information
YHNdnzj committed May 20, 2023
2 parents b3bd6cc + 70b5389 commit 93773df
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/cryptenroll/cryptenroll-password.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int load_volume_key_password(
envpw,
strlen(envpw));
if (r < 0)
return log_error_errno(r, "Password from environment variable $PASSWORD did not work.");
return log_error_errno(r, "Password from environment variable $PASSWORD did not work: %m");
} else {
AskPasswordFlags ask_password_flags = ASK_PASSWORD_PUSH_CACHE|ASK_PASSWORD_ACCEPT_CACHED;
_cleanup_free_ char *question = NULL, *disk_path = NULL;
Expand All @@ -56,7 +56,7 @@ int load_volume_key_password(

if (--i == 0)
return log_error_errno(SYNTHETIC_ERRNO(ENOKEY),
"Too many attempts, giving up:");
"Too many attempts, giving up.");

r = ask_password_auto(
question, "drive-harddisk", id, "cryptenroll", "cryptenroll.passphrase", USEC_INFINITY,
Expand All @@ -77,10 +77,8 @@ int load_volume_key_password(
if (r >= 0)
break;
}
if (r >= 0)
break;

log_error_errno(r, "Password not correct, please try again.");
log_error_errno(r, "Password not correct, please try again: %m");
ask_password_flags &= ~ASK_PASSWORD_ACCEPT_CACHED;
}
}
Expand Down Expand Up @@ -124,7 +122,7 @@ int enroll_password(

if (--i == 0)
return log_error_errno(SYNTHETIC_ERRNO(ENOKEY),
"Too many attempts, giving up:");
"Too many attempts, giving up.");

question = strjoin("Please enter new passphrase for disk ", node, ":");
if (!question)
Expand Down

0 comments on commit 93773df

Please sign in to comment.