Enabled forensic mounting
parent
5b03804c73
commit
d4e2a501a5
|
@ -58,6 +58,7 @@
|
|||
#endif
|
||||
|
||||
#define MS_IGNORE_HIBERFILE 0x20000000
|
||||
#define MS_FORENSIC 0x04000000 /* No modification during mount */
|
||||
|
||||
/* Forward declaration */
|
||||
typedef struct _ntfs_volume ntfs_volume;
|
||||
|
|
|
@ -1184,7 +1184,7 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
|
|||
* Check for dirty logfile and hibernated Windows.
|
||||
* We care only about read-write mounts.
|
||||
*/
|
||||
if (!(flags & MS_RDONLY)) {
|
||||
if (!(flags & (MS_RDONLY | MS_FORENSIC))) {
|
||||
if (!(flags & MS_IGNORE_HIBERFILE) &&
|
||||
ntfs_volume_check_hiberfile(vol, 1) < 0)
|
||||
goto error_exit;
|
||||
|
@ -1196,10 +1196,10 @@ ntfs_volume *ntfs_device_mount(struct ntfs_device *dev, unsigned long flags)
|
|||
if (ntfs_logfile_reset(vol))
|
||||
goto error_exit;
|
||||
}
|
||||
}
|
||||
/* make $TXF_DATA resident if present on the root directory */
|
||||
if (!NVolReadOnly(vol) && fix_txf_data(vol))
|
||||
goto error_exit;
|
||||
if (fix_txf_data(vol))
|
||||
goto error_exit;
|
||||
}
|
||||
|
||||
return vol;
|
||||
io_error_exit:
|
||||
|
|
|
@ -2251,11 +2251,11 @@ static ntfs_volume *mount_volume(void)
|
|||
"You must 'umount' it first.\n", opt.volume);
|
||||
}
|
||||
/*
|
||||
* Pass NTFS_MNT_FORENSIC so that the mount process does not modify the
|
||||
* Pass MS_FORENSIC so that the mount process does not modify the
|
||||
* volume at all. We will do the logfile emptying and dirty setting
|
||||
* later if needed.
|
||||
*/
|
||||
if (!(vol = ntfs_mount(opt.volume, opt.ro_flag | NTFS_MNT_FORENSIC))) {
|
||||
if (!(vol = ntfs_mount(opt.volume, opt.ro_flag | MS_FORENSIC))) {
|
||||
int err = errno;
|
||||
|
||||
perr_printf("Opening '%s' as NTFS failed", opt.volume);
|
||||
|
|
Loading…
Reference in New Issue