Commit Graph

1487 Commits

Author SHA1 Message Date
Jean-Pierre André
3243e62396 Supported reparse tags for OneDrive cloud storage
Newer versions of Windows 10 use several reparse tags for files which
are synchronized to OneDrive cloud storage (0x9000301a, 0x9000601a,
0x9000701a, ...). identify them as IO_REPARSE_TAG_CLOUD and use a
single plugin to process them.
2018-01-15 11:04:29 +01:00
Jean-Pierre André
5239986093 Silenced compiler warnings in ntfsrecover
Silence the compiler warnings which were introduced in a recent update.
2017-12-22 11:37:58 +01:00
Jean-Pierre André
85e208176f Stopped checking matches of MFTMirr against MFT at record 16
Since its 2017 edition, Windows 10 has stopped mirroring $MFT to the
full size of $MFTMirr leading to mounts of partitions with big clusters
to be rejected because of mismatches. With this patch, only 16 records
are checked, though mirroring is still done for all records in $MFTMirr.
2017-12-22 11:29:00 +01:00
Jean-Pierre André
1f863fef7d Processed redo log actions associated to undoing a CompensationlogRecord
At least when there is a shortage of space on the target device, several
redo actions are associated to undoing a CompensationlogRecord, and they
should be redone upon recovery.
2017-10-26 10:44:36 +02:00
Jean-Pierre André
f06672a02c Checked log file blocks more recent than temporary ones
Under some circumstances, the temporary log file blocks are not the
latest ones, so check whether there are more recent ones.
Only done for log version 1.x, as log version 2.x follow a different
logic.
2017-10-26 10:40:17 +02:00
Jean-Pierre André
02747ea647 Aligned internal log buffers on CPUs which require them
The generic buffer structure should respect the alignment of included
log structures. This is required by some CPUs (such as Sparc).
2017-10-26 10:33:29 +02:00
Jean-Pierre André
45ba639781 Decoded more reparse tags in ntfsinfo
Displayed some information in ntfsinfo output about a few new types of
reparse point brought by Windows 10.
2017-08-11 09:52:54 +02:00
Jean-Pierre André
cdd58aaee3 Fixed updating the vcn of subtree in ntfsrecover
The logic for determining where the actions SetIndexEntryVcnRoot and
SetIndexEntryVcnAllocation had to insert a new vcn was unclear and was
wrong in some situations. This is to fix the logic as determined by new
evidence.
2017-06-20 08:56:00 +02:00
Jean-Pierre André
866f5cf9e6 Mentioned ntfsfallocate and ntfsrecover in the general ntfsprogs manual
The most recent ntfsprogs utilities should be referenced in the table of
contents.
2017-06-20 08:51:09 +02:00
Jean-Pierre André
5be0b9f62a Fixed the computation of highest_vcn when applying a runlist fixup
When a file is partially truncated, the highest_vcn has to be recomputed
before the file size is adjusted. As a consequence the unmapped run
inserted at the end of runlist to match the file size should not be taken
into account when determining the higest_vcn.
2017-05-25 10:52:54 +02:00
Jean-Pierre André
1797ab5ecd Upgraded ntfsrecover to support log files 2.0
When the fast restart mode of Windows 8 (or later) is activated, the
log file format is different (version 2.0 instead of 1.1), having 32
temporaty blocks instead of 2. This patch upgrades ntfsrecover to take
the new format into account.
2017-05-25 10:44:18 +02:00
Jean-Pierre André
ba810877ca Bypassed cluster allocation errors using --ignore-fs-check in ntfsclone
When using option --ignore-fs-check in ntfsclone, doubly allocated cluster
still lead to aborting the process. Bypassing the error is useful for
creating a metadata image intended for debugging, for example when the
partition was not closed properly and the logfile has to be applied to
restore the integrity of metadata.
2017-05-25 10:28:05 +02:00
Jean-Pierre André
79ea3b49b1 Fixed computing the replacement bytes in ntfswipe
The computing of replacement bytes for overwriting undeletable files
uses random values and standard ones instead of the values provided in
option --bytes. Fix the mixup between both logics, mention the difference
in the documentation and reject defining both options --bytes and --undel.
2017-03-22 17:49:40 +01:00
Erik Larsson
b11a5ea91b ntfsusermap.c: Fix warning about implicit conversion between enums. 2017-03-21 12:06:04 +01:00
Erik Larsson
f0d3751c98 Fix bad native->little endian byteswap of little endian value. 2017-03-21 11:58:30 +01:00
Erik Larsson
65f63fe2b3 Use signed endian conversion macros for signed little-endian members. 2017-03-21 11:55:41 +01:00
Jean-Pierre André
275edd5353 Removed the loader from boot image
The license for using the boot loader which used to be inserted by mkntfs
is unclear, so remove it, and only keep the boot sector restricted to
what is needed for having it recognized as such. The space for a loader
is still reserved so that an operating system being installed can insert
its own loader.
2017-03-18 15:42:00 +01:00
Jean-Pierre André
94677ae961 Accepted displaying bad security descriptors on conditions
Display security descriptors in ntfssecaudit when they appear as
correctly formed, even when they contain unsupported items.
2017-02-11 10:37:47 +01:00
Jean-Pierre André
8f0fbd286d Fixed updating the backup boot sector in ntfslabel
The location of the backup boot sector was one-off
2017-02-11 09:22:50 +01:00
Jean-Pierre André
2eb5052480 Decoded the reparse tag for deduplication in ntfsinfo
Take into account the reparse tag for deduplication and display its meaning
2017-02-11 09:11:51 +01:00
Jean-Pierre André
b66f5f8241 Replaced secaudit by ntfssecaudit in its own usage output
The usage output did not match the command name change
2017-02-11 08:57:37 +01:00
Jean-Pierre André
ab4c6a6141 Fixed tautological comparison
Wrong comparison in ntfscmp.c
2016-07-28 16:19:29 +02:00
Jean-Pierre André
38ff4602a7 Cleared the sparse flags when clearing the bad cluster list
The bad cluster list may be updated in ntfsresize and ntfsfix. Though
technically it is organized as a sparse file, Windows does not set
the sparse flags. Do the same to avoid problems with third-party
packages.
2016-07-19 11:44:59 +02:00
Jean-Pierre André
4278fbb7f6 Defined an option to kill the Windows cache and play the log file
The new ntfsrecover option --kill-fast-restart can be used to delete
the Windows fast-restart indication before playing the log. This can
lead to data loss, but is needed before mounting a partition improperly
unmounted from Windows when remounting on Windows is inconvenient.
2016-05-04 09:47:51 +02:00
Jean-Pierre André
0c855fe36b Used Microsoft terminology for SID names
A few SIDs descriptions might be confusing because of a wording different
from Microsoft usage.
2016-05-04 09:33:42 +02:00
Jean-Pierre André
df01bf1b4d Displayed the SID revision as an unsigned number (cosmetic)
Properly display a SID revision if it should ever reach 128.
(suggested by Ulf Zibis)
2016-05-04 09:30:48 +02:00
Jean-Pierre André
1b8b599408 Checked the number of subauthorities before accessing them
Be more crash resistent when analyzing a badly formed SID.
(contributed by Ulf Zibis)
2016-05-04 09:27:32 +02:00
Jean-Pierre André
d587ff54f9 Fixed segmentation fault on empty $LogFile in ntfsrecover
ntfsrecover -f -v <log file> receives a SIGSEGV because of trying to
read memory outside allocated buffer because of no sanity checks on
restart page header values. This happens on an empty $LogFile because
of no basic checks present. Attached patch adds basic checks similar
to those inside logfile library and allows tool to exit with more
suitable message.
(contributed by Rakesh Pandit)
2016-05-04 09:24:51 +02:00
Jean-Pierre André
1840b52d12 Fixed a missing "break" in ntfssecaudit.c
A missing "break" in a case construct could be troublesome.
(suggested by Ulf Zibis)
2016-05-04 09:19:39 +02:00
Jean-Pierre André
df7f3b9151 Fixed indentation in ntfssecaudit.c (cosmetic)
There was an abusive indentation.
2016-05-04 09:15:43 +02:00
Jean-Pierre André
3d7a28bfa5 Adapted secaudit and usermap (now ntfssecaudit and ntfsusermap) to ntfsprogs
These tools were originally developed for running on Windows and later
ported to libntfs-3g. This patch makes them similar to other ntfsprogs
tools, dropping the native Windows interfaces and using libntfs-3g on
all platforms.

There is no change in usage or supported features, only the command
names have changed.
2016-04-07 09:20:23 +02:00
Jean-Pierre André
0ded128808 Moved secaudit and usermap to directory ntfsprogs
These tools were developped before the ntfsprogs were merged into ntfs-3g,
redesigning them like the ntfsprogs make the code simpler.

Note : at this stage secaudit and usermap cannot be built any more.
2016-04-07 09:07:13 +02:00
Jean-Pierre André
7917a0a6cc Fixed indentation in ntfsclone help text (cosmetic)
The tabs in source code appear differently in actual output.
2016-04-06 11:09:35 +02:00
Jean-Pierre André
18a66b7a9a Fixed a spelling error in ntfsresize manual (cosmetic)
an other -> another
2016-04-06 11:07:30 +02:00
Jean-Pierre André
3cc22ba329 Moved general declarations from ntfsrecover.h to logfile.h
The declarations related to the log file structure are now grouped
in logfile.h, those specific to the recovery process are kept in
ntfsrecover.h
2016-04-06 11:03:31 +02:00
Jean-Pierre André
9693dd2fc1 Added a usn field to RESTART_PAGE_HEADER
Prepare merging ntfsrecover.h into logfile.h by adding a usn field to
RESTART_PAGE_HEADER. As this changes the record size, ignore the new
field in existing code.
2016-04-06 10:58:25 +02:00
Jean-Pierre André
60ba821ece Renamed reserved fields in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by naming reserved fields
the same way.
2016-04-06 10:54:51 +02:00
Jean-Pierre André
234cae2a1b Renamed record_length as log_record_header_length in ntfsrecover.h
Prepare merging ntfsrecover.h into logfile.h by naming the record
header length the same way.
2016-04-06 10:52:18 +02:00
Jean-Pierre André
b977f18c6e Renamed restart_offset as restart_area_offset in ntfsrecover.h
Prepare merging ntfsrecover.h into logfile.h by renaming the restart
offset the same way.
2016-04-06 10:50:31 +02:00
Jean-Pierre André
ad59ecec3f Redefined target_vcn on 64 bits in ntfsrecover.h
In a log record, the target vcn has to be stored on 64 bits
2016-04-06 10:45:30 +02:00
Jean-Pierre André
044f2104f9 Redefined file_offset on 64 bits in ntfsrecover.h
The log file offsets are apparently stored on 64 bits, though the file
size is unlikely to reach 2MB.
2016-04-06 10:40:28 +02:00
Jean-Pierre André
d947ffa834 Unfolded record headers in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by unfolding the record
headers the same way.
2016-04-06 10:38:06 +02:00
Jean-Pierre André
a6f4bae6d5 Typedef'ed new structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring new structs
the same was as in logfile.h
2016-04-06 10:34:46 +02:00
Jean-Pierre André
2ab8bb509a Typedef'ed old structs in ntfsrecover the same way as in logfile.h
Prepare merging ntfsrecover.h into logfile.h by declaring duplicated
structs the same way
2016-04-06 10:32:39 +02:00
Jean-Pierre André
71b03fbd16 Redefined ntfsrecover enums as little-endian values
Rather than cpu-endian values, use little-endian ones in ntfsrecover
for similarity with layout.h
2016-04-06 10:26:46 +02:00
Jean-Pierre André
6cb8913967 Translated directory separators when running ntfscluster on Windows
Use \ as a directory separator when running on Windows.
2016-04-06 10:11:08 +02:00
Jean-Pierre André
b6b100b588 Added clarification about creating a partition to the ntfsclone manual
Try to make clear the option --output feeds data into a partition, but
does not create the partition.
2016-04-06 09:27:07 +02:00
Jean-Pierre André
8e550e712d Added an option for preserving the full log file in ntfsclone
Usually, only a few pages of the Windows log file are saved in an
ntfsclone image. This is inappropriate for building reference images
for recovering the log, and the --full-logfile option serves that
purpose.
2016-04-06 08:51:36 +02:00
Jean-Pierre André
8fc9c96305 Reworked decisions to undo related to unreadable records
When an INDX or MFT record could not be read while undoing the creation
of this record, there is nothing to do. However if this was undoing the
deletion of the last entry in an index, a new void index block has to be
created.
2016-04-06 08:44:38 +02:00
Erik Larsson
038a45a8a1 Fix compilation errors on OpenIndiana caused by missing limit macros. 2016-02-16 20:43:00 +01:00