stat-util: generalize is_* and verify_* handling

This commit is contained in:
Mike Yuan
2024-03-04 19:53:51 +00:00
committed by Luca Boccassi
parent 2492c89af0
commit 2560dcbfe6
6 changed files with 133 additions and 134 deletions
+1 -3
View File
@@ -1066,10 +1066,8 @@ static int process_root_account(int rfd) {
FOREACH_STRING(s, "passwd", "shadow") {
r = verify_regular_at(pfd, s, /* follow = */ false);
if (IN_SET(r, -EISDIR, -ELOOP, -EBADFD))
return log_error_errno(r, "/etc/%s is not a regular file", s);
if (r < 0 && r != -ENOENT)
return log_error_errno(r, "Failed to check whether /etc/%s is a regular file: %m", s);
return log_error_errno(r, "Verification of /etc/%s being regular file failed: %m", s);
r = should_configure(pfd, s);
if (r < 0)