mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 17:12:14 +00:00
fix compile without apparmor (against git staging)
Add a few missing #if's to fix compilation when configured without AppArmor. Signed-off-by: Dwight Engen <dwight.engen@oracle.com> Acked-by: Serge E. Hallyn <serge.hallyn@canonical.com>
This commit is contained in:
parent
87540ad7d8
commit
1f530df632
@ -2566,8 +2566,10 @@ void lxc_conf_free(struct lxc_conf *conf)
|
|||||||
if (conf->rootfs.mount != LXCROOTFSMOUNT)
|
if (conf->rootfs.mount != LXCROOTFSMOUNT)
|
||||||
free(conf->rootfs.mount);
|
free(conf->rootfs.mount);
|
||||||
lxc_clear_config_network(conf);
|
lxc_clear_config_network(conf);
|
||||||
|
#if HAVE_APPARMOR
|
||||||
if (conf->aa_profile)
|
if (conf->aa_profile)
|
||||||
free(conf->aa_profile);
|
free(conf->aa_profile);
|
||||||
|
#endif
|
||||||
lxc_clear_config_caps(conf);
|
lxc_clear_config_caps(conf);
|
||||||
lxc_clear_cgroups(conf, "lxc.cgroup");
|
lxc_clear_cgroups(conf, "lxc.cgroup");
|
||||||
lxc_clear_hooks(conf);
|
lxc_clear_hooks(conf);
|
||||||
|
@ -1523,8 +1523,10 @@ int lxc_get_config_item(struct lxc_conf *c, char *key, char *retv, int inlen)
|
|||||||
v = c->ttydir;
|
v = c->ttydir;
|
||||||
else if (strcmp(key, "lxc.arch") == 0)
|
else if (strcmp(key, "lxc.arch") == 0)
|
||||||
return lxc_get_arch_entry(c, retv, inlen);
|
return lxc_get_arch_entry(c, retv, inlen);
|
||||||
|
#if HAVE_APPARMOR
|
||||||
else if (strcmp(key, "lxc.aa_profile") == 0)
|
else if (strcmp(key, "lxc.aa_profile") == 0)
|
||||||
v = c->aa_profile;
|
v = c->aa_profile;
|
||||||
|
#endif
|
||||||
else if (strcmp(key, "lxc.cgroup") == 0) // all cgroup info
|
else if (strcmp(key, "lxc.cgroup") == 0) // all cgroup info
|
||||||
return lxc_get_cgroup_entry(c, retv, inlen, "all");
|
return lxc_get_cgroup_entry(c, retv, inlen, "all");
|
||||||
else if (strncmp(key, "lxc.cgroup.", 11) == 0) // specific cgroup info
|
else if (strncmp(key, "lxc.cgroup.", 11) == 0) // specific cgroup info
|
||||||
@ -1598,8 +1600,10 @@ void write_config(FILE *fout, struct lxc_conf *c)
|
|||||||
case PER_LINUX: fprintf(fout, "lxc.arch = x86_64\n"); break;
|
case PER_LINUX: fprintf(fout, "lxc.arch = x86_64\n"); break;
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
|
#if HAVE_APPARMOR
|
||||||
if (c->aa_profile)
|
if (c->aa_profile)
|
||||||
fprintf(fout, "lxc.aa_profile = %s\n", c->aa_profile);
|
fprintf(fout, "lxc.aa_profile = %s\n", c->aa_profile);
|
||||||
|
#endif
|
||||||
lxc_list_for_each(it, &c->cgroup) {
|
lxc_list_for_each(it, &c->cgroup) {
|
||||||
struct lxc_cgroup *cg = it->elem;
|
struct lxc_cgroup *cg = it->elem;
|
||||||
fprintf(fout, "lxc.cgroup.%s = %s\n", cg->subsystem, cg->value);
|
fprintf(fout, "lxc.cgroup.%s = %s\n", cg->subsystem, cg->value);
|
||||||
|
Loading…
Reference in New Issue
Block a user