mirror of
https://github.com/troglobit/finit.git
synced 2026-10-10 16:52:39 +07:00
cgroup: allow adding self (PID 0) to a leaf group
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
+1
-1
@@ -139,7 +139,7 @@ static int cgroup_leaf_init(char *group, char *name, int pid, const char *cfg)
|
||||
char path[256];
|
||||
|
||||
_d("group %s, name %s, pid %d, cfg %s", group, name, pid, cfg ?: "NIL");
|
||||
if (pid <= 1) {
|
||||
if (pid < 0 || pid == 1) {
|
||||
errno = EINVAL;
|
||||
return 1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -185,7 +185,7 @@ static int do_login(char *name)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
cgroup_user(name, getpid());
|
||||
cgroup_user(name, 0);
|
||||
execl(_PATH_LOGIN, _PATH_LOGIN, name, NULL);
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user