]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lsm: s/lsm_init/lsm_init_static/g
authorChristian Brauner <christian.brauner@ubuntu.com>
Thu, 28 Jan 2021 18:19:32 +0000 (19:19 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Fri, 29 Jan 2021 09:20:15 +0000 (10:20 +0100)
Make it clear that there is nothing to free here.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/attach.c
src/lxc/lsm/lsm.c
src/lxc/lsm/lsm.h
src/lxc/start.c
src/tests/attach.c

index 41af5685054e05cf1f988e50dfc9e89f8e0ebc66..3b31a39ed195959db1c3e7ab8663568ec904cdd5 100644 (file)
@@ -120,7 +120,7 @@ static int get_attach_context(struct attach_context *ctx,
        if (!found)
                return log_error_errno(-ENOENT, ENOENT, "Failed to read capability bounding set from %s", proc_fn);
 
-       ctx->lsm_ops = lsm_init();
+       ctx->lsm_ops = lsm_init_static();
 
        ctx->lsm_label = ctx->lsm_ops->process_label_get(ctx->lsm_ops, ctx->init_pid);
        ctx->ns_inherited = 0;
index 7fe34bfb035b7917af14a2d3653e1a4140ca7191..f6692e4eeeb35295169292f247e74f125115e40f 100644 (file)
@@ -21,7 +21,7 @@ __hidden extern struct lsm_ops *lsm_apparmor_ops_init(void);
 __hidden extern struct lsm_ops *lsm_selinux_ops_init(void);
 __hidden extern struct lsm_ops *lsm_nop_ops_init(void);
 
-struct lsm_ops *lsm_init(void)
+struct lsm_ops *lsm_init_static(void)
 {
        struct lsm_ops *ops = NULL;
 
index 52d4364255872b4e40895949b5387efa2b37166a..ddbc5949bbdecd05281dcc5fc86ef564e799b5df 100644 (file)
@@ -33,6 +33,6 @@ struct lsm_ops {
        int (*process_label_set_at)(struct lsm_ops *ops, int label_fd, const char *label, bool on_exec);
 };
 
-__hidden extern struct lsm_ops *lsm_init(void);
+__hidden extern struct lsm_ops *lsm_init_static(void);
 
 #endif /* __LXC_LSM_H */
index 863ae123b3e9b2b0a4e986d705d7243d220fe0da..9370465c9fc7f201f7c0409c32463cc52b09dcdd 100644 (file)
@@ -728,7 +728,7 @@ int lxc_init(const char *name, struct lxc_handler *handler)
        if (status_fd < 0)
                return log_error_errno(-1, errno, "Failed to open monitor status fd");
 
-       handler->lsm_ops = lsm_init();
+       handler->lsm_ops = lsm_init_static();
        TRACE("Initialized LSM");
 
        /* Begin by setting the state to STARTING. */
index 879017fd819551b7cddd41b6097f3754208e2778..fbc75fa00783db1382a7015fbe88dc06c6124eba 100644 (file)
@@ -400,7 +400,7 @@ int main(int argc, char *argv[])
 
        (void)strlcpy(template, P_tmpdir"/attach_XXXXXX", sizeof(template));
 
-       lsm_ops = lsm_init();
+       lsm_ops = lsm_init_static();
 
        i = lxc_make_tmpfile(template, false);
        if (i < 0) {