auth: initial implementation + some filesystem checks

This commit is contained in:
Matheus
2024-08-24 20:00:46 -03:00
parent dd70116695
commit 4d51507953
19 changed files with 251 additions and 34 deletions
+6 -6
View File
@@ -7,9 +7,9 @@ int cred_setuids(cred_t *cred, int uid, int euid, int suid) {
// TODO do permission check to see if its possible
cred->uid = uid;
cred->euid = euid;
cred->suid = suid;
cred->uid = (uid == -1) ? cred->uid : uid;
cred->euid = (euid == -1) ? cred->euid : euid;
cred->suid = (suid == -1) ? cred->suid : suid;
return 0;
}
@@ -20,9 +20,9 @@ int cred_setgids(cred_t *cred, int gid, int egid, int sgid) {
// TODO do permission check to see if its possible
cred->gid = gid;
cred->egid = egid;
cred->sgid = sgid;
cred->gid = (gid == -1) ? cred->gid : gid;
cred->egid = (egid == -1) ? cred->egid : egid;
cred->sgid = (sgid == -1) ? cred->sgid : sgid;
return 0;
}