* [PATCH] fuse2fs: set inode's uid/gid when creating inode
@ 2015-11-23 20:56 Darrick J. Wong
2015-11-30 23:28 ` Theodore Ts'o
0 siblings, 1 reply; 2+ messages in thread
From: Darrick J. Wong @ 2015-11-23 20:56 UTC (permalink / raw)
To: Theodore Ts'o; +Cc: Lennart Lövstrand, linux-ext4
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@lovstrand.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.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@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] fuse2fs: set inode's uid/gid when creating inode
2015-11-23 20:56 [PATCH] fuse2fs: set inode's uid/gid when creating inode Darrick J. Wong
@ 2015-11-30 23:28 ` Theodore Ts'o
0 siblings, 0 replies; 2+ messages in thread
From: Theodore Ts'o @ 2015-11-30 23:28 UTC (permalink / raw)
To: Darrick J. Wong; +Cc: Lennart Lövstrand, linux-ext4
On Mon, Nov 23, 2015 at 12:56:20PM -0800, Darrick J. Wong wrote:
> 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@lovstrand.com>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Thanks, applied.
- Ted
--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2015-11-30 23:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 20:56 [PATCH] fuse2fs: set inode's uid/gid when creating inode Darrick J. Wong
2015-11-30 23:28 ` Theodore Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).