backports: add current_user_ns()
authorHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Nov 2013 00:01:04 +0000 (01:01 +0100)
committerHauke Mehrtens <hauke@hauke-m.de>
Sun, 24 Nov 2013 00:03:57 +0000 (01:03 +0100)
current_user_ns() is used by seq_user_ns() if CONFIG_USER_NS is set and
kernel version <= 2.6.38.
This was added to the kernel in version 2.6.29.

Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
backport/backport-include/linux/cred.h [new file with mode: 0644]

diff --git a/backport/backport-include/linux/cred.h b/backport/backport-include/linux/cred.h
new file mode 100644 (file)
index 0000000..2fbcf01
--- /dev/null
@@ -0,0 +1,10 @@
+#ifndef __BACKPORT_LINUX_CRED_H
+#define __BACKPORT_LINUX_CRED_H
+#include_next <linux/cred.h>
+#include <linux/version.h>
+
+#ifndef current_user_ns
+#define current_user_ns()      (current->nsproxy->user_ns)
+#endif
+
+#endif /* __BACKPORT_LINUX_CRED_H */