From 6f77e7de6f0ad9a8d6991c213841c926acc53a96 Mon Sep 17 00:00:00 2001 From: Miklos Szeredi Date: Tue, 10 Apr 2012 16:01:00 +0200 Subject: Check protocol version before sending notifications Check protocol version before sending notifications and return -ENOSYS if a particular notification is not supported. --- lib/fuse_lowlevel.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/fuse_lowlevel.c') 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; -- cgit v1.2.3