Kernel/LibC: Implement {get,set,init}groups

This allows dropping /etc/group parsing from the kernel :D
This commit is contained in:
2025-08-10 18:19:31 +03:00
parent f41e254e35
commit af0bca74e4
9 changed files with 150 additions and 161 deletions

View File

@@ -3,6 +3,7 @@
#include <BAN/Vector.h>
#include <fcntl.h>
#include <grp.h>
#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
@@ -94,6 +95,8 @@ int main(int argc, char** argv)
printf("Welcome back %s!\n", pwd->pw_name);
if (initgroups(name_buffer, pwd->pw_gid) == -1)
perror("initgroups");
if (setgid(pwd->pw_gid) == -1)
perror("setgid");
if (setuid(pwd->pw_uid) == -1)