SystemServer: chown all available TTY devices to the tty group

Since we have 6 TTYs available 2 of the 6 were not being chowned and as
such they were not available to the tty group.
This commit is contained in:
Idan Horowitz 2021-03-29 18:59:51 +03:00 committed by Andreas Kling
parent b88de8a91f
commit 754f87875f
Notes: sideshowbarker 2024-07-18 20:58:34 +09:00

View File

@ -125,11 +125,13 @@ static void prepare_devfs()
// FIXME: Find a better way to chown without hardcoding the gid!
chown_wrapper("/dev/mouse", 0, 3);
for (size_t index = 0; index < 4; index++) {
// FIXME: Count TTYs instead of using a hardcoded amount
for (size_t index = 0; index < 6; index++) {
// FIXME: Find a better way to chown without hardcoding the gid!
chown_wrapper(String::formatted("/dev/tty{}", index).characters(), 0, 2);
}
// FIXME: Count serial TTYs instead of using a hardcoded amount
for (size_t index = 0; index < 4; index++) {
// FIXME: Find a better way to chown without hardcoding the gid!
chown_wrapper(String::formatted("/dev/ttyS{}", index).characters(), 0, 2);