aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiklos Szeredi <mszeredi@suse.cz>2014-07-15 16:03:12 +0200
committerDan Pasanen <dan.pasanen@gmail.com>2015-10-28 21:00:11 -0500
commita199012e06b47f0be72b628ef63c8401793eb4cf (patch)
tree1e58eeb7f4fd48cc7f93d51c77fc2ddbd1549649
parent88536d6388e1083298feb23eae4f90a5565fdfee (diff)
downloadandroid_external_fuse-a199012e06b47f0be72b628ef63c8401793eb4cf.tar.gz
android_external_fuse-a199012e06b47f0be72b628ef63c8401793eb4cf.tar.bz2
android_external_fuse-a199012e06b47f0be72b628ef63c8401793eb4cf.zip
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. Change-Id: Ic7ed0a7391b49adf31db2129b00beb0e1e60f652
-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 2a557c6..eb0bb17 100644
--- a/lib/mount.c
+++ b/lib/mount.c
@@ -471,7 +471,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 e5c98c7..f2daeac 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);
}