[external/ntfs-3g] fix:android 6.0 can not mount dev path like 'public:8,1'

This commit is contained in:
Firefly
2015-11-04 17:13:58 +08:00
committed by cjp
parent b4857f4858
commit 2e3cfb491e
3 changed files with 18 additions and 1 deletions

View File

@ -52,6 +52,8 @@
#include <sys/param.h>
#endif
#define __BYTE_ORDER BYTE_ORDER
#ifndef __BYTE_ORDER
# if defined(_BYTE_ORDER)
# define __BYTE_ORDER _BYTE_ORDER

View File

@ -422,6 +422,11 @@ static int do_mount(const char *mnt, char **typep, mode_t rootmode,
else
strcpy(source, dev);
char * rchr = strchr(source, '@');
if (rchr) {
rchr[0] = ',';
}
if (restore_privs())
goto err;

View File

@ -225,6 +225,7 @@ char *parse_mount_options(ntfs_fuse_context_t *ctx,
const struct ntfs_options *popts, BOOL low_fuse)
{
char *options, *s, *opt, *val, *ret = NULL;
char *sz_device = NULL;
const char *orig_opts = popts->options;
BOOL no_def_opts = FALSE;
int default_permissions = 0;
@ -523,7 +524,14 @@ char *parse_mount_options(ntfs_fuse_context_t *ctx,
if (ntfs_strappend(&ret, "fsname="))
goto err_exit;
if (ntfs_strappend(&ret, popts->device))
sz_device = malloc(strlen(popts->device) + 1);
if (!sz_device)
goto err_exit;
strcpy(sz_device, popts->device);
char *r_device = strchr(sz_device, ',');
if (r_device)
r_device[0] = '@';
if (ntfs_strappend(&ret, sz_device))
goto err_exit;
if (permissions && !acl)
ctx->secure_flags |= (1 << SECURITY_DEFAULT);
@ -536,6 +544,8 @@ char *parse_mount_options(ntfs_fuse_context_t *ctx,
ctx->hiberfile = FALSE;
}
exit:
if (sz_device)
free(sz_device);
free(options);
return ret;
err_exit: