forked from dtrace4linux/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcred.h
More file actions
45 lines (39 loc) · 1.37 KB
/
cred.h
File metadata and controls
45 lines (39 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# if !defined(SYS_CRED_H)
# define SYS_CRED_H
/**********************************************************************/
/* Linux 2.6.29 introduces 2.6.29, so we need to be careful since */
/* the struct isnt compatible with the Solaris one. We need this */
/* as a container for the identity of a process, so we can simply */
/* map from ours to theirs where we can, else define our own cred */
/* struct for older kernels. */
/**********************************************************************/
# define cr_ruid euid
# define cr_rgid egid
# define cr_uid uid
# define cr_gid gid
# define cr_sgid sgid
# define cr_suid suid
/**********************************************************************/
/* Linux 2.6.29 introduces <linux/cred.h> so we will have a name */
/* clash and struct mem clash. */
/**********************************************************************/
#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 29)
struct cred {
int cr_uid;
int cr_ruid;
int cr_suid;
int cr_gid;
int cr_rgid;
int cr_sgid;
struct zone *cr_zone;
};
# endif
typedef struct cred cred_t;
cred_t *CRED(void);
int priv_policy_only(const cred_t *a, int priv, int allzone);
#define crgetzoneid(p) 0
#define crfree(cred)
#define crgetgid(cred) ((cred)->cr_gid)
#define crgetuid(cred) ((cred)->cr_uid)
//# define curthread current_thread_info()->task
# endif