From: Lennart Poettering Date: Wed, 13 Apr 2022 21:07:26 +0000 (+0200) Subject: execute: share error path between reg file/dir credential loading X-Git-Tag: v251-rc2~75^2~5 X-Git-Url: http://git-history.diyao.me/?a=commitdiff_plain;h=61c5a49eb251264a875a23527346698d6390445b;p=systemd%2F.git execute: share error path between reg file/dir credential loading --- 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