int ret;
struct generic_userns_exec_data wrap;
+ if (!ops->hierarchies)
+ return;
+
wrap.origuid = 0;
wrap.container_cgroup = ops->container_cgroup;
wrap.hierarchies = ops->hierarchies;
if (!conf)
return bret;
+ if (!ops->hierarchies)
+ return true;
+
if (conf->cgroup_meta.dir)
tmp = lxc_string_join("/",
(const char *[]){conf->cgroup_meta.dir,
if (!conf)
return false;
+ if (!ops->hierarchies)
+ return true;
+
if (conf->cgroup_meta.dir)
tmp = lxc_string_join("/", (const char *[]){conf->cgroup_meta.dir, handler->name, NULL}, false);
else
int len;
char pidstr[INTTYPE_TO_STRLEN(pid_t)];
+ if (!ops->hierarchies)
+ return true;
+
len = snprintf(pidstr, sizeof(pidstr), "%d", pid);
if (len < 0 || (size_t)len >= sizeof(pidstr))
return false;
if (lxc_list_empty(&conf->id_map))
return true;
+ if (!ops->hierarchies)
+ return true;
+
wrap.origuid = geteuid();
wrap.path = NULL;
wrap.hierarchies = ops->hierarchies;
char *tmpfspath = NULL;
bool has_cgns = false, retval = false, wants_force_mount = false;
+ if (!ops->hierarchies)
+ return true;
+
if ((type & LXC_AUTO_CGROUP_MASK) == 0)
return true;
{
int i;
- if (conf->cgroup_meta.relative || geteuid())
+ if (conf->cgroup_meta.relative || geteuid() || !ops->hierarchies)
return true;
for (i = 0; ops->hierarchies[i]; i++) {
__cgfsng_ops static int cgfsng_num_hierarchies(struct cgroup_ops *ops)
{
- int i;
+ int i = 0;
+
+ if (!ops->hierarchies)
+ return 0;
- for (i = 0; ops->hierarchies[i]; i++)
+ for (; ops->hierarchies[i]; i++)
;
return i;
{
int i;
+ if (!ops->hierarchies)
+ return false;
+
/* sanity check n */
for (i = 0; i < n; i++)
if (!ops->hierarchies[i])
int i, len, ret;
char pidstr[INTTYPE_TO_STRLEN(pid_t)];
+ if (!ops->hierarchies)
+ return true;
+
len = snprintf(pidstr, sizeof(pidstr), "%d", pid);
if (len < 0 || (size_t)len >= sizeof(pidstr))
return false;
if (lxc_list_empty(cgroup_settings))
return true;
+ if (!ops->hierarchies)
+ return false;
+
sorted_cgroup_settings = sort_cgroup_settings(cgroup_settings);
if (!sorted_cgroup_settings)
return false;