commit 4798a8a5560552480efde5fe8b1f7963a25a96d3
parent da8a485fc143aa323845fafcf0f0f836c76a116b
Author: David du Colombier <0intro@gmail.com>
Date: Mon, 5 Feb 2018 21:14:32 +0100
9pfuse: fix handling of access mode (thanks Kenji Arisawa)
Fixes #81.
Diffstat:
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/src/cmd/9pfuse/main.c b/src/cmd/9pfuse/main.c
@@ -505,7 +505,9 @@ fusesetattr(FuseMsg *m)
if(in->valid&FATTR_MTIME)
d.mtime = in->mtime;
if(in->valid&FATTR_MODE)
- d.mode = in->mode;
+ d.mode = in->mode & 0777;
+ if((in->mode&S_IFMT) == S_IFDIR)
+ d.mode |= DMDIR;
if((in->valid&FATTR_UID) || (in->valid&FATTR_GID)){
/*
* I can't be bothered with these yet.