mirror of
https://github.com/troglobit/finit.git
synced 2026-10-28 12:30:44 +00:00
cgroup: run all ttys, except rescue sh, in getty cgroup until login
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
61781c72fe
commit
b921b8cf0f
1 file changed
+4
-10
+4
-10
@@ -398,6 +398,8 @@ pid_t run_getty(char *tty, char *baud, char *term, int noclear, int nowait, stru
|
|||||||
_exit(rc);
|
_exit(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cgroup_user("getty", pid);
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -419,14 +421,7 @@ pid_t run_getty2(char *tty, char *cmd, char *args[], int noclear, int nowait, st
|
|||||||
_exit(rc);
|
_exit(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
cgroup_user("getty", pid);
|
||||||
* at this point we're just guessing the username
|
|
||||||
* would be nice to catch new logins dynamically
|
|
||||||
* and add them to the correct group, this would
|
|
||||||
* also work for SSH/Telnet logins.
|
|
||||||
*/
|
|
||||||
if (pid > 1)
|
|
||||||
cgroup_user("root", pid);
|
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
@@ -446,8 +441,7 @@ pid_t run_sh(char *tty, int noclear, int nowait, struct rlimit rlimit[])
|
|||||||
_exit(rc);
|
_exit(rc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pid > 1)
|
cgroup_user("root", pid);
|
||||||
cgroup_user("root", pid);
|
|
||||||
|
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user