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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20151123205620.GA10580@birch.djwong.org>
Date:	Mon, 23 Nov 2015 12:56:20 -0800
From:	"Darrick J. Wong" <darrick.wong@...cle.com>
To:	"Theodore Ts'o" <tytso@....edu>
Cc:	Lennart Lövstrand <lennart@...strand.com>,
	linux-ext4@...r.kernel.org
Subject: [PATCH] fuse2fs: set inode's uid/gid when creating inode

When creating a file in op_create, set the file's uid and gid to the
user's uid and gid.  Do the same in op_mknod.

Reported-by: Lennart Lövstrand <lennart@...strand.com>
Signed-off-by: Darrick J. Wong <darrick.wong@...cle.com>
---
 misc/fuse2fs.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/misc/fuse2fs.c b/misc/fuse2fs.c
index 7d8bb60..1cbdcb7 100644
--- a/misc/fuse2fs.c
+++ b/misc/fuse2fs.c
@@ -994,6 +994,8 @@ static int op_mknod(const char *path, mode_t mode, dev_t dev)
 	inode.i_links_count = 1;
 	inode.i_extra_isize = sizeof(struct ext2_inode_large) -
 		EXT2_GOOD_OLD_INODE_SIZE;
+	inode.i_uid = ctxt->uid;
+	inode.i_gid = ctxt->gid;
 
 	err = ext2fs_write_new_inode(fs, child, (struct ext2_inode *)&inode);
 	if (err) {
@@ -2895,6 +2897,8 @@ static int op_create(const char *path, mode_t mode, struct fuse_file_info *fp)
 	inode.i_links_count = 1;
 	inode.i_extra_isize = sizeof(struct ext2_inode_large) -
 		EXT2_GOOD_OLD_INODE_SIZE;
+	inode.i_uid = ctxt->uid;
+	inode.i_gid = ctxt->gid;
 	if (ext2fs_has_feature_extents(fs->super)) {
 		ext2_extent_handle_t handle;
 
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" 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