aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2014-10-02 13:41:09 -0400
committerBrian Behlendorf <[email protected]>2014-10-17 15:11:51 -0700
commit68a829b29d50b2a0e83222e93cf4897527673a41 (patch)
tree649a0d1b1aad5fce90710e0ea7732195e673bd5a /include
parente39174ed56acd418ef744d43876fc8cf6e9823ab (diff)
Remove credential configure checks.
The groups_search() function was never exported by a mainline kernel therefore we drop this compatibility code and always provide our own implementation. Additionally, the cred_t structure has been available since 2.6.29 so there is no longer a need to maintain compatibility code. Signed-off-by: Brian Behlendorf <[email protected]>
Diffstat (limited to 'include')
-rw-r--r--include/sys/cred.h59
1 files changed, 24 insertions, 35 deletions
diff --git a/include/sys/cred.h b/include/sys/cred.h
index 3ba5c141b..4f62b00fd 100644
--- a/include/sys/cred.h
+++ b/include/sys/cred.h
@@ -29,49 +29,38 @@
#include <sys/types.h>
#include <sys/vfs.h>
-#ifdef HAVE_CRED_STRUCT
-
typedef struct cred cred_t;
-#define kcred ((cred_t *)(init_task.cred))
-#define CRED() ((cred_t *)current_cred())
-
-#else
-
-typedef struct task_struct cred_t;
-
-#define kcred ((cred_t *)&init_task)
-#define CRED() ((cred_t *)current)
-
-#endif /* HAVE_CRED_STRUCT */
+#define kcred ((cred_t *)(init_task.cred))
+#define CRED() ((cred_t *)current_cred())
#ifdef HAVE_KUIDGID_T
- /*
- * Linux 3.8+ uses typedefs to redefine uid_t and gid_t. We have to rename the
- * typedefs to recover the original types. We then can use them provided that
- * we are careful about translating from k{g,u}id_t to the original versions
- * and vice versa.
- */
- #define uid_t xuid_t
- #define gid_t xgid_t
- #include <linux/uidgid.h>
- #undef uid_t
- #undef gid_t
-
- #define KUID_TO_SUID(x) (__kuid_val(x))
- #define KGID_TO_SGID(x) (__kgid_val(x))
- #define SUID_TO_KUID(x) (KUIDT_INIT(x))
- #define SGID_TO_KGID(x) (KGIDT_INIT(x))
- #define KGIDP_TO_SGIDP(x) (&(x)->val)
+/*
+ * Linux 3.8+ uses typedefs to redefine uid_t and gid_t. We have to rename the
+ * typedefs to recover the original types. We then can use them provided that
+ * we are careful about translating from k{g,u}id_t to the original versions
+ * and vice versa.
+ */
+#define uid_t xuid_t
+#define gid_t xgid_t
+#include <linux/uidgid.h>
+#undef uid_t
+#undef gid_t
+
+#define KUID_TO_SUID(x) (__kuid_val(x))
+#define KGID_TO_SGID(x) (__kgid_val(x))
+#define SUID_TO_KUID(x) (KUIDT_INIT(x))
+#define SGID_TO_KGID(x) (KGIDT_INIT(x))
+#define KGIDP_TO_SGIDP(x) (&(x)->val)
#else /* HAVE_KUIDGID_T */
- #define KUID_TO_SUID(x) (x)
- #define KGID_TO_SGID(x) (x)
- #define SUID_TO_KUID(x) (x)
- #define SGID_TO_KGID(x) (x)
- #define KGIDP_TO_SGIDP(x) (x)
+#define KUID_TO_SUID(x) (x)
+#define KGID_TO_SGID(x) (x)
+#define SUID_TO_KUID(x) (x)
+#define SGID_TO_KGID(x) (x)
+#define KGIDP_TO_SGIDP(x) (x)
#endif /* HAVE_KUIDGID_T */