Commit Graph

1502 Commits

Author SHA1 Message Date
Jean-Pierre André
aecd9f011e Decoded execlink reparse data
Add execlink to the list of recognized reparse tags.
2020-03-08 09:57:27 +01:00
Jean-Pierre André
4c8d97cbd2 Fixed ntfsfallocate on a void file
The situation when there were no runlist when ntfsfallocate is applied
was not taken into account.
2020-03-08 09:51:48 +01:00
Jean-Pierre André
eddd96f9e6 Fixed a poorly sized string in ntfsinfo
A string overflow was possible, extend its size to worst case.
2020-03-08 09:44:52 +01:00
Jean-Pierre André
8e01e1ed65 Fixed a wrong fallthrough situation in ntfscat
A fallthrough situation was not intentional.
2020-03-08 09:42:15 +01:00
Jean-Pierre André
004709fcc1 Silenced warnings about fallthrough situations in switch cases of ntfsprogs
Insert comments to silence compiler about fallthrough situations when
they are wanted.
2020-03-08 09:38:00 +01:00
Jean-Pierre André
006799ab80 Fixed an endianness error in ntfscp
The file timestamp was not set according to CPU endianness.
2019-01-23 17:38:10 +01:00
Jean-Pierre André
f424cea20a Fixed a typo in the ntfscluster manual
An essential word was missing.
2018-12-19 15:53:08 +01:00
Jean-Pierre André
e87c853551 Fixed collecting the label argument in mkntfs
The label argument could be wrongly interpreted, depending on the syntax
use to state the options.
2018-08-22 09:46:30 +02:00
Jean-Pierre André
90c361e7f8 Allocated full clusters for reading and rescuing in ntfsclone
Even though mft or index records may be smaller than a cluster,
reading and rescuing them is done on a full cluster base, so
full clusters must be allocated for processing them.
2018-08-02 16:41:19 +02:00
Jean-Pierre André
f862fcee00 Extended the allowed cluster size to 2MB
From Windows 10 Creators edition, the cluster size limit has been
extended to 2MB. This has implied redefining the boot sector field
"sectors_per_cluster" so that values greater than 128 can be recorded.
2018-06-01 16:29:01 +02:00
Jean-Pierre André
e758709a2c Appended a number to undeleted file name to avoid overwriting an existing one
When an undeleted file name conflicts with an existing one, it is
renamed in order to preserve the existing one.
2018-06-01 16:21:33 +02:00
Jean-Pierre André
a951ed7f61 Added an option to ntfscp to copy the modification time
When using option -t the modification timestamp is copied by ntfscp
2018-06-01 16:18:51 +02:00
Jean-Pierre André
4f450a35f5 Made accessing reparse directories through internal plugins
When the bit 28 of a reparse tag is set on a directory, the reparse
information should be ignored and the directory should be accessed
the usual way (this setting is new to Windows 10). In such a situation
access to the directory through an internal plugin rather than through
an external one.
The same policy applies to REPARSE_TAG_WCI which had been defined
earlier without the bit 28 being set.
2018-06-01 16:08:33 +02:00
Jean-Pierre André
f334c1fdc3 Delayed updating the MFT runlist when resizing in read-only mode
When trying a resize in "no action" (read-only) mode, and the MFT runlist
has to be reorganized to take its new fragmentation into account, the updated
runlist cannot be read from the device while updating the runlist of
normal files. To avoid having to read the updated runlist, the update
is delayed so that the original runlist is used. As a consequence the test
of reorganizing the runlists is only an approximation of what would happen
in a real resize.
2018-02-13 08:54:12 +01:00
Jean-Pierre André
b30460fede Removed an obsolete reference for getting support
Remove from the ntfsresize man page an archaic url for getting support.
2018-02-13 08:43:53 +01:00
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