]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
execute: simplify 'load_creds_args' struct a bit
authorLennart Poettering <lennart@poettering.net>
Wed, 13 Apr 2022 20:51:13 +0000 (22:51 +0200)
committerLennart Poettering <lennart@poettering.net>
Fri, 22 Apr 2022 09:32:46 +0000 (11:32 +0200)
Given we only need a single field off the ExecLoadCredential structure
we don't have to link it as a whole, but just copy that one bit over
directly, simplifying the struct a bit.

src/core/execute.c

index eb06215266c4e1bba6d5d4b520da37e5b44b3189..de6ea283665b2375557d846d49c192ca5b951f5f 100644 (file)
@@ -2701,7 +2701,7 @@ struct load_cred_args {
         Set *seen_creds;
         const ExecContext *context;
         const ExecParameters *params;
-        ExecLoadCredential *parent_load_credential;
+        bool encrypted;
         const char *unit;
         int dfd;
         uid_t uid;
@@ -2749,7 +2749,7 @@ static int load_cred_recurse_dir_cb(
                         args->params,
                         sub_id,
                         de->d_name,
-                        args->parent_load_credential->encrypted,
+                        args->encrypted,
                         args->unit,
                         dir_fd,
                         args->dfd,
@@ -2837,7 +2837,7 @@ static int acquire_credentials(
                                                 .seen_creds = seen_creds,
                                                 .context = context,
                                                 .params = params,
-                                                .parent_load_credential = lc,
+                                                .encrypted = lc->encrypted,
                                                 .unit = unit,
                                                 .dfd = dfd,
                                                 .uid = uid,