Rejected implicit mounting read-only when hiberfile option is present

If the remove_hiberfile mount option is present, explicitly disallow
the library from switching to a read-only mount. This is only to avoid
confusion, as the remove_hiberfile is processed before taking the
decision to fall back to read-only.
This commit is contained in:
Jean-Pierre André 2016-05-04 09:39:48 +02:00
parent 0c855fe36b
commit ab4bdea00f
3 changed files with 6 additions and 4 deletions

View File

@ -3941,7 +3941,8 @@ static int ntfs_open(const char *device)
if (ctx->ro) if (ctx->ro)
flags |= NTFS_MNT_RDONLY; flags |= NTFS_MNT_RDONLY;
else else
flags |= NTFS_MNT_MAY_RDONLY; if (!ctx->hiberfile)
flags |= NTFS_MNT_MAY_RDONLY;
if (ctx->recover) if (ctx->recover)
flags |= NTFS_MNT_RECOVER; flags |= NTFS_MNT_RECOVER;
if (ctx->hiberfile) if (ctx->hiberfile)

View File

@ -185,8 +185,8 @@ etc. designate the same file). All files are displayed with lower case in
directory listings. directory listings.
.TP .TP
.B remove_hiberfile .B remove_hiberfile
Unlike in case of read-only mount, the read-write mount is denied if When the NTFS volume is hibernated, a read-write mount is denied and
the NTFS volume is hibernated. One needs either to resume Windows and a read-only mount is forced. One needs either to resume Windows and
shutdown it properly, or use this option which will remove the Windows shutdown it properly, or use this option which will remove the Windows
hibernation file. Please note, this means that the saved Windows hibernation file. Please note, this means that the saved Windows
session will be completely lost. Use this option under your own session will be completely lost. Use this option under your own

View File

@ -3745,7 +3745,8 @@ static int ntfs_open(const char *device)
if (ctx->ro) if (ctx->ro)
flags |= NTFS_MNT_RDONLY; flags |= NTFS_MNT_RDONLY;
else else
flags |= NTFS_MNT_MAY_RDONLY; if (!ctx->hiberfile)
flags |= NTFS_MNT_MAY_RDONLY;
if (ctx->recover) if (ctx->recover)
flags |= NTFS_MNT_RECOVER; flags |= NTFS_MNT_RECOVER;
if (ctx->hiberfile) if (ctx->hiberfile)