summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2022-04-13 23:07:26 +0200
committerLennart Poettering <lennart@poettering.net>2022-04-22 11:32:47 +0200
commit61c5a49eb251264a875a23527346698d6390445b (patch)
treeb11c505aed6177b03fc14efdf77adc0334a1b5e9
parentexecute: correct comments (diff)
downloadsystemd-61c5a49eb251264a875a23527346698d6390445b.tar.xz
systemd-61c5a49eb251264a875a23527346698d6390445b.zip
execute: share error path between reg file/dir credential loading
-rw-r--r--src/core/execute.c14
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