various: use _NEG_ macros to reduce indentation

No functional change intended.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2023-08-16 12:52:56 +02:00
parent 1f2db2e315
commit bb44fd0734
23 changed files with 188 additions and 255 deletions
+5 -7
View File
@@ -159,13 +159,11 @@ int enroll_password(
}
r = check_password_quality(new_password, /* old */ NULL, /* user */ NULL, &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("Specified password does not pass quality checks (%s), proceeding anyway.", error);
keyslot = crypt_keyslot_add_by_volume_key(