From 528b4303b28aea8a23ad4704f6fc8af6e8e90f2f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Mon, 23 Jan 2012 17:31:15 +0100 Subject: [PATCH] Accepted multiple read-only mounts Multiple mounts of a partition is now allowed provided they are all in read-only mode. --- src/lowntfs-3g.c | 4 +++- src/ntfs-3g.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/lowntfs-3g.c b/src/lowntfs-3g.c index 0e2c9479..3fd039a2 100644 --- a/src/lowntfs-3g.c +++ b/src/lowntfs-3g.c @@ -3745,7 +3745,9 @@ int main(int argc, char *argv[]) goto err_out; } if (!ntfs_check_if_mounted(opts.device,&existing_mount) - && (existing_mount & NTFS_MF_MOUNTED)) { + && (existing_mount & NTFS_MF_MOUNTED) + /* accept multiple read-only mounts */ + && (!(existing_mount & NTFS_MF_READONLY) || !ctx->ro)) { err = NTFS_VOLUME_LOCKED; goto err_out; } diff --git a/src/ntfs-3g.c b/src/ntfs-3g.c index 47a17b1d..7eb60ca5 100644 --- a/src/ntfs-3g.c +++ b/src/ntfs-3g.c @@ -3664,7 +3664,9 @@ int main(int argc, char *argv[]) goto err_out; } if (!ntfs_check_if_mounted(opts.device,&existing_mount) - && (existing_mount & NTFS_MF_MOUNTED)) { + && (existing_mount & NTFS_MF_MOUNTED) + /* accept multiple read-only mounts */ + && (!(existing_mount & NTFS_MF_READONLY) || !ctx->ro)) { err = NTFS_VOLUME_LOCKED; goto err_out; }