/* create or remove directory */
if (do_remove) {
+ if (!dir_exists(buf))
+ return 0;
if (recurse)
r = cgroup_rmdir(buf);
else
uid_t destuid;
char *fpath;
-
if (setresgid(0,0,0) < 0)
SYSERROR("Failed to setgid to 0");
if (setresuid(0,0,0) < 0)
if (chown(fpath, destuid, 0) < 0)
SYSERROR("Error chowning %s\n", fpath);
free(fpath);
+
fpath = lxc_append_paths(arg->cgroup_path, "cgroup.procs");
if (!fpath)
return -1;
struct chown_data data;
char *fpath;
+ if (!dir_exists(cgroup_path))
+ return true;
+
if (lxc_list_empty(&conf->id_map))
/* If there's no mapping then we don't need to chown */
return true;