cgroup: allow adding self (PID 0) to a leaf group

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2021-04-09 18:58:11 +02:00
parent b921b8cf0f
commit f12f53692e
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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
View File
@@ -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);
/*