Check protocol version before sending notifications
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 10 Apr 2012 14:01:00 +0000 (16:01 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Tue, 10 Apr 2012 14:01:00 +0000 (16:01 +0200)
Check protocol version before sending notifications and return -ENOSYS if a
particular notification is not supported.

ChangeLog
lib/fuse_lowlevel.c

index e4ba2559bcc54479075f515d7846a49ef14c922f..fab6ee19cc70c08acec7167e225725e0ac0b6714 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-04-10  Miklos Szeredi <miklos@szeredi.hu>
+
+       * Check protocol version before sending notifications and return
+       -ENOSYS if a particular notification is not supported.
+
 2012-01-27  Miklos Szeredi <miklos@szeredi.hu>
 
        * Interpret octal escape codes in options.  Requested by Jan
index a0d4887655c2dea4028c1aec0cd4d3901466f814..2282ccfe7a9e56d10feb67bba2ab1eb9926fb099 100644 (file)
@@ -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;