From: Miklos Szeredi Date: Tue, 15 Jul 2014 14:03:12 +0000 (+0200) Subject: fusermount, libfuse: send value as unsigned in "user_id=" and "group_id=" X-Git-Tag: fuse_2_9_4~7 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=60ac20d25ff061561fe2150a3197f894b36a0240;p=qemu-gpiodev%2Flibfuse.git 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. --- diff --git a/ChangeLog b/ChangeLog index 1b71fd4..f4657a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2014-07-15 Miklos Szeredi + + * 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 * libfuse: Add missing includes. This allows compiling fuse with diff --git a/lib/mount.c b/lib/mount.c index 0f767c8..5690489 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -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); diff --git a/util/fusermount.c b/util/fusermount.c index 4fc72ed..26a0b75 100644 --- a/util/fusermount.c +++ b/util/fusermount.c @@ -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); }