From c4c4819e853a572246c928feabb08028c41851ec Mon Sep 17 00:00:00 2001 From: Nikolaus Rath Date: Wed, 16 Nov 2016 12:45:51 -0800 Subject: Abort if fs requests capabilities not supported by kernel. See also issue #114. --- 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 9fd9144..77fc014 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -1916,6 +1916,15 @@ static void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) if (se->op.init) se->op.init(se->userdata, &se->conn); + if (se->conn.want & (~se->conn.capable)) { + fprintf(stderr, "fuse: error: filesystem requested capabilites " + "that are not supported by kernel, aborting.\n"); + fuse_reply_err(req, EPROTO); + se->error = -EPROTO; + fuse_session_exit(se); + return; + } + unsigned max_read_mo = get_max_read(se->mo); if (se->conn.max_read != max_read_mo) { fprintf(stderr, "fuse: error: init() and fuse_session_new() " -- cgit v1.2.3