Browse Source

mount: apply UID/GID mapping in lookupEntry for cache misses (#8144)

* mount: apply UID/GID mapping in lookupEntry for cache misses

This fixes issue #8134 where rsync would fail with "Operation not permitted"
during chgrp. The issue was that entries fetched directly from the filer
(on cache miss) were not being mapped to local UIDs/GIDs.

* mount: add nil check for entry.Attributes in lookupEntry
pull/8026/merge
Chris Lu 1 day ago
committed by GitHub
parent
commit
8e9c12e2c7
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 3
      weed/mount/weedfs.go

3
weed/mount/weedfs.go

@ -306,6 +306,9 @@ func (wfs *WFS) lookupEntry(fullpath util.FullPath) (*filer.Entry, fuse.Status)
glog.V(1).Infof("lookupEntry GetEntry %s: %v", fullpath, err)
return nil, fuse.ENOENT
}
if entry != nil && entry.Attributes != nil && wfs.option.UidGidMapper != nil {
entry.Attributes.Uid, entry.Attributes.Gid = wfs.option.UidGidMapper.FilerToLocal(entry.Attributes.Uid, entry.Attributes.Gid)
}
return filer.FromPbEntry(dir, entry), fuse.OK
}

Loading…
Cancel
Save