Accepted multiple read-only mounts

Multiple mounts of a partition is now allowed provided they are all
in read-only mode.
edge.strict_endians
Jean-Pierre André 2012-01-23 17:31:15 +01:00
parent c9edd32113
commit 528b4303b2
2 changed files with 6 additions and 2 deletions

View File

@ -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;
}

View File

@ -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;
}