mirror of https://github.com/perkeep/perkeep.git
Merge "fs: make a copy of the value buffer when setting an xattr"
This commit is contained in:
commit
0cfaf301d7
|
@ -432,7 +432,7 @@ func (n *mutDir) Remove(req *fuse.RemoveRequest, intr fs.Intr) fuse.Error {
|
|||
claim := schema.NewDelAttributeClaim(n.permanode, "camliPath:"+req.Name, "")
|
||||
_, err := n.fs.client.UploadAndSignBlob(claim)
|
||||
if err != nil {
|
||||
log.Println("mutDir.Create:", err)
|
||||
log.Println("mutDir.Remove:", err)
|
||||
return fuse.EIO
|
||||
}
|
||||
// Remove child from map.
|
||||
|
|
|
@ -84,8 +84,10 @@ func (x *xattr) set(req *fuse.SetxattrRequest) fuse.Error {
|
|||
return fuse.EIO
|
||||
}
|
||||
|
||||
val := make([]byte, len(req.Xattr))
|
||||
copy(val, req.Xattr)
|
||||
x.mu.Lock()
|
||||
(*x.xattrs)[req.Name] = req.Xattr
|
||||
(*x.xattrs)[req.Name] = val
|
||||
x.mu.Unlock()
|
||||
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue