Skip to content

Commit

Permalink
lsm: s/lsm_init/lsm_init_static/g
Browse files Browse the repository at this point in the history
Make it clear that there is nothing to free here.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 26, 2021
1 parent 65880ef commit 19615bf
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/lxc/attach.c
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/lxc/lsm/lsm.c
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/lxc/lsm/lsm.h
Expand Up @@ -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 */
2 changes: 1 addition & 1 deletion src/lxc/start.c
Expand Up @@ -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. */
Expand Down
2 changes: 1 addition & 1 deletion src/tests/attach.c
Expand Up @@ -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) {
Expand Down

0 comments on commit 19615bf

Please sign in to comment.