fusermount: Reject invalid negative mount_max in fuse.conf mount_max is parsed with %i (signed) from /etc/fuse.conf. The value -1 is the documented sentinel for "no limit", but any other negative value (e.g., -2 from a typo) passes the mount_max != -1 guard and makes the mount_count >= mount_max comparison always true, blocking all non-root FUSE mounts. Reject values below -1 with a warning rather than silently accepting them. Signed-off-by: Abhinav Agarwal <abhinavagarwal1996@gmail.com>
diff --git a/util/fuser_conf.c b/util/fuser_conf.c index 8203b14..31b78fc 100644 --- a/util/fuser_conf.c +++ b/util/fuser_conf.c
@@ -192,8 +192,14 @@ if (strcmp(line, "user_allow_other") == 0) user_allow_other = 1; - else if (sscanf(line, "mount_max = %i", &tmp) == 1) - mount_max = tmp; + else if (sscanf(line, "mount_max = %i", &tmp) == 1) { + if (tmp < -1) + fprintf(stderr, + "%s: invalid mount_max = %i in %s at line %i\n", + progname, tmp, FUSE_CONF, linenum); + else + mount_max = tmp; + } else if (line[0]) fprintf(stderr, "%s: unknown parameter in %s at line %i: '%s'\n",