2008-02-28 03:52:31 +03:00
|
|
|
#ifndef _SPL_CRED_H
|
|
|
|
#define _SPL_CRED_H
|
2008-02-26 23:36:04 +03:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2008-02-27 22:09:51 +03:00
|
|
|
#include <linux/module.h>
|
2008-03-11 23:54:40 +03:00
|
|
|
#include <sys/types.h>
|
2008-03-15 03:05:38 +03:00
|
|
|
#include <sys/vfs.h>
|
2008-02-26 23:36:04 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
#ifdef HAVE_CRED_STRUCT
|
2008-02-26 23:36:04 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
typedef struct cred cred_t;
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
#define kcred ((cred_t *)(init_task.cred))
|
|
|
|
#define CRED() ((cred_t *)current_cred())
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
#else
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
typedef struct task_struct cred_t;
|
2008-03-07 23:48:44 +03:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
#define kcred ((cred_t *)&init_task)
|
|
|
|
#define CRED() ((cred_t *)current)
|
2009-07-10 21:58:06 +04:00
|
|
|
|
2009-07-28 04:18:59 +04:00
|
|
|
#endif /* HAVE_CRED_STRUCT */
|
2009-07-10 21:58:06 +04:00
|
|
|
|
2009-07-28 04:18:59 +04: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 21:58:06 +04:00
|
|
|
|
2008-02-26 23:36:04 +03:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2008-02-28 03:52:31 +03:00
|
|
|
#endif /* _SPL_CRED_H */
|