2008-02-28 00:52:31 +00:00
|
|
|
#ifndef _SPL_CRED_H
|
|
|
|
#define _SPL_CRED_H
|
2008-02-26 20:36:04 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-02-27 19:09:51 +00:00
|
|
|
#include <linux/module.h>
|
2008-03-11 20:54:40 +00:00
|
|
|
#include <sys/types.h>
|
2008-03-15 00:05:38 +00:00
|
|
|
#include <sys/vfs.h>
|
2008-02-26 20:36:04 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
#ifdef HAVE_CRED_STRUCT
|
2008-02-26 20:36:04 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
typedef struct cred cred_t;
|
2008-03-07 20:48:44 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
#define kcred ((cred_t *)(init_task.cred))
|
|
|
|
#define CRED() ((cred_t *)current_cred())
|
2008-03-07 20:48:44 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
#else
|
2008-03-07 20:48:44 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
typedef struct task_struct cred_t;
|
2008-03-07 20:48:44 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
#define kcred ((cred_t *)&init_task)
|
|
|
|
#define CRED() ((cred_t *)current)
|
2009-07-10 17:58:06 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
#endif /* HAVE_CRED_STRUCT */
|
2009-07-10 17:58:06 +00:00
|
|
|
|
2009-07-28 00:18:59 +00:00
|
|
|
extern void crhold(cred_t *cr);
|
|
|
|
extern void crfree(cred_t *cr);
|
|
|
|
extern uid_t crgetuid(const cred_t *cr);
|
|
|
|
extern uid_t crgetruid(const cred_t *cr);
|
|
|
|
extern uid_t crgetsuid(const cred_t *cr);
|
|
|
|
extern gid_t crgetgid(const cred_t *cr);
|
|
|
|
extern gid_t crgetrgid(const cred_t *cr);
|
|
|
|
extern gid_t crgetsgid(const cred_t *cr);
|
|
|
|
extern int crgetngroups(const cred_t *cr);
|
|
|
|
extern gid_t * crgetgroups(const cred_t *cr);
|
|
|
|
extern int groupmember(gid_t gid, const cred_t *cr);
|
2009-07-10 17:58:06 +00:00
|
|
|
|
2008-02-26 20:36:04 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-02-28 00:52:31 +00:00
|
|
|
#endif /* _SPL_CRED_H */
|