From d4e2a501a5ce88fe0b0660c84d24f0a2c6617b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Tue, 21 Dec 2010 15:51:07 +0100 Subject: [PATCH] Enabled forensic mounting --- include/ntfs-3g/volume.h | 1 + libntfs-3g/volume.c | 8 ++++---- ntfsprogs/ntfsresize.c | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/include/ntfs-3g/volume.h b/include/ntfs-3g/volume.h index 9c8ab14c..b3f47bf9 100644 --- a/include/ntfs-3g/volume.h +++ b/include/ntfs-3g/volume.h @@ -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; diff --git a/libntfs-3g/volume.c b/libntfs-3g/volume.c index a30a33ad..21e68e9a 100644 --- a/libntfs-3g/volume.c +++ b/libntfs-3g/volume.c @@ -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: diff --git a/ntfsprogs/ntfsresize.c b/ntfsprogs/ntfsresize.c index f180c8ba..3e85c62c 100644 --- a/ntfsprogs/ntfsresize.c +++ b/ntfsprogs/ntfsresize.c @@ -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);