diff --git a/ChangeLog b/ChangeLog index 4e7da1d..fd3acd5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,11 @@ * libfuse: document deadlock avoidance for fuse_notify_inval_entry() and fuse_notify_delete() + * 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. + 2014-03-26 Miklos Szeredi * Initilaize stat buffer passed to ->getattr() and ->fgetattr() to diff --git a/lib/mount.c b/lib/mount.c index fb9231a..111b32b 100644 --- a/lib/mount.c +++ b/lib/mount.c @@ -462,7 +462,7 @@ static int fuse_mount_sys(const char *mnt, struct mount_opts *mo, if (!O_CLOEXEC) fcntl(fd, F_SETFD, FD_CLOEXEC); - 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 e7dbca6..b226fbd 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); }