mirror of
https://github.com/restic/restic.git
synced 2025-10-10 14:31:56 +00:00
fuse: Properly set uid/gid for directories
In #2584 this was changed to use the uid/gid of the root node. This would be okay for the top-level directory of a snapshot, however, this change also applied to normal directories within a snapshot. This change reverts the problematic part and adds a test that directory attributes are represented correctly.
This commit is contained in:
@@ -111,8 +111,11 @@ func (d *dir) Attr(ctx context.Context, a *fuse.Attr) error {
|
||||
debug.Log("Attr()")
|
||||
a.Inode = d.inode
|
||||
a.Mode = os.ModeDir | d.node.Mode
|
||||
a.Uid = d.root.uid
|
||||
a.Gid = d.root.gid
|
||||
|
||||
if !d.root.cfg.OwnerIsRoot {
|
||||
a.Uid = d.node.UID
|
||||
a.Gid = d.node.GID
|
||||
}
|
||||
a.Atime = d.node.AccessTime
|
||||
a.Ctime = d.node.ChangeTime
|
||||
a.Mtime = d.node.ModTime
|
||||
|
Reference in New Issue
Block a user