fusermount, libfuse: send value as unsigned in "user_id=" and "group_id="
authorMiklos Szeredi <mszeredi@suse.cz>
Tue, 15 Jul 2014 14:03:12 +0000 (16:03 +0200)
committerMiklos Szeredi <mszeredi@suse.cz>
Mon, 21 Jul 2014 16:59:05 +0000 (18:59 +0200)
...options.  Uids/gids larger than 2147483647 would result in EINVAL when
mounting the filesystem.  This also needs a fix in the kernel.

ChangeLog
lib/mount.c
util/fusermount.c

index 1b71fd42c4cc1b446108d7677a9c96c20249fb4d..f4657a033f0b6e4fb7f7d49a8481fa0b1bf886ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-07-15  Miklos Szeredi <miklos@szeredi.hu>
+
+       * fusermount, libfuse: send value as unsigned in "user_id=" and
+       "group_id=" options.  Uids/gids larger than 2147483647 would
+       result in EINVAL when mounting the filesystem.  This also needs a
+       fix in the kernel.
+
 2013-08-26  Miklos Szeredi <miklos@szeredi.hu>
 
        * libfuse: Add missing includes.  This allows compiling fuse with
index 0f767c8ff2237c59e8c93e9f87eb25ce5b4a310a..56904895897e0463c2bf3c4da599d87954570e1d 100644 (file)
@@ -467,7 +467,7 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo,
                return -1;
        }
 
-       snprintf(tmp, sizeof(tmp),  "fd=%i,rootmode=%o,user_id=%i,group_id=%i",
+       snprintf(tmp, sizeof(tmp),  "fd=%i,rootmode=%o,user_id=%u,group_id=%u",
                 fd, stbuf.st_mode & S_IFMT, getuid(), getgid());
 
        res = fuse_opt_add_opt(&mo->kernel_opts, tmp);
index 4fc72ed3cc9301a8606f8cda0fef2c04bd728394..26a0b75bbecb7bdf45928dd7f98e3736a7079fd8 100644 (file)
@@ -810,7 +810,7 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode,
        if (res == -1)
                goto err;
 
-       sprintf(d, "fd=%i,rootmode=%o,user_id=%i,group_id=%i",
+       sprintf(d, "fd=%i,rootmode=%o,user_id=%u,group_id=%u",
                fd, rootmode, getuid(), getgid());
 
        if (check_empty &&
@@ -851,7 +851,7 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode,
        }
        if (res == -1 && errno == EINVAL) {
                /* It could be an old version not supporting group_id */
-               sprintf(d, "fd=%i,rootmode=%o,user_id=%i",
+               sprintf(d, "fd=%i,rootmode=%o,user_id=%u",
                        fd, rootmode, getuid());
                res = mount(source, mnt, type, flags, optbuf);
        }