]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/sys/cred.h
Apply a nice fix caught by Ricardo,
[FreeBSD/FreeBSD.git] / include / sys / cred.h
1 #ifndef _SPL_CRED_H
2 #define _SPL_CRED_H
3
4 #ifdef  __cplusplus
5 extern "C" {
6 #endif
7
8 #include <linux/module.h>
9 #include <sys/types.h>
10 #include <sys/vfs.h>
11
12 /* XXX - Portions commented out because we really just want to have the type
13  * defined and the contents aren't nearly so important at the moment. */
14 typedef struct cred {
15         uint_t          cr_ref;         /* reference count */
16         uid_t           cr_uid;         /* effective user id */
17         gid_t           cr_gid;         /* effective group id */
18         uid_t           cr_ruid;        /* real user id */
19         gid_t           cr_rgid;        /* real group id */
20         uid_t           cr_suid;        /* "saved" user id (from exec) */
21         gid_t           cr_sgid;        /* "saved" group id (from exec) */
22         uint_t          cr_ngroups;     /* number of groups returned by */
23                                         /* crgroups() */
24 #if 0
25         cred_priv_t     cr_priv;        /* privileges */
26         projid_t        cr_projid;      /* project */
27         struct zone     *cr_zone;       /* pointer to per-zone structure */
28         struct ts_label_s *cr_label;    /* pointer to the effective label */
29         credsid_t       *cr_ksid;       /* pointer to SIDs */
30 #endif
31         gid_t           cr_groups[1];   /* cr_groups size not fixed */
32                                         /* audit info is defined dynamically */
33                                         /* and valid only when audit enabled */
34         /* auditinfo_addr_t     cr_auinfo;      audit info */
35 } cred_t;
36
37 #define kcred                           NULL
38 #define CRED()                          NULL
39
40 static __inline__ uid_t
41 crgetuid(cred_t *cr)
42 {
43         return 0;
44 }
45
46 static __inline__ gid_t
47 crgetgid(cred_t *cr)
48 {
49         return 0;
50 }
51
52 static __inline__ int
53 crgetngroups(cred_t *cr)
54 {
55         return 0;
56 }
57
58 static __inline__ gid_t *
59 crgetgroups(cred_t *cr)
60 {
61         return NULL;
62 }
63
64 #ifdef  __cplusplus
65 }
66 #endif
67
68 #endif  /* _SPL_CRED_H */