forked from Bananymous/banan-os
Kernel: Implement supplementary groups
This code has very ugly file parsing code. I have to create API for reading files line by line in kernel space... This allows users to open framebuffer/input files without root. Mounting has to be moved to userspace soon. It makes no sense to hard code permissions for every (device) file.
This commit is contained in:
@@ -17,7 +17,7 @@ namespace Kernel
|
||||
{ }
|
||||
else if ((mode().mode & S_IRUSR) && credentials.euid() == uid())
|
||||
{ }
|
||||
else if ((mode().mode & S_IRGRP) && credentials.egid() == gid())
|
||||
else if ((mode().mode & S_IRGRP) && credentials.has_egid(gid()))
|
||||
{ }
|
||||
else
|
||||
{
|
||||
@@ -31,7 +31,7 @@ namespace Kernel
|
||||
{ }
|
||||
else if ((mode().mode & S_IWUSR) && credentials.euid() == uid())
|
||||
{ }
|
||||
else if ((mode().mode & S_IWGRP) && credentials.egid() == gid())
|
||||
else if ((mode().mode & S_IWGRP) && credentials.has_egid(gid()))
|
||||
{ }
|
||||
else
|
||||
{
|
||||
@@ -45,7 +45,7 @@ namespace Kernel
|
||||
{ }
|
||||
else if ((mode().mode & S_IXUSR) && credentials.euid() == uid())
|
||||
{ }
|
||||
else if ((mode().mode & S_IXGRP) && credentials.egid() == gid())
|
||||
else if ((mode().mode & S_IXGRP) && credentials.has_egid(gid()))
|
||||
{ }
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user