Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go-fuse
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Levin Zimmermann
go-fuse
Commits
3b02db56
Commit
3b02db56
authored
Feb 13, 2019
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fuse/nodefs: fix and test UID vs GID confusion
parent
c071d153
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
fuse/nodefs/fsops.go
fuse/nodefs/fsops.go
+1
-1
fuse/nodefs/memnode_test.go
fuse/nodefs/memnode_test.go
+12
-0
No files found.
fuse/nodefs/fsops.go
View file @
3b02db56
...
@@ -211,7 +211,7 @@ func (c *rawBridge) SetAttr(input *fuse.SetAttrIn, out *fuse.AttrOut) (code fuse
...
@@ -211,7 +211,7 @@ func (c *rawBridge) SetAttr(input *fuse.SetAttrIn, out *fuse.AttrOut) (code fuse
}
}
uid
,
uok
:=
input
.
GetUID
()
uid
,
uok
:=
input
.
GetUID
()
gid
,
gok
:=
input
.
Get
U
ID
()
gid
,
gok
:=
input
.
Get
G
ID
()
if
code
.
Ok
()
&&
(
uok
||
gok
)
{
if
code
.
Ok
()
&&
(
uok
||
gok
)
{
code
=
node
.
fsInode
.
Chown
(
f
,
uid
,
gid
,
&
input
.
Context
)
code
=
node
.
fsInode
.
Chown
(
f
,
uid
,
gid
,
&
input
.
Context
)
...
...
fuse/nodefs/memnode_test.go
View file @
3b02db56
...
@@ -113,4 +113,16 @@ func TestMemNodeSetattr(t *testing.T) {
...
@@ -113,4 +113,16 @@ func TestMemNodeSetattr(t *testing.T) {
if
fi
.
Size
()
!=
4096
{
if
fi
.
Size
()
!=
4096
{
t
.
Errorf
(
"Size should be 4096 after Truncate: %d"
,
fi
.
Size
())
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
)
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment