mentos-team / MentOS

An educational 32-bit linux-like Operating System, with public bachelor- and master-level course slides.
https://mentos-team.github.io/
MIT License
127 stars 50 forks source link

Function `getgrgid` does not work #83

Closed Galfurian closed 2 months ago

Galfurian commented 3 months ago

Function getgrgid does not properly retrieve the group.

fischerling commented 3 months ago

Do you have an example, when getgrgid does not work? In my quick and probably oversimplified test using stat, getgrgid seems to work properly with the the users alice(uid=1000) and bob(uid=1001) and the following content of /etc/group .

root:x:0:root
users:x:984:alice,bob
wheel:x:998:alice
alice:x:1000:alice
bob:x:1001:bob
alice $ stat /
File: /
Size: 4.00 KB
File type: directory
Access: (0755/rwxr-xr-x) Uid: (0/root) Gid: (0/root)
...

alice $ stat /home/alice
File: /home/alice
Size: 4.00 KB
File type: directory
Access: (0700/rwx------) Uid: (1000/alice) Gid: (1000/alice)
...

alice $ stat /home/bob
File: /home/bob
Size: 4.00 KB
File type: directory
Access: (0700/rwx------) Uid: (1001/bob) Gid: (1001/bob)
...
fischerling commented 3 months ago

In #85 I added simple tests for getgrgid aswell as for getgrnam. Maybe you can extend those to test the bug you observed with getgrgid.

Galfurian commented 3 months ago

I'll work on it.

fischerling commented 3 months ago

Is this not fixed by #86 ?

Galfurian commented 3 months ago

I meant to keep it open so I remember to extend those tests as soon as possible. But yes, the bug should be solved.

fischerling commented 3 months ago

Something like #90?

Galfurian commented 2 months ago

Thank you very much for #90 !