Skip to content

Commit 4798a8a

Browse files
committed
9pfuse: fix handling of access mode (thanks Kenji Arisawa)
Fixes 9fans#81.
1 parent da8a485 commit 4798a8a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/cmd/9pfuse/main.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,9 @@ fusesetattr(FuseMsg *m)
505505
if(in->valid&FATTR_MTIME)
506506
d.mtime = in->mtime;
507507
if(in->valid&FATTR_MODE)
508-
d.mode = in->mode;
508+
d.mode = in->mode & 0777;
509+
if((in->mode&S_IFMT) == S_IFDIR)
510+
d.mode |= DMDIR;
509511
if((in->valid&FATTR_UID) || (in->valid&FATTR_GID)){
510512
/*
511513
* I can't be bothered with these yet.

0 commit comments

Comments
 (0)