mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-14 19:19:47 +00:00
conf: fix lxc.prlimit clearing
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
This commit is contained in:
parent
4bc717d6e3
commit
b668653c52
@ -3293,13 +3293,12 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
|
|||||||
bool all = false;
|
bool all = false;
|
||||||
const char *k = NULL;
|
const char *k = NULL;
|
||||||
|
|
||||||
if (strcmp(key, "lxc.limit") == 0
|
if (strcmp(key, "lxc.limit") == 0 || strcmp(key, "lxc.prlimit") == 0)
|
||||||
|| strcmp(key, "lxc.prlimit"))
|
|
||||||
all = true;
|
all = true;
|
||||||
else if (strncmp(key, "lxc.limit.", sizeof("lxc.limit.")-1) == 0)
|
else if (strncmp(key, "lxc.limit.", sizeof("lxc.limit.") - 1) == 0)
|
||||||
k = key + sizeof("lxc.limit.")-1;
|
k = key + sizeof("lxc.limit.") - 1;
|
||||||
else if (strncmp(key, "lxc.prlimit.", sizeof("lxc.prlimit.")-1) == 0)
|
else if (strncmp(key, "lxc.prlimit.", sizeof("lxc.prlimit.") - 1) == 0)
|
||||||
k = key + sizeof("lxc.prlimit.")-1;
|
k = key + sizeof("lxc.prlimit.") - 1;
|
||||||
else
|
else
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
@ -3312,6 +3311,7 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
|
|||||||
free(lim);
|
free(lim);
|
||||||
free(it);
|
free(it);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user