diff options
author | syl <syl@cvs.openbsd.org> | 2013-06-14 20:56:12 +0000 |
---|---|---|
committer | syl <syl@cvs.openbsd.org> | 2013-06-14 20:56:12 +0000 |
commit | e7fe0affb3c7df3abad96384330befdd7e196a5b (patch) | |
tree | b7c31487a1793c52d7465135ca9d87eda3b10690 /lib/libfuse | |
parent | 257d8eba3e90c40c070f0e589930d0169b6bcf49 (diff) |
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@
Diffstat (limited to 'lib/libfuse')
-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) |