mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
auth: initial implementation + some filesystem checks
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user