conf: fix lxc.prlimit clearing

parent a6367676
...@@ -3286,13 +3286,12 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key) ...@@ -3286,13 +3286,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;
...@@ -3305,6 +3304,7 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key) ...@@ -3305,6 +3304,7 @@ int lxc_clear_limits(struct lxc_conf *c, const char *key)
free(lim); free(lim);
free(it); free(it);
} }
return 0; return 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment