From 61c5a49eb251264a875a23527346698d6390445b Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 13 Apr 2022 23:07:26 +0200 Subject: [PATCH] execute: share error path between reg file/dir credential loading --- src/core/execute.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/src/core/execute.c b/src/core/execute.c index f93c7b7992..a16dbdd0c7 100644 --- a/src/core/execute.c +++ b/src/core/execute.c @@ -2793,9 +2793,8 @@ static int acquire_credentials( if (sub_fd < 0 && errno != ENOTDIR) return -errno; - if (sub_fd < 0) { + if (sub_fd < 0) /* Regular file */ - r = load_credential( context, params, @@ -2808,12 +2807,8 @@ static int acquire_credentials( uid, ownership_ok, &left); - if (r < 0) - return r; - - } else { + else /* Directory */ - r = recurse_dir( sub_fd, /* path= */ lc->id, /* recurse_dir() will suffix the subdir paths from here to the top-level id */ @@ -2831,9 +2826,8 @@ static int acquire_credentials( .ownership_ok = ownership_ok, .left = &left, }); - if (r < 0) - return r; - } + if (r < 0) + return r; } /* Second, we add in literally specified credentials. If the credentials already exist, we'll not add -- 2.25.1