diff options
author | 2013-06-14 20:56:11 +0000 | |
---|---|---|
committer | 2013-06-14 20:56:11 +0000 | |
commit | 250f478b4a20a9d604e6e2009fae04c2c965daea (patch) | |
tree | 3ba56e8e9a2beebc4dd488017b2ae7ebb730f9b0 | |
parent | Add -T option to set the temp dir. (diff) | |
download | wireguard-openbsd-250f478b4a20a9d604e6e2009fae04c2c965daea.tar.xz wireguard-openbsd-250f478b4a20a9d604e6e2009fae04c2c965daea.zip |
hard code default values in the struct stat returned by getattr.
Some poor fuse client does not set all the struct stat fields...
OK pirofti@ and beck@
-rw-r--r-- | lib/libfuse/fuse_ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/libfuse/fuse_ops.c b/lib/libfuse/fuse_ops.c index 873b32cbd27..7b7dd1c0b0a 100644 --- a/lib/libfuse/fuse_ops.c +++ b/lib/libfuse/fuse_ops.c @@ -1,4 +1,4 @@ -/* $OpenBSD: fuse_ops.c,v 1.4 2013/06/05 18:26:06 tedu Exp $ */ +/* $OpenBSD: fuse_ops.c,v 1.5 2013/06/14 20:56:11 syl Exp $ */ /* * Copyright (c) 2013 Sylvestre Gallon <ccna.syl@gmail.com> * @@ -61,6 +61,13 @@ update_vattr(struct fuse *f, struct vattr *attr, const char *realname, bzero(&st, sizeof(st)); ret = f->op.getattr(realname, &st); + if (st.st_blksize == 0) + st.st_blksize = 512; + if (st.st_blocks == 0) + st.st_blocks = 4; + if (st.st_size == 0) + st.st_size = 512; + st.st_ino = vn->ino; if (f->conf.set_mode) |