OSDN Git Service

android-x86/external-ntfs-3g.git
3 years agoBuilt reparse symlinks from mount point recorded in volume
Jean-Pierre André [Tue, 26 Jan 2021 09:06:17 +0000 (10:06 +0100)]
Built reparse symlinks from mount point recorded in volume

When building a symlink to emulate a Windows junction or absolute
symlink, use the mount point recorded in the volume attributes.
This enables the plugins to emulate object as symlinks.

3 years agoChecked file type on OpenIndiana when deleting a file with a reparse point
Jean-Pierre André [Tue, 26 Jan 2021 09:06:17 +0000 (10:06 +0100)]
Checked file type on OpenIndiana when deleting a file with a reparse point

On OpenIndiana a check is needed to ensure directories are not removed
by rm(1) and files not removed by rmdir(1)

3 years agoInserted the reparse tag in the bad reparse symlink
Jean-Pierre André [Tue, 26 Jan 2021 09:06:17 +0000 (10:06 +0100)]
Inserted the reparse tag in the bad reparse symlink

The reparse tag is not quoted in the "unsupported reparse point"
fake symlink shown when a reparse point cannot be processed. The tag
is useful to determine which plugin, if any, is missing.

3 years agoEnabled actions on directories in reparse plugins
Jean-Pierre André [Tue, 26 Jan 2021 09:06:17 +0000 (10:06 +0100)]
Enabled actions on directories in reparse plugins

The plugins triggered by reparse points can now act on a directory
through link(2) unlink(2) and creat(2).

3 years agoFixed maintining the allocated size when updating sparse files
Jean-Pierre André [Wed, 18 Nov 2020 10:33:49 +0000 (11:33 +0100)]
Fixed maintining the allocated size when updating sparse files

When filling a hole in a sparse file, the beginning of the runlist
does not need to be updated. However the allocated size is within
the extent holding its beginning and it needs to be updated.

3 years agoAllowed customization of sbin for tool directory
Jean-Pierre André [Wed, 18 Nov 2020 10:29:05 +0000 (11:29 +0100)]
Allowed customization of sbin for tool directory

Enabled the configure option --sbindir to define where a few ntfsprogs
tools should be installed

4 years agoChange default xattr access method to 'openxattr' for macOS builds.
Erik Larsson [Tue, 25 Aug 2020 08:29:42 +0000 (11:29 +0300)]
Change default xattr access method to 'openxattr' for macOS builds.

The namespaced way of accessing extended attributes doesn't make sense
in macOS which doesn't use namespaces.

4 years agoAdd support for 'position' argument in macOS xattr functions.
Erik Larsson [Tue, 25 Aug 2020 08:26:29 +0000 (11:26 +0300)]
Add support for 'position' argument in macOS xattr functions.

The 'position' argument is only used for the legacy resource fork and is
disallowed for other extended attributes. The name check is placed first
in the functions as this is how macOS behaves (EINVAL is returned if the
attribute is not the resource fork attribute and the position is non-0
even when the attribute does not exist).

4 years agoReplace ENODATA with ENOATTR in xattrs functions for macOS builds.
Erik Larsson [Mon, 24 Aug 2020 13:50:18 +0000 (16:50 +0300)]
Replace ENODATA with ENOATTR in xattrs functions for macOS builds.

The contract in macOS xattr functions is to return ENOATTR when an
extended attribute cannot be found.

4 years agoFixed possible null dereferencings
Jean-Pierre André [Fri, 14 Aug 2020 10:03:09 +0000 (12:03 +0200)]
Fixed possible null dereferencings

A null directory pointer could appear as being dereferenced. Fix that,
though it probably never occurs in real conditions.

4 years agoRecovered space when an index root is shortened
Jean-Pierre André [Fri, 14 Aug 2020 09:57:02 +0000 (11:57 +0200)]
Recovered space when an index root is shortened

In rare situations, removing an entry from an index root while
rebalancing the index tree, its space was not recovered from the index
root, causing chkdsk to complain. Truncate the index root when this
happens.

4 years agoDefined option "posix_nlink" to compute a Posix compliant st_nlink
Jean-Pierre André [Fri, 14 Aug 2020 09:50:35 +0000 (11:50 +0200)]
Defined option "posix_nlink" to compute a Posix compliant st_nlink

When the mount option "posix_nlink" is used, the number of links
returned by stat complies with Posix : the legacy 8.3 names are not
taken into account, and the subdirectories are taken into account
for directories. This causes some overhead for recomputing the
number of links.

4 years agoAvoided information leak when processing garbled compressed data
Jean-Pierre André [Fri, 14 Aug 2020 09:36:57 +0000 (11:36 +0200)]
Avoided information leak when processing garbled compressed data

When a compressed file has been deteriorated through hardware error
or accidental overwriting, some unrelated data could be leaked.
Make sure to zero fill the buffer when this happens.

4 years agoDisplayed the plugin path in the basic help message
Jean-Pierre André [Fri, 14 Aug 2020 09:32:50 +0000 (11:32 +0200)]
Displayed the plugin path in the basic help message

The ntfs-3g plugin directory depends on the distribution and may be
difficult to determine. This displays the directory in the basic help.

4 years agoUsed kernel cacheing on read-only mounts or with lowntfs-3g
Jean-Pierre André [Fri, 14 Aug 2020 09:27:24 +0000 (11:27 +0200)]
Used kernel cacheing on read-only mounts or with lowntfs-3g

Kernel cacheing is now safe when using lowntfs-3g on Linux. It is also
safe on read-only mounts with both ntfs-3g and lowntfs-3g.

4 years agoFixed defining the request argument of ioctl()
Jean-Pierre André [Sun, 8 Mar 2020 09:34:17 +0000 (10:34 +0100)]
Fixed defining the request argument of ioctl()

An occurrence of changing the request from int to unsigned long was
missing.

4 years agoExported the translations of Windows paths
Jean-Pierre André [Sun, 8 Mar 2020 09:17:21 +0000 (10:17 +0100)]
Exported the translations of Windows paths

The translations of Windows paths designed for translating Windows symlinks
and mount points may also be used in plugins for translation execlinks,
so make them available.

4 years agoFixed object types returned in readdir() for reparse points
Jean-Pierre André [Sun, 8 Mar 2020 09:03:23 +0000 (10:03 +0100)]
Fixed object types returned in readdir() for reparse points

The types of reparse point objects cannot be decided upon the data
available in a directory, so we must delegate their determination to a
specific plugin when available, and be consistent if there is none.

4 years agoDecoded execlink reparse data
Jean-Pierre André [Sun, 8 Mar 2020 08:57:27 +0000 (09:57 +0100)]
Decoded execlink reparse data

Add execlink to the list of recognized reparse tags.

4 years agoFixed ntfsfallocate on a void file
Jean-Pierre André [Sun, 8 Mar 2020 08:51:48 +0000 (09:51 +0100)]
Fixed ntfsfallocate on a void file

The situation when there were no runlist when ntfsfallocate is applied
was not taken into account.

4 years agoFixed a poorly sized string in ntfsinfo
Jean-Pierre André [Sun, 8 Mar 2020 08:44:52 +0000 (09:44 +0100)]
Fixed a poorly sized string in ntfsinfo

A string overflow was possible, extend its size to worst case.

4 years agoFixed a wrong fallthrough situation in ntfscat
Jean-Pierre André [Sun, 8 Mar 2020 08:42:15 +0000 (09:42 +0100)]
Fixed a wrong fallthrough situation in ntfscat

A fallthrough situation was not intentional.

4 years agoSilenced warnings about fallthrough situations in switch cases of ntfsprogs
Jean-Pierre André [Sun, 8 Mar 2020 08:38:00 +0000 (09:38 +0100)]
Silenced warnings about fallthrough situations in switch cases of ntfsprogs

Insert comments to silence compiler about fallthrough situations when
they are wanted.

4 years agoSilenced warnings about string lengths in snprintf()
Jean-Pierre André [Sun, 8 Mar 2020 08:29:04 +0000 (09:29 +0100)]
Silenced warnings about string lengths in snprintf()

Adjust string lengths to the worst case estimated by the compiler, even
though they cannot be reached.

4 years agoSilenced warnings about fallthrough situations in libntfs-3g
Jean-Pierre André [Sat, 7 Mar 2020 11:00:11 +0000 (12:00 +0100)]
Silenced warnings about fallthrough situations in libntfs-3g

Insert a comment when fallthrough situations are desired in switch cases.

4 years agoAvoided using a truncate strncpy() in the fuse library
Jean-Pierre André [Sat, 7 Mar 2020 10:56:46 +0000 (11:56 +0100)]
Avoided using a truncate strncpy() in the fuse library

Replace strncpy() by memcpy() when the exact size if known, thus
silencing the compiler warnings.

4 years agoRemoved <linux/fs.h> from lowntfs-3g.c
Jean-Pierre André [Sat, 7 Mar 2020 10:50:26 +0000 (11:50 +0100)]
Removed <linux/fs.h> from lowntfs-3g.c

The headers from <linux.fs.h> now conflicts with <sys/uio.h> and are
not needed any more, so remove them.

4 years agoDisabled the use of cache in lowntfs-3g
Jean-Pierre André [Sat, 7 Mar 2020 10:43:49 +0000 (11:43 +0100)]
Disabled the use of cache in lowntfs-3g

Following some change in the Linux kernel, the kernel cacheing of
attributes is not satisfactory (at least the number of hard links is
not refreshed), and has to be disabled.

4 years agoFixed returning EPERM when not allowed as owner
Jean-Pierre André [Sat, 7 Mar 2020 10:35:48 +0000 (11:35 +0100)]
Fixed returning EPERM when not allowed as owner

For actions which may be allowed depending on the ownership rather than
permissions (such as utime()), return EPERM if the owner cannot be
determined.

4 years agoFixed returning errno in setxattr
Jean-Pierre André [Sat, 7 Mar 2020 09:51:53 +0000 (10:51 +0100)]
Fixed returning errno in setxattr

In case of error in setxattr, it must be returned in errno instead
of the return value.

4 years agoAccepted alternative recording of cluster size
Jean-Pierre André [Sat, 7 Mar 2020 09:43:00 +0000 (10:43 +0100)]
Accepted alternative recording of cluster size

Since Windows 10, the cluster size may be greater than 128 sectors, and
it has to be recorded as a power of 2 in the boot sector. Hence there
are two possible ways of cluster size. Accept both ways leading to
valid values.

4 years agoDefined the request argument of ioctl() as unsigned long
Jean-Pierre André [Sat, 7 Mar 2020 09:31:12 +0000 (10:31 +0100)]
Defined the request argument of ioctl() as unsigned long

On linux the request argument of ioctl() is defined as an unsigned long,
but the fuse protocol squashes it into a signed int. As a consequence
the value received by ntfs-3g may appear as negative and different from
the value defined by the corresponding macro.
So define the request argument as unsigned long in ntfs-3g. It has
however to be fed as unsigned from fuse until the fuse protocol is
updated.

4 years agoUpdated the copyright notice
Jean-Pierre André [Sat, 7 Mar 2020 09:18:01 +0000 (10:18 +0100)]
Updated the copyright notice

Updated the copyright notice to 2019

5 years agoTruncated SSD trimming zones to granularity supported by the device
Jean-Pierre André [Wed, 23 Jan 2019 16:43:47 +0000 (17:43 +0100)]
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.

5 years agoReturned a low level error when an ioctl fails
Jean-Pierre André [Wed, 23 Jan 2019 16:40:23 +0000 (17:40 +0100)]
Returned a low level error when an ioctl fails

When an ioctl fails, the errno is not correctly propagated, and the
log was wrong.

5 years agoFixed an endianness error in ntfscp
Jean-Pierre André [Wed, 23 Jan 2019 16:38:10 +0000 (17:38 +0100)]
Fixed an endianness error in ntfscp

The file timestamp was not set according to CPU endianness.

5 years agoFixed reacting to missing plugin
Jean-Pierre André [Wed, 23 Jan 2019 16:33:15 +0000 (17:33 +0100)]
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.

5 years agoCleaned object ids beyond the updated part
Jean-Pierre André [Wed, 23 Jan 2019 16:27:25 +0000 (17:27 +0100)]
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.

5 years agoReverted accessing reparse directories through internal plugins
Jean-Pierre André [Wed, 23 Jan 2019 16:13:12 +0000 (17:13 +0100)]
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]

5 years agoFixed reporting an error when setxattr is rejected
Jean-Pierre André [Wed, 19 Dec 2018 15:01:53 +0000 (16:01 +0100)]
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().

5 years agoFixed reporting an error when failed to build the mountpoint
Jean-Pierre André [Wed, 19 Dec 2018 14:57:50 +0000 (15:57 +0100)]
Fixed reporting an error when failed to build the mountpoint

The size check was inefficient because getcwd() uses an unsigned int
argument.

5 years agoFixed a typo in the ntfscluster manual
Jean-Pierre André [Wed, 19 Dec 2018 14:53:08 +0000 (15:53 +0100)]
Fixed a typo in the ntfscluster manual

An essential word was missing.

5 years agoRealigned times set from extended attribute
Jean-Pierre André [Wed, 19 Dec 2018 14:48:03 +0000 (15:48 +0100)]
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.

6 years agoFixed collecting the label argument in mkntfs
Jean-Pierre André [Wed, 22 Aug 2018 07:46:30 +0000 (09:46 +0200)]
Fixed collecting the label argument in mkntfs

The label argument could be wrongly interpreted, depending on the syntax
use to state the options.

6 years agoAttempted mounting read-only after failed permission to read-write
Jean-Pierre André [Wed, 22 Aug 2018 07:43:19 +0000 (09:43 +0200)]
Attempted mounting read-only after failed permission to read-write

If a partition image could not be opened read-write, retry as read-only

6 years agoRemoved an unused field (cleanup)
Jean-Pierre André [Thu, 2 Aug 2018 14:51:57 +0000 (16:51 +0200)]
Removed an unused field (cleanup)

Cleanup imported from the fuse library project.

6 years agoPrevented locally defined headers from interfering with ntfs-3g ones
Jean-Pierre André [Thu, 2 Aug 2018 14:47:16 +0000 (16:47 +0200)]
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.

6 years agoAllocated full clusters for reading and rescuing in ntfsclone
Jean-Pierre André [Thu, 2 Aug 2018 14:41:19 +0000 (16:41 +0200)]
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.

6 years agoExtended the allowed cluster size to 2MB
Jean-Pierre André [Fri, 1 Jun 2018 14:29:01 +0000 (16:29 +0200)]
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.

6 years agoAppended a number to undeleted file name to avoid overwriting an existing one
Jean-Pierre André [Fri, 1 Jun 2018 14:21:33 +0000 (16:21 +0200)]
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.

6 years agoAdded an option to ntfscp to copy the modification time
Jean-Pierre André [Fri, 1 Jun 2018 14:18:51 +0000 (16:18 +0200)]
Added an option to ntfscp to copy the modification time

When using option -t the modification timestamp is copied by ntfscp

6 years agoMade accessing reparse directories through internal plugins
Jean-Pierre André [Fri, 1 Jun 2018 14:08:33 +0000 (16:08 +0200)]
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.

6 years agoChecked whether the device to mount was forced read-only
Jean-Pierre André [Fri, 1 Jun 2018 13:59:09 +0000 (15:59 +0200)]
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".

6 years agoDouble-checked whether record 15 is an extent of MFT
Jean-Pierre André [Tue, 13 Feb 2018 08:06:49 +0000 (09:06 +0100)]
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.

6 years agoDelayed updating the MFT runlist when resizing in read-only mode
Jean-Pierre André [Tue, 13 Feb 2018 07:54:12 +0000 (08:54 +0100)]
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.

6 years agoFixed displaying an inode number in an error message
Jean-Pierre André [Tue, 13 Feb 2018 07:47:00 +0000 (08:47 +0100)]
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.

6 years agoRemoved an obsolete reference for getting support
Jean-Pierre André [Tue, 13 Feb 2018 07:43:53 +0000 (08:43 +0100)]
Removed an obsolete reference for getting support

Remove from the ntfsresize man page an archaic url for getting support.

6 years agoSupported reparse tags for OneDrive cloud storage
Jean-Pierre André [Mon, 15 Jan 2018 10:04:29 +0000 (11:04 +0100)]
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.

6 years agoSilenced compiler warnings in ntfsrecover
Jean-Pierre André [Fri, 22 Dec 2017 10:37:58 +0000 (11:37 +0100)]
Silenced compiler warnings in ntfsrecover

Silence the compiler warnings which were introduced in a recent update.

6 years agoStopped checking matches of MFTMirr against MFT at record 16
Jean-Pierre André [Fri, 22 Dec 2017 10:29:00 +0000 (11:29 +0100)]
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.

6 years agoDocumented read-only mount when Windows is hibernated
Jean-Pierre André [Fri, 22 Dec 2017 10:26:08 +0000 (11:26 +0100)]
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.

6 years agoAllowed setting a file object id without defining its birth ids
Jean-Pierre André [Fri, 22 Dec 2017 10:24:58 +0000 (11:24 +0100)]
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.

6 years agoProcessed redo log actions associated to undoing a CompensationlogRecord
Jean-Pierre André [Thu, 26 Oct 2017 08:44:36 +0000 (10:44 +0200)]
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.

6 years agoChecked log file blocks more recent than temporary ones
Jean-Pierre André [Thu, 26 Oct 2017 08:40:17 +0000 (10:40 +0200)]
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.

6 years agoAligned internal log buffers on CPUs which require them
Jean-Pierre André [Thu, 26 Oct 2017 08:33:29 +0000 (10:33 +0200)]
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).

6 years agolowntfs-3g.c: Fix compile error when struct stat doesn't have st_*tim.
Erik Larsson [Wed, 20 Sep 2017 02:56:06 +0000 (04:56 +0200)]
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.

7 years agoLogged falling back to mounting read-only
Jean-Pierre André [Fri, 11 Aug 2017 07:56:44 +0000 (09:56 +0200)]
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.

7 years agoDecoded more reparse tags in ntfsinfo
Jean-Pierre André [Fri, 11 Aug 2017 07:52:54 +0000 (09:52 +0200)]
Decoded more reparse tags in ntfsinfo

Displayed some information in ntfsinfo output about a few new types of
reparse point brought by Windows 10.

7 years agoEnabled directory operations in plugins
Jean-Pierre André [Fri, 11 Aug 2017 07:42:37 +0000 (09:42 +0200)]
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.

7 years agoRelaxed limitations on security descriptors
Jean-Pierre André [Fri, 11 Aug 2017 07:34:31 +0000 (09:34 +0200)]
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.

7 years agoFixed a typo
Jean-Pierre André [Fri, 11 Aug 2017 07:29:52 +0000 (09:29 +0200)]
Fixed a typo

A typo made a directive for plugin developers difficult to understand

7 years agoFixed updating the vcn of subtree in ntfsrecover
Jean-Pierre André [Tue, 20 Jun 2017 06:56:00 +0000 (08:56 +0200)]
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.

7 years agoMentioned ntfsfallocate and ntfsrecover in the general ntfsprogs manual
Jean-Pierre André [Tue, 20 Jun 2017 06:51:09 +0000 (08:51 +0200)]
Mentioned ntfsfallocate and ntfsrecover in the general ntfsprogs manual

The most recent ntfsprogs utilities should be referenced in the table of
contents.

7 years agoFixed the computation of highest_vcn when applying a runlist fixup
Jean-Pierre André [Thu, 25 May 2017 08:52:54 +0000 (10:52 +0200)]
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.

7 years agoUpgraded ntfsrecover to support log files 2.0
Jean-Pierre André [Thu, 25 May 2017 08:44:18 +0000 (10:44 +0200)]
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.

7 years agoBypassed cluster allocation errors using --ignore-fs-check in ntfsclone
Jean-Pierre André [Thu, 25 May 2017 08:28:05 +0000 (10:28 +0200)]
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.

7 years agoVersion 2017.3.23
Jean-Pierre André [Thu, 23 Mar 2017 09:39:59 +0000 (10:39 +0100)]
Version 2017.3.23

7 years agoFixed computing the replacement bytes in ntfswipe
Jean-Pierre André [Wed, 22 Mar 2017 16:49:40 +0000 (17:49 +0100)]
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.

7 years agontfsusermap.c: Fix warning about implicit conversion between enums.
Erik Larsson [Tue, 21 Mar 2017 11:06:04 +0000 (12:06 +0100)]
ntfsusermap.c: Fix warning about implicit conversion between enums.

7 years agoFix bad native->little endian byteswap of little endian value.
Erik Larsson [Tue, 21 Mar 2017 10:58:30 +0000 (11:58 +0100)]
Fix bad native->little endian byteswap of little endian value.

7 years agoUse signed endian conversion macros for signed little-endian members.
Erik Larsson [Tue, 21 Mar 2017 10:55:41 +0000 (11:55 +0100)]
Use signed endian conversion macros for signed little-endian members.

7 years agoRemoved the loader from boot image
Jean-Pierre André [Sat, 18 Mar 2017 14:42:00 +0000 (15:42 +0100)]
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.

7 years agoVersion 2017.2.15
Jean-Pierre André [Wed, 15 Feb 2017 16:04:57 +0000 (17:04 +0100)]
Version 2017.2.15

7 years agoLoaded the fuse kernel module with no environment
Jean-Pierre André [Sat, 11 Feb 2017 10:03:02 +0000 (11:03 +0100)]
Loaded the fuse kernel module with no environment

Avoided leaking the current environment when loading the fuse kernel
module

7 years agoFixed expanding $STANDARD_INFORMATION with almost-full MFT record
Jean-Pierre André [Sat, 11 Feb 2017 09:58:46 +0000 (10:58 +0100)]
Fixed expanding $STANDARD_INFORMATION with almost-full MFT record

When setting a security descriptor on an NTFS v1.2 format file in an
NTFS v3.0+ volume, NTFS-3G would migrate $STANDARD_INFORMATION to the
new format, which requires extending its size from 48 to 72 bytes.  If
this happened while the file's MFT record was almost full, and none of
the file's attributes could be made non-resident, and the file did not
have an attribute list attribute, then the operation would unexpectedly
fail with ENOENT.  Fix this by adding an attribute list to the file in
this situation.

(contributed by Eric Biggers)

7 years agoAllowed names with trailing dot or space on conditions
Jean-Pierre André [Sat, 11 Feb 2017 09:54:51 +0000 (10:54 +0100)]
Allowed names with trailing dot or space on conditions

Windows places filenames with a trailing dot or space in the Win32
namespace and allows setting DOS names on such files.  This is true even
though on Windows such filenames can only be created and accessed using
WinNT-style paths and will confuse most Windows software.  Regardless,
because libntfs-3g did not allow setting DOS names on such files, in
some cases it was impossible to correctly restore, using libntfs-3g, a
directory structure that was created under Windows.

Update ntfs_set_ntfs_dos_name() to permit operating on a file that has a
long name with a trailing dot or space.  But continue to forbid creating
such names on a filesystem FUSE-mounted with the windows_name option.
Additionally, continue to forbid a trailing a dot or space in DOS names;
this matches the Windows behavior.

(contributed by Eric Biggers)

7 years agoFixed setting opening contexts for plugins
Jean-Pierre André [Sat, 11 Feb 2017 09:44:02 +0000 (10:44 +0100)]
Fixed setting opening contexts for plugins

The opening context was incorrectly passed to plugins by lowntfs-3g

(contributed by Eric Biggers)

7 years agoAccepted displaying bad security descriptors on conditions
Jean-Pierre André [Sat, 11 Feb 2017 09:37:47 +0000 (10:37 +0100)]
Accepted displaying bad security descriptors on conditions

Display security descriptors in ntfssecaudit when they appear as
correctly formed, even when they contain unsupported items.

7 years agoFixed memory leak when failing to lookup an index
Jean-Pierre André [Sat, 11 Feb 2017 09:29:39 +0000 (10:29 +0100)]
Fixed memory leak when failing to lookup an index

When an index could not be used, the search context was not freed

7 years agoGot ready for Posix ACL support in fuse kernel
Jean-Pierre André [Sat, 11 Feb 2017 09:21:07 +0000 (10:21 +0100)]
Got ready for Posix ACL support in fuse kernel

Following a recent patch to the fuse kernel, the Posix ACL checks can
be done within the kernel instead of having to be done in the file
system, provided lowntfs-3g is used.

This mode is still not used by default until the fuse patch is
released by distributions.

7 years agoRemoved unused argument from ntfs_make_symlink()
Jean-Pierre André [Sat, 11 Feb 2017 09:11:01 +0000 (10:11 +0100)]
Removed unused argument from ntfs_make_symlink()

Now that the size of the reparse point attribute is no longer used by
the FUSE drivers to populate st_size for symlinks and junctions, it no
longer needs to be returned by ntfs_make_symlink().

(contributed by Eric Biggers)

7 years agoReturned the size of locale encoded target as the size of symlinks
Jean-Pierre André [Sat, 11 Feb 2017 09:04:15 +0000 (10:04 +0100)]
Returned the size of locale encoded target as the size of symlinks

Made ntfs-3f conform to the standard POSIX convention of setting st_size
to the length of the symlink target without a terminating null.

(contributed by Eric Biggers)

7 years agoValidated minimum size of mountpoint/symlink reparse points
Jean-Pierre André [Sat, 11 Feb 2017 09:00:34 +0000 (10:00 +0100)]
Validated minimum size of mountpoint/symlink reparse points

valid_reparse_data() would read past the end of the reparse point buffer
if it was passed a malformed reparse point that had the tag for a
mountpoint or a symlink but had a data buffer smaller than expected.
Fix this by validating the buffer size.

(contributed by Eric Biggers)

7 years agoEliminated unnecessary strlen() in ntfs_get_ntfs_dos_name()
Jean-Pierre André [Sat, 11 Feb 2017 08:58:30 +0000 (09:58 +0100)]
Eliminated unnecessary strlen() in ntfs_get_ntfs_dos_name()

Since ntfs_ucstombs() returns the output string length, there is no need
to call strlen().

(contributed by Eric Biggers)

7 years agoFixed a possible buffer overrun in ntfs_utf16_to_utf8()
Jean-Pierre André [Sat, 11 Feb 2017 08:51:17 +0000 (09:51 +0100)]
Fixed a possible buffer overrun in ntfs_utf16_to_utf8()

If an output buffer was provided, ntfs_utf16_to_utf8() limited the
output string length without the terminating null to 'outs_len'.  This
was incorrect because a terminating null was always added to the string,
causing a buffer overrun if the output string happened to have exactly
the maximum length.  This was a longstanding bug.  Fix it by leaving
space for a terminating null.

(contributed by Eric Biggers)

7 years agoMade utf16_to_utf8_size() always honor @outs_len
Jean-Pierre André [Sat, 11 Feb 2017 08:49:03 +0000 (09:49 +0100)]
Made utf16_to_utf8_size() always honor @outs_len

utf16_to_utf8_size() was not guaranteed to fail with ENAMETOOLONG if the
computed length was greater than @outs_len.  This could cause a buffer
overrun in ntfs_utf16_to_utf8().

(contributed by Eric Biggers)

7 years agoPreventing --enable-plugins from disabling the plugins
Jean-Pierre André [Sat, 11 Feb 2017 08:36:30 +0000 (09:36 +0100)]
Preventing --enable-plugins from disabling the plugins

The plugins are enabled by default, and the can be disabled by the
configure option --disable-plugins, but the option --enable-plugins
also led to disabling them.

7 years agoFixed DISABLE_PLUGINS as the condition for not using plugins
Jean-Pierre André [Sat, 11 Feb 2017 08:33:27 +0000 (09:33 +0100)]
Fixed DISABLE_PLUGINS as the condition for not using plugins

The condition for using plugins did not match the definition by
./configure

7 years agoFixed nesting when not using plugins
Jean-Pierre André [Sat, 11 Feb 2017 08:26:58 +0000 (09:26 +0100)]
Fixed nesting when not using plugins

The logical nesting (defined by {...}) did not match the physical nesting
(defined by #ifdef...#endif)

7 years agoFixed updating the backup boot sector in ntfslabel
Jean-Pierre André [Sat, 11 Feb 2017 08:22:50 +0000 (09:22 +0100)]
Fixed updating the backup boot sector in ntfslabel

The location of the backup boot sector was one-off