diff options
author | Miklos Szeredi <miklos@szeredi.hu> | 2008-12-08 21:53:35 +0000 |
---|---|---|
committer | Miklos Szeredi <miklos@szeredi.hu> | 2008-12-08 21:53:35 +0000 |
commit | c335f925d7baa010e523511974de038feb0517e6 (patch) | |
tree | 132f79b07fd7480e35a6f98fcb8db0785faa101f | |
parent | 5f722fa8f6561c964fd0bd651b4602ac0f7bc3b4 (diff) | |
download | libfuse-c335f925d7baa010e523511974de038feb0517e6.tar.gz |
* Add missing setattr flags to <fuse_lowlevel.h>.
* Only pass valid flags to ->setattr().
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | include/fuse_lowlevel.h | 2 | ||||
-rw-r--r-- | lib/fuse_lowlevel.c | 10 |
3 files changed, 16 insertions, 0 deletions
@@ -2,6 +2,10 @@ * Implement poll support. Patch by Tejun Heo + * Add missing setattr flags to <fuse_lowlevel.h>. + + * Only pass valid flags to ->setattr(). + 2008-12-05 Miklos Szeredi <miklos@szeredi.hu> * Implement ioctl support. On high level interface only diff --git a/include/fuse_lowlevel.h b/include/fuse_lowlevel.h index 0b83214..d7418e7 100644 --- a/include/fuse_lowlevel.h +++ b/include/fuse_lowlevel.h @@ -118,6 +118,8 @@ struct fuse_ctx { #define FUSE_SET_ATTR_SIZE (1 << 3) #define FUSE_SET_ATTR_ATIME (1 << 4) #define FUSE_SET_ATTR_MTIME (1 << 5) +#define FUSE_SET_ATTR_ATIME_NOW (1 << 7) +#define FUSE_SET_ATTR_MTIME_NOW (1 << 8) /* ----------------------------------------------------------- * * Request methods and replies * diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index 026de30..e62e358 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -578,6 +578,16 @@ static void do_setattr(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) fi->fh = arg->fh; fi->fh_old = fi->fh; } + arg->valid &= + FUSE_SET_ATTR_MODE | + FUSE_SET_ATTR_UID | + FUSE_SET_ATTR_GID | + FUSE_SET_ATTR_SIZE | + FUSE_SET_ATTR_ATIME | + FUSE_SET_ATTR_MTIME | + FUSE_SET_ATTR_ATIME_NOW | + FUSE_SET_ATTR_MTIME_NOW; + req->f->op.setattr(req, nodeid, &stbuf, arg->valid, fi); } else fuse_reply_err(req, ENOSYS); |