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
a75cd967
Commit
a75cd967
authored
Jun 22, 2011
by
Han-Wen Nienhuys
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Strip W_OK from Access mask.
parent
d8568ab6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
unionfs/unionfs.go
unionfs/unionfs.go
+2
-1
unionfs/unionfs_test.go
unionfs/unionfs_test.go
+18
-0
No files found.
unionfs/unionfs.go
View file @
a75cd967
...
@@ -458,11 +458,12 @@ func (me *UnionFs) Chmod(name string, mode uint32) (code fuse.Status) {
...
@@ -458,11 +458,12 @@ func (me *UnionFs) Chmod(name string, mode uint32) (code fuse.Status) {
}
}
func
(
me
*
UnionFs
)
Access
(
name
string
,
mode
uint32
)
(
code
fuse
.
Status
)
{
func
(
me
*
UnionFs
)
Access
(
name
string
,
mode
uint32
)
(
code
fuse
.
Status
)
{
// We always allow writing.
mode
=
mode
&^
fuse
.
W_OK
r
:=
me
.
getBranch
(
name
)
r
:=
me
.
getBranch
(
name
)
if
r
.
branch
>=
0
{
if
r
.
branch
>=
0
{
return
me
.
fileSystems
[
r
.
branch
]
.
Access
(
name
,
mode
)
return
me
.
fileSystems
[
r
.
branch
]
.
Access
(
name
,
mode
)
}
}
return
fuse
.
ENOENT
return
fuse
.
ENOENT
}
}
...
...
unionfs/unionfs_test.go
View file @
a75cd967
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"io/ioutil"
"io/ioutil"
"fmt"
"fmt"
"log"
"log"
"syscall"
"testing"
"testing"
"time"
"time"
)
)
...
@@ -420,6 +421,23 @@ func TestWritableDir(t *testing.T) {
...
@@ -420,6 +421,23 @@ func TestWritableDir(t *testing.T) {
}
}
}
}
func
TestWriteAccess
(
t
*
testing
.
T
)
{
t
.
Log
(
"TestWriteAccess"
)
wd
,
clean
:=
setupUfs
(
t
)
defer
clean
()
fn
:=
wd
+
"/ro/file"
// No write perms.
err
:=
ioutil
.
WriteFile
(
fn
,
[]
byte
(
"foo"
),
0444
)
CheckSuccess
(
err
)
errno
:=
syscall
.
Access
(
wd
+
"/mount/file"
,
fuse
.
W_OK
)
if
errno
!=
0
{
err
=
os
.
Errno
(
errno
)
CheckSuccess
(
err
)
}
}
func
TestTruncate
(
t
*
testing
.
T
)
{
func
TestTruncate
(
t
*
testing
.
T
)
{
t
.
Log
(
"TestTruncate"
)
t
.
Log
(
"TestTruncate"
)
wd
,
clean
:=
setupUfs
(
t
)
wd
,
clean
:=
setupUfs
(
t
)
...
...
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