lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1377226118-43756-2-git-send-email-rui.xiang@huawei.com>
Date:	Fri, 23 Aug 2013 10:48:37 +0800
From:	Rui Xiang <rui.xiang@...wei.com>
To:	<linux-fsdevel@...r.kernel.org>, <viro@...iv.linux.org.uk>
CC:	<linux-kernel@...r.kernel.org>, <linux-ia64@...r.kernel.org>,
	<linuxppc-dev@...ts.ozlabs.org>, <linux-s390@...r.kernel.org>,
	<linux-rdma@...r.kernel.org>, <linux-usb@...r.kernel.org>,
	<v9fs-developer@...ts.sourceforge.net>, <linux-mm@...ck.org>,
	<cgroups@...r.kernel.org>, <netdev@...r.kernel.org>,
	Rui Xiang <rui.xiang@...wei.com>
Subject: [PATCH 1/2] fs: implement inode uid/gid setting function

Supply a interface inode_set_user  to set uid/gid of inode
structs.

Signed-off-by: Rui Xiang <rui.xiang@...wei.com>
---
 fs/inode.c         | 7 +++++++
 include/linux/fs.h | 1 +
 2 files changed, 8 insertions(+)

diff --git a/fs/inode.c b/fs/inode.c
index e315c0a..3f90499 100644
--- a/fs/inode.c
+++ b/fs/inode.c
@@ -343,6 +343,13 @@ void inc_nlink(struct inode *inode)
 }
 EXPORT_SYMBOL(inc_nlink);
 
+void inode_set_user(struct inode *inode, kuid_t uid, kgid_t gid)
+{
+	inode->i_uid = uid;
+	inode->i_gid = gid;
+}
+EXPORT_SYMBOL(inode_set_user);
+
 void address_space_init_once(struct address_space *mapping)
 {
 	memset(mapping, 0, sizeof(*mapping));
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 729e81b..36ac51b 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2619,6 +2619,7 @@ void __inode_sub_bytes(struct inode *inode, loff_t bytes);
 void inode_sub_bytes(struct inode *inode, loff_t bytes);
 loff_t inode_get_bytes(struct inode *inode);
 void inode_set_bytes(struct inode *inode, loff_t bytes);
+void inode_set_user(struct inode *inode, kuid_t uid, kgid_t gid);
 
 extern int vfs_readdir(struct file *, filldir_t, void *);
 extern int iterate_dir(struct file *, struct dir_context *);
-- 
1.8.2.2


--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ