summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorEric W. Biederman <ebiederm@xmission.com>2010-06-13 03:28:59 +0000
committerDavid S. Miller <davem@davemloft.net>2010-06-16 14:55:35 -0700
commit3f551f9436c05a3b5eccdd6e94733df5bb98d2a5 (patch)
treeee5a9148797994682a4553e817e96b721303f3ec /include/linux
parent5c1469de7545a35a16ff2b902e217044a7d2f8a5 (diff)
downloadblackbird-op-linux-3f551f9436c05a3b5eccdd6e94733df5bb98d2a5.tar.gz
blackbird-op-linux-3f551f9436c05a3b5eccdd6e94733df5bb98d2a5.zip
sock: Introduce cred_to_ucred
To keep the coming code clear and to allow both the sock code and the scm code to share the logic introduce a fuction to translate from struct cred to struct ucred. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Acked-by: Pavel Emelyanov <xemul@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/socket.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 032a19eb61b1..a2fada9becb6 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage {
#include <linux/types.h> /* pid_t */
#include <linux/compiler.h> /* __user */
+struct pid;
+struct cred;
+
#define __sockaddr_check_size(size) \
BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage)))
@@ -309,6 +312,8 @@ struct ucred {
#define IPX_TYPE 1
#ifdef __KERNEL__
+extern void cred_to_ucred(struct pid *pid, const struct cred *cred, struct ucred *ucred);
+
extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len);
extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov,
int offset, int len);
OpenPOWER on IntegriCloud