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
dd0c60b7
Commit
dd0c60b7
authored
Apr 14, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add O_ANYWRITE mask.
parent
8a2ea6d4
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
2 deletions
+8
-2
examplelib/multizip.go
examplelib/multizip.go
+1
-2
examplelib/zipfs.go
examplelib/zipfs.go
+4
-0
fuse/types.go
fuse/types.go
+3
-0
No files found.
examplelib/multizip.go
View file @
dd0c60b7
...
...
@@ -13,7 +13,6 @@ path/to/zipfile to /config/zipmount
import
(
"github.com/hanwen/go-fuse/fuse"
"log"
"os"
"path/filepath"
"sync"
"strings"
...
...
@@ -186,7 +185,7 @@ func (me *MultiZipFs) Unlink(name string) (code fuse.Status) {
}
func
(
me
*
MultiZipFs
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
RawFuseFile
,
code
fuse
.
Status
)
{
if
0
!=
flags
&
uint32
(
os
.
O_WRONLY
|
os
.
O_RDWR
|
os
.
O_APPEND
)
{
if
0
!=
flags
&
uint32
(
fuse
.
O_ANYWRITE
)
{
return
nil
,
fuse
.
EPERM
}
...
...
examplelib/zipfs.go
View file @
dd0c60b7
...
...
@@ -136,6 +136,10 @@ func (me *ZipFileFuse) GetAttr(name string) (*fuse.Attr, fuse.Status) {
}
func
(
me
*
ZipFileFuse
)
Open
(
name
string
,
flags
uint32
)
(
file
fuse
.
RawFuseFile
,
code
fuse
.
Status
)
{
if
flags
&
fuse
.
O_ANYWRITE
!=
0
{
return
nil
,
fuse
.
EPERM
}
_
,
zfile
:=
me
.
tree
.
Lookup
(
name
)
if
zfile
==
nil
{
return
nil
,
fuse
.
ENOENT
...
...
fuse/types.go
View file @
dd0c60b7
package
fuse
import
(
"os"
"syscall"
)
...
...
@@ -80,6 +81,8 @@ const (
// TODO - get this from a canonical place.
PAGESIZE
=
4096
O_ANYWRITE
=
uint32
(
os
.
O_WRONLY
|
os
.
O_RDWR
|
os
.
O_APPEND
|
os
.
O_CREATE
|
os
.
O_TRUNC
)
)
type
Status
int32
...
...
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