summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-07-15 16:03:12 +0200
committerMiklos Szeredi <mszeredi@suse.cz>2014-07-21 18:59:05 +0200
commit60ac20d25ff061561fe2150a3197f894b36a0240 (patch)
tree68bdd3ec98d2d997cda765b61918e4892fb96bde
parent78bc1108d5537400f7df7f79f1dc27084b53323c (diff)
downloadfuse-60ac20d25ff061561fe2150a3197f894b36a0240.tar.gz
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.
-rw-r--r--ChangeLog7
-rw-r--r--lib/mount.c2
-rw-r--r--util/fusermount.c4
3 files changed, 10 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 1b71fd4..f4657a0 100644
--- 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
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);
}