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
Kirill Smelkov
go-fuse
Commits
1e1584d1
Commit
1e1584d1
authored
Feb 29, 2012
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Filter out security labels, so user FSes do not have to deal with them.
parent
c9919744
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
0 deletions
+20
-0
fuse/api.go
fuse/api.go
+7
-0
fuse/opcode.go
fuse/opcode.go
+13
-0
No files found.
fuse/api.go
View file @
1e1584d1
...
...
@@ -223,6 +223,13 @@ type MountOptions struct {
// Write size to use. If 0, use default. This number is
// capped at the kernel maximum.
MaxWrite
int
// If IgnoreSecurityLabels is set, all security related xattr
// requests will return NO_DATA without passing through the
// user defined filesystem. You should only set this if you
// file system implements extended attributes, and you are not
// interested in security labels.
IgnoreSecurityLabels
bool
// ignoring labels should be provided as a fusermount mount option.
}
// DefaultFileSystem implements a FileSystem that returns ENOSYS for every operation.
...
...
fuse/opcode.go
View file @
1e1584d1
...
...
@@ -158,7 +158,20 @@ func doWrite(state *MountState, req *request) {
req
.
status
=
status
}
const
_SECURITY_CAPABILITY
=
"security.capability"
const
_SECURITY_ACL
=
"system.posix_acl_access"
const
_SECURITY_ACL_DEFAULT
=
"system.posix_acl_default"
func
doGetXAttr
(
state
*
MountState
,
req
*
request
)
{
if
state
.
opts
.
IgnoreSecurityLabels
&&
req
.
inHeader
.
opcode
==
_OP_GETXATTR
{
fn
:=
req
.
filenames
[
0
]
if
fn
==
_SECURITY_CAPABILITY
||
fn
==
_SECURITY_ACL_DEFAULT
||
fn
==
_SECURITY_ACL
{
req
.
status
=
ENODATA
return
}
}
input
:=
(
*
GetXAttrIn
)(
req
.
inData
)
var
data
[]
byte
switch
{
...
...
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