From 233b1f9fc464c35cb34d5a947c79751d922c55d5 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Thu, 24 Oct 2024 19:03:28 +0300 Subject: [PATCH] Use uid/gid in file and directory creation --- internal/goofys_fuse.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/goofys_fuse.go b/internal/goofys_fuse.go index 4d9d63b..effc94a 100644 --- a/internal/goofys_fuse.go +++ b/internal/goofys_fuse.go @@ -557,7 +557,7 @@ func (fs *GoofysFuse) CreateFile( return err } - inode.setFileMode(op.Mode) + inode.SetAttributes(nil, &op.Mode, nil, &op.OpContext.Uid, &op.OpContext.Gid) op.Entry.Child = inode.Id op.Entry.Attributes = inode.InflateAttributes() @@ -609,7 +609,7 @@ func (fs *GoofysFuse) MkNode( fh.Release() } inode.Attributes.Rdev = op.Rdev - inode.setFileMode(op.Mode) + inode.SetAttributes(nil, &op.Mode, nil, &op.OpContext.Uid, &op.OpContext.Gid) op.Entry.Child = inode.Id op.Entry.Attributes = inode.InflateAttributes() @@ -651,6 +651,7 @@ func (fs *GoofysFuse) MkDir( } else { inode.Attributes.Mode = os.ModeDir | fs.flags.DirMode } + inode.SetAttributes(nil, nil, nil, &op.OpContext.Uid, &op.OpContext.Gid) op.Entry.Child = inode.Id op.Entry.Attributes = inode.InflateAttributes()