diff options
author | Lennart Poettering <lennart@poettering.net> | 2022-04-13 23:07:26 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2022-04-22 11:32:47 +0200 |
commit | 61c5a49eb251264a875a23527346698d6390445b (patch) | |
tree | b11c505aed6177b03fc14efdf77adc0334a1b5e9 | |
parent | execute: correct comments (diff) | |
download | systemd-61c5a49eb251264a875a23527346698d6390445b.tar.xz systemd-61c5a49eb251264a875a23527346698d6390445b.zip |
execute: share error path between reg file/dir credential loading
-rw-r--r-- | src/core/execute.c | 14 |
1 files 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 |