cred: setting and getting ids

This commit is contained in:
Matheus
2024-08-16 20:02:12 -03:00
parent 8045dd3de6
commit da9c40b054
13 changed files with 256 additions and 63 deletions
+21
View File
@@ -0,0 +1,21 @@
#ifndef _CRED_H
#define _CRED_H
#define CRED_PERM_SUPERUSER (1l << 63)
#include <stdint.h>
typedef struct {
int uid, euid, suid;
int gid, egid, sgid;
uintmax_t allow;
uintmax_t deny;
} cred_t;
int cred_setuids(cred_t *cred, int uid, int euid, int suid);
int cred_setgids(cred_t *cred, int uid, int euid, int suid);
void cred_getuids(cred_t *cred, int *uidp, int *euidp, int *suidp);
void cred_getgids(cred_t *cred, int *gidp, int *egidp, int *sgidp);
#endif