summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Kondik <steve@cyngn.com>2016-07-26 03:03:06 -0700
committerSteve Kondik <steve@cyngn.com>2016-07-26 03:04:16 -0700
commit1576854573b0ee5525f4a3476d0f58d2f45eeae1 (patch)
tree1adb23cd74546e706c4e75d57f2d5dca9c743c2b
parent7f9b2ce419e8d9abfff61bca852c5cb652ee2361 (diff)
downloadsystem_core-1576854573b0ee5525f4a3476d0f58d2f45eeae1.zip
system_core-1576854573b0ee5525f4a3476d0f58d2f45eeae1.tar.gz
system_core-1576854573b0ee5525f4a3476d0f58d2f45eeae1.tar.bz2
sdcard: Pass the umask to sdcardfs correctly
* Google version of the kernel code expects unsigned int rather than octal. Don't confuse it. Change-Id: I40f060dc5212ec587e612dc275001e1a660cce67
-rw-r--r--sdcard/sdcard.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sdcard/sdcard.c b/sdcard/sdcard.c
index 5309bbd..227982c 100644
--- a/sdcard/sdcard.c
+++ b/sdcard/sdcard.c
@@ -1792,7 +1792,7 @@ static int fuse_setup(struct fuse* fuse, gid_t gid, mode_t mask, bool use_sdcard
if (use_sdcardfs) {
snprintf(opts, sizeof(opts),
- "%sfsuid=%d,fsgid=%d,userid=%d,gid=%d,mask=%04o,reserved_mb=20",
+ "%sfsuid=%u,fsgid=%u,userid=%d,gid=%u,mask=%u,reserved_mb=20",
(fuse->global->multi_user ? "multiuser," : ""),
fuse->global->uid, fuse->global->gid,
fuse->global->root.userid, gid, mask);
@@ -1909,11 +1909,6 @@ static void run(const char* source_path, const char* label, uid_t uid,
}
}
- // Nothing else for us to do if sdcardfs is in use!
- if (use_sdcardfs) {
- exit(0);
- }
-
/* Drop privs */
if (setgroups(sizeof(kGroups) / sizeof(kGroups[0]), kGroups) < 0) {
ERROR("cannot setgroups: %s\n", strerror(errno));
@@ -1932,6 +1927,11 @@ static void run(const char* source_path, const char* label, uid_t uid,
fs_prepare_dir(global.obb_path, 0775, uid, gid);
}
+ // Nothing else for us to do if sdcardfs is in use!
+ if (use_sdcardfs) {
+ exit(0);
+ }
+
if (pthread_create(&thread_default, NULL, start_handler, &handler_default)
|| pthread_create(&thread_read, NULL, start_handler, &handler_read)
|| pthread_create(&thread_write, NULL, start_handler, &handler_write)) {