* namespace.
*/
static int get_process_controllers(Set **ret) {
- _cleanup_set_free_free_ Set *controllers = NULL;
+ _cleanup_set_free_ Set *controllers = NULL;
_cleanup_fclose_ FILE *f = NULL;
int r;
assert(ret);
- controllers = set_new(&string_hash_ops);
- if (!controllers)
- return -ENOMEM;
-
f = fopen("/proc/self/cgroup", "re");
if (!f)
return errno == ENOENT ? -ESRCH : -errno;
if (STR_IN_SET(l, "", "name=systemd", "name=unified"))
continue;
- r = set_put_strdup(controllers, l);
+ r = set_put_strdup(&controllers, l);
if (r < 0)
return r;
}
uid_t uid_range,
const char *selinux_apifs_context) {
- _cleanup_set_free_free_ Set *controllers = NULL;
+ _cleanup_set_free_ Set *controllers = NULL;
const char *cgroup_root = "/sys/fs/cgroup", *c;
int r;
* uid/gid as seen from e.g. /proc/1/mountinfo. So we simply
* pass uid 0 and not uid_shift to tmpfs_patch_options().
*/
- r = tmpfs_patch_options("mode=755", 0, selinux_apifs_context, &options);
+ r = tmpfs_patch_options("mode=755" TMPFS_LIMITS_SYS_FS_CGROUP, 0, selinux_apifs_context, &options);
if (r < 0)
return log_oom();
if (r == 0) {
_cleanup_free_ char *options = NULL;
- r = tmpfs_patch_options("mode=755", uid_shift == 0 ? UID_INVALID : uid_shift, selinux_apifs_context, &options);
+ r = tmpfs_patch_options("mode=755" TMPFS_LIMITS_SYS_FS_CGROUP, uid_shift == 0 ? UID_INVALID : uid_shift, selinux_apifs_context, &options);
if (r < 0)
return log_oom();