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
cd5dcdb5
Commit
cd5dcdb5
authored
May 15, 2023
by
Levin Zimmermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
2fa7c731
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
11 deletions
+36
-11
fuse/server.go
fuse/server.go
+4
-11
notes
notes
+32
-0
No files found.
fuse/server.go
View file @
cd5dcdb5
...
...
@@ -246,17 +246,6 @@ func NewServer(fs RawFileSystem, mountPoint string, opts *MountOptions) (*Server
}
func
escapeComma
(
optionValue
string
)
string
{
// Perhaps if clause isn't even needed.
// We need to loop through each character of the string
// anyway, so we'll catch each comma anyway.
//
// Maybe it's very slightly more performant if we initially
// test if it contains a ','?
//
// But perhaps strings.Replace() is equally fast..
// if strings.Contains(s, ",") {}
return
strings
.
Replace
(
optionValue
,
","
,
"//"
,
-
1
)
}
...
...
@@ -282,7 +271,11 @@ func (o *MountOptions) optionsStrings() []string {
r
=
append
(
r
,
"daemon_timeout=0"
)
}
// Commas in an option need to be escaped, because
// options are separated by a comma.
var
rEscaped
[]
string
bool
escape_ok
=
begins_with
(
s
,
fsname_str
)
||
begins_with
(
s
,
subtype_str
);
for
_
,
s
:=
range
r
{
rEscaped
=
append
(
rEscaped
,
escapeComma
(
s
))
}
...
...
notes
0 → 100644
View file @
cd5dcdb5
we try to implement the following commits in libfuse in go-fuse:
https://github.com/libfuse/libfuse/commit/555d6b504308eac6b976321ce938ee4bec62c354
https://github.com/libfuse/libfuse/commit/28bdae3d113ef479c1660a581ef720cdc33bf466 (???)
core code in libfuse where commas are escaped:
inside the function `add_opt_common`:
https://github.com/libfuse/libfuse/blob/db35a37de/lib/fuse_opt.c
so it only happens if 'esc' (=escape) is true
=> then there are two functions:
- fuse_opt_add_opt
- fuse_opt_add_opt_escaped
the first function is called if we want to add an option which shouldn't be escapd
the second function is called if we want to add an option which should be escapd
Those functions are called in mount.c/fuse_mount_opt_proc
https://github.com/libfuse/libfuse/blob/dba6b3983/lib/mount.c#L187-L216
=> for fusermount options they always use 'fuse_opt_add_opt_escaped'
=> so it seems to be safe to escape any option, because in this patch
it's only about fusermount options anyway
which on the other hand is called here (it's passed as 'proc'):
https://github.com/libfuse/libfuse/blob/db35a37def14b72181f3630efeea0e0433103c41/lib/fuse_opt.c#L398-L423
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