Commit Graph

5040 Commits

Author SHA1 Message Date
Jean-Pierre André
b9ad82ced7 Truncated SSD trimming zones to granularity supported by the device
When the trimming granularity is greater than the cluster size, the
free zones have to be truncated to match the granularity.
2019-01-23 17:43:47 +01:00
Jean-Pierre André
1ae6d818f0 Returned a low level error when an ioctl fails
When an ioctl fails, the errno is not correctly propagated, and the
log was wrong.
2019-01-23 17:40:23 +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é
facb697303 Fixed reacting to missing plugin
When a plugin is missing, dlopen() does not set errno, which leads
to erratic behavior. Set errno as ELIBACC when this occurs.
2019-01-23 17:33:15 +01:00
Jean-Pierre André
96825f3c2b Cleaned object ids beyond the updated part
An earlier patch enabled updating a file proper id without changing
the other id (birth, volume, domain). However the first time the id
is set, these other ids have to be zeroed.
2019-01-23 17:27:25 +01:00
Jean-Pierre André
7a3ed93463 Reverted accessing reparse directories through internal plugins
As similar reparse tags are being used for accessing OneDrive files
and directories, a similar policy has to be used for accessing them.
Until giving full access to OneDrive files with a local copy is
mature enough to have it processed internally, it is safer to have
it delegated to an external plugin. This reverts [4f450a]
2019-01-23 17:13:12 +01:00
Jean-Pierre André
da39fbf24a Fixed reporting an error when setxattr is rejected
When permissions are enabled and setxattr() is rejected, an error
must be returned even though the option silent is set. This is needed
for "cp -p" to know it has to try setting the permissions again and use
chmod().
2018-12-19 16:01:53 +01:00
Jean-Pierre André
85c1634a26 Fixed reporting an error when failed to build the mountpoint
The size check was inefficient because getcwd() uses an unsigned int
argument.
2018-12-19 15:57:50 +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é
1ea2003e96 Realigned times set from extended attribute
The alignment of times set in an extended attribute value cannot be
asserted, and this cause alignment errors on some CPUs (met on ARM).
Be safe by copying them in a properly aligned array.
2018-12-19 15:48:03 +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é
2514ce6a42 Attempted mounting read-only after failed permission to read-write
If a partition image could not be opened read-write, retry as read-only
2018-08-22 09:43:19 +02:00
Jean-Pierre André
d52b1ca929 Removed an unused field (cleanup)
Cleanup imported from the fuse library project.
2018-08-02 16:51:57 +02:00
Jean-Pierre André
9a8aeeea13 Prevented locally defined headers from interfering with ntfs-3g ones
Order the include directories so that those defined for ntfs-3g have
priority over locally defined ones.
2018-08-02 16:47:16 +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é
ad79372024 Checked whether the device to mount was forced read-only
Force the read-only mount mode when the device was set so through a
command "blockdev --setro".
2018-06-01 15:59:09 +02:00
Jean-Pierre André
1f8b751341 Double-checked whether record 15 is an extent of MFT
When extents are needed to store the runlist of the MFT, the first one
must be located in record 15 so that its location can be determined from
the part in the base extent. As this record is always marked in use,
determining whether it is not really in use requires a specific logic.
2018-02-13 09:06:49 +01: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é
163635f08f Fixed displaying an inode number in an error message
In an error message, the inode number was displayed in decimal without
taking off its generation number, making it difficult to interpret.
2018-02-13 08:47:00 +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é
d99a376a90 Documented read-only mount when Windows is hibernated
Document an earlier update which forced read-only mode when mounting
a partition which has been left by Windows in an inconsistent state
through hibernation or fast restarting.
2017-12-22 11:26:08 +01:00
Jean-Pierre André
9e92184b7c Allowed setting a file object id without defining its birth ids
Object ids can be used to locate files which have been move to another
volume. This is only possible when the birth ids are recorded, but in most
cases files reside on their birth volume and their birth ids are not set.
The patch enables setting a file id without changing its birth id, by
setting an extended attribute "system.ntfs_object_id" limited to 16
bytes.
2017-12-22 11:24:58 +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
Erik Larsson
a0bc659c7f lowntfs-3g.c: Fix compile error when struct stat doesn't have st_*tim.
The struct members for the time fields in struct stat vary depending on
platform, so introduce #ifdefs using the config.h-supplied definitions
for determining which stat time definition is appropriate.
2017-09-20 04:56:06 +02:00
Jean-Pierre André
4128e9da58 Logged falling back to mounting read-only
When the ntfs image is unclean, usually because it was not unmounted
properly from Windows, mounting read-write is denied and falls back
to read-only. Log this situation in the syslog, so that users mounting
through /etc/fstab can more easily know what is going on. Also remove
the "rw" option if it was stated.
2017-08-11 09:56:44 +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é
1611b21908 Enabled directory operations in plugins
Windows 10 brought a new type of reparse point for directories (0x80000018),
so add opendir() and readdir() to the plugin interface to take directories
into account. The interface for releasedir() is merged with release() as
the plugins can discriminate them if needed.
2017-08-11 09:42:37 +02:00
Jean-Pierre André
67feb2c286 Relaxed limitations on security descriptors
Windows 10 brought security descriptors which contain ACE's related to
new ways of accessing files or directories. These ACE are now accepted
with minimal consistency checks. They are still ignored for translating
permissions and for Windows-type inheritance.
2017-08-11 09:34:31 +02:00
Jean-Pierre André
d108009c7c Fixed a typo
A typo made a directive for plugin developers difficult to understand
2017-08-11 09:29:52 +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é
adb2cd24a8 Version 2017.3.23 2017-03-23 10:39:59 +01: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é
0595f888ae Version 2017.2.15 2017-02-15 17:04:57 +01:00