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.
This commit is contained in:
Miklos Szeredi 2014-07-15 16:03:12 +02:00
parent 780d47bbea
commit 52f46cfa68
3 changed files with 8 additions and 3 deletions

View File

@ -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 <miklos@szeredi.hu>
* Initilaize stat buffer passed to ->getattr() and ->fgetattr() to

View File

@ -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);

View 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);
}