author | Baocheng Sun <baocheng.sun@amlogic.com> | 2018-05-16 08:01:19 (GMT) |
---|---|---|
committer | Baocheng Sun <baocheng.sun@amlogic.com> | 2018-05-17 06:27:46 (GMT) |
commit | e588f69c185b796e137125183e768f9da4a6f71b (patch) | |
tree | 13e39f3edd864023b1aaf22a1cd41d9f0926cd9d | |
parent | b2124da12a11278eef08fca2b391abaab28d01cd (diff) | |
download | ntfs-3g-e588f69c185b796e137125183e768f9da4a6f71b.zip ntfs-3g-e588f69c185b796e137125183e768f9da4a6f71b.tar.gz ntfs-3g-e588f69c185b796e137125183e768f9da4a6f71b.tar.bz2 |
ntfs-3g: compatible with android vold sysfs node [2/4]
PD# 160644
vold dev node contains commas like /dev/block/vold/public:8,1
its commas should not be interpreted as option separators.
Change-Id: I5338fa7cec54d45b4b869fa4c7ef85afca34ff26
-rwxr-xr-x | libfuse-lite/fuse_opt.c | 10 | ||||
-rwxr-xr-x | libfuse-lite/fusermount.c | 5 |
2 files changed, 13 insertions, 2 deletions
diff --git a/libfuse-lite/fuse_opt.c b/libfuse-lite/fuse_opt.c index 80b0777..f19b787 100755 --- a/libfuse-lite/fuse_opt.c +++ b/libfuse-lite/fuse_opt.c @@ -277,7 +277,15 @@ static int process_real_option_group(struct fuse_opt_context *ctx, char *opts) else #endif /* __SOLARIS__ */ { - sep = strchr(opts, ','); + + if (!strncmp(opts,"fsname=",7) && strstr(opts, "vold")) { + fprintf(stderr, "[%s,%d] opts=%s\n", __FUNCTION__, __LINE__, opts); + char *tmp = strchr(opts, ','); + sep = strchr(tmp+1, ','); + } else { + sep = strchr(opts, ','); + } + if (sep) *sep = '\0'; } diff --git a/libfuse-lite/fusermount.c b/libfuse-lite/fusermount.c index 16b35a3..eec1d07 100755 --- a/libfuse-lite/fusermount.c +++ b/libfuse-lite/fusermount.c @@ -446,6 +446,9 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode, const char *fsname_str = "fsname="; for (len = 0; s[len] && s[len] != ','; len++); if (begins_with(s, fsname_str)) { + if (strstr(s, "vold")) + for (len++; s[len] && s[len] != ','; len++); + if (!get_string_opt(s, len, fsname_str, &fsname)) goto err; } else if (opt_eq(s, len, "blkdev")) { @@ -518,7 +521,7 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode, sprintf(d, "fd=%i,rootmode=%o,user_id=%i", fd, rootmode, getuid()); res = mount(source, mnt, type, flags, optbuf); } - + if (drop_privs()) goto err; |