Commit 3b02db56 authored by Han-Wen Nienhuys's avatar Han-Wen Nienhuys

fuse/nodefs: fix and test UID vs GID confusion

parent c071d153
......@@ -211,7 +211,7 @@ func (c *rawBridge) SetAttr(input *fuse.SetAttrIn, out *fuse.AttrOut) (code fuse
}
uid, uok := input.GetUID()
gid, gok := input.GetUID()
gid, gok := input.GetGID()
if code.Ok() && (uok || gok) {
code = node.fsInode.Chown(f, uid, gid, &input.Context)
......
......@@ -113,4 +113,16 @@ func TestMemNodeSetattr(t *testing.T) {
if fi.Size() != 4096 {
t.Errorf("Size should be 4096 after Truncate: %d", fi.Size())
}
if err := f.Chown(21, 42); err != nil {
t.Errorf("Chown: %v", err)
}
if fi, err := f.Stat(); err != nil {
t.Fatalf("Stat failed: %v", err)
} else {
attr := fuse.ToStatT(fi)
if attr.Gid != 42 || attr.Uid != 21 {
t.Errorf("got (%d, %d), want 42,21", attr.Uid, attr.Gid)
}
}
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment