summaryrefslogtreecommitdiffstats
path: root/src/firstboot
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-08-09 17:03:15 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2023-08-16 12:52:56 +0200
commitbb44fd073402cdfdbf2dfee549708a93c7c73aaf (patch)
tree802e8c24a376d24c86c0b89b4aec5cc227177881 /src/firstboot
parentlibsystemd-network: use _NEG_ macros to reduce indentation (diff)
downloadsystemd-bb44fd073402cdfdbf2dfee549708a93c7c73aaf.tar.xz
systemd-bb44fd073402cdfdbf2dfee549708a93c7c73aaf.zip
various: use _NEG_ macros to reduce indentation
No functional change intended.
Diffstat (limited to 'src/firstboot')
-rw-r--r--src/firstboot/firstboot.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/firstboot/firstboot.c b/src/firstboot/firstboot.c
index 59d4dcd118..87a82df4ee 100644
--- a/src/firstboot/firstboot.c
+++ b/src/firstboot/firstboot.c
@@ -792,13 +792,11 @@ static int prompt_root_password(int rfd) {
}
r = check_password_quality(*a, /* old */ NULL, "root", &error);
- if (r < 0) {
- if (ERRNO_IS_NOT_SUPPORTED(r))
- log_warning("Password quality check is not supported, proceeding anyway.");
- else
- return log_error_errno(r, "Failed to check password quality: %m");
- }
- if (r == 0)
+ if (ERRNO_IS_NEG_NOT_SUPPORTED(r))
+ log_warning("Password quality check is not supported, proceeding anyway.");
+ else if (r < 0)
+ return log_error_errno(r, "Failed to check password quality: %m");
+ else if (r == 0)
log_warning("Password is weak, accepting anyway: %s", error);
r = ask_password_tty(-1, msg2, NULL, 0, 0, NULL, &b);