From: Miklos Szeredi Date: Tue, 10 Apr 2012 14:01:00 +0000 (+0200) Subject: Check protocol version before sending notifications X-Git-Tag: fuse_2_9_0~5 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=6f77e7de6f0ad9a8d6991c213841c926acc53a96;p=qemu-gpiodev%2Flibfuse.git Check protocol version before sending notifications Check protocol version before sending notifications and return -ENOSYS if a particular notification is not supported. --- diff --git a/ChangeLog b/ChangeLog index e4ba255..fab6ee1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2012-04-10 Miklos Szeredi + + * Check protocol version before sending notifications and return + -ENOSYS if a particular notification is not supported. + 2012-01-27 Miklos Szeredi * Interpret octal escape codes in options. Requested by Jan diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index a0d4887..2282ccf 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2028,6 +2028,9 @@ int fuse_lowlevel_notify_delete(struct fuse_chan *ch, if (!f) return -ENODEV; + if (f->conn.proto_minor < 18) + return -ENOSYS; + outarg.parent = parent; outarg.child = child; outarg.namelen = namelen; @@ -2059,6 +2062,9 @@ int fuse_lowlevel_notify_store(struct fuse_chan *ch, fuse_ino_t ino, if (!f) return -ENODEV; + if (f->conn.proto_minor < 15) + return -ENOSYS; + out.unique = 0; out.error = FUSE_NOTIFY_STORE; @@ -2138,6 +2144,9 @@ int fuse_lowlevel_notify_retrieve(struct fuse_chan *ch, fuse_ino_t ino, if (!f) return -ENODEV; + if (f->conn.proto_minor < 15) + return -ENOSYS; + rreq = malloc(sizeof(*rreq)); if (rreq == NULL) return -ENOMEM;