Commit Graph

5145 Commits (8d7c7a6e9bcdfb6d1774bafae6f9e85b606c74f5)
 

Author SHA1 Message Date
Jean-Pierre André 3f3b771cb0 Added consistency checks of index root
The index root must lie within the space allocated for it.
2021-05-17 15:33:04 +03:00
Jean-Pierre André 00a5478625 Added check of layout of attributes
Make sure the attributes fully lie within the MFT record, and make sure
their variable components (name, runlist, value) fully lie within the
attribute.
2021-05-17 15:31:52 +03:00
Jean-Pierre André 1258474e07 Improved check of upcase table length
The consistency check on the upcase size was laxist.
The unicode points are limited to 1048575 (20 bits), but there is no
provision to support code points beyond 65535.
In the current implementation the upcase size must be even and <= 131072.
2021-05-17 15:30:17 +03:00
Erik Larsson a4a837025b Add the official git repository location to the README file. 2021-03-05 14:56:40 +02:00
Erik Larsson 442e12fc32 Update outdated copyright notice. 2021-03-05 14:56:38 +02:00
Erik Larsson e464ca7574 Update last two entries in README to match style of previous entries. 2021-03-05 14:56:36 +02:00
Erik Larsson 83b66b3f39 Change http links in README to https for security. 2021-03-05 14:56:34 +02:00
Erik Larsson 3a53515016 Update README to mention support for Windows 8 and 10 NTFS formats. 2021-03-05 14:56:32 +02:00
Erik Larsson 477a4dfe5e ntfscp.c: Fix improper unsigned const endianness macro for signed type. 2021-03-05 14:56:31 +02:00
Jean-Pierre André 2ede3b67ee Improved checking of the location of MFT
Terminate cleanly when the MFT is improperly located, by making sure it
is located within the volume and that it contains its own data.
2021-03-05 10:21:36 +01:00
Jean-Pierre André e5ee8b325c Signalled support of UTIME_OMIT to external libfuse2
The external libfuse2 optionally uses UTIME_OMIT to tell whether mtime
or ctime should not be changed in a utimensat(2) call. Set the flag
flag_utime_omit_ok so that it knows that ntfs-3g supports this feature.
Note : this is the default with internal libfuse and with libfuse3.
2021-03-05 10:05:24 +01:00
Erik Larsson dd75ea7420 configure.ac: Fix obsolete 2-argument AM_INIT_AUTOMAKE invocation.
The 2-argument form has been replaced with fetching the package/version
information from autoconf (AC_INIT). Instead the 1-argument form takes a
list of automake options but we currently do not need to specify any.
2021-03-03 16:39:45 +02:00
Erik Larsson bcd42e5ef3 configure.ac: Respect 'with_fuse' user setting on non-Linux/Solaris.
Previously the configure script simply disregarded the value of the
'with_fuse' flag on non-Linux/Solaris systems. This is not unreasonable
since the 'internal' option doesn't work on those systems, however in
some situations we want to specify the libfuse CFLAGS/LDFLAGS manually
and bypass the pkg-config check with '--with-fuse=none' and this was not
possible with this logic. So add a special test to bypass the automatic
determination when the user has specified a 'with_fuse' value.
2021-02-26 08:09:18 +02:00
Erik Larsson da1b61ec22 lowntfs-3g.c: Fix compile error when building with libfuse < 2.8.0.
The libfuse function 'fuse_lowlevel_notify_inval_inode' is only
available starting with libfuse 2.8.0 while we advertise compatibility
with FUSE 2.6.0 as the baseline. So add a preprocessor check to exclude
this code from libfuse < 2.8.0.
2021-02-25 17:13:24 +02:00
Jean-Pierre André 56b8e713d5 Fixed a constant string concatenation
Adjust for recent compilers requiring a space between concatenated strings.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 094f9b3f2d Fixed a minor endianness ajustment bug
The endianness ajustment was the wrong one though it did the correct thing.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 894b7dd36e Checked the locations of MFT and MFTMirr at startup
On startup make sure the lcns of the MFT and the MFTMirr are not null and
they are different, so that the mounting is denied gracefully if they are.
2021-01-26 10:06:18 +01:00
Jean-Pierre André 5d46b32b91 Enabled Recording the special files the same way as WSL
Optionally record the special files (symlinks, fifos, sockets, character
and block devices) using reparse points instead of using Interix representation.
Doing so, the special files are interoperable with Windows Subsystem for
linux (WSL).
2021-01-26 10:06:18 +01:00
Jean-Pierre André 172da09947 Dropped rejecting having both EA and reparse data
Windows traditionally rejected having both EA and reparse data assigned
to a file, but Windows 10 has dropped the constraint and it uses this
condition massively, so do the same. Note that pre-Windows 10 chkdsk.exe
removes the EA' on reparse points, potentially damaging more recent
volumes.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 8073ab6764 Supported use of WSL special file
The Windows Subsystem for Linux (WSL) of Windows 10 uses reparse points
to record special files (symlinks, fifos, sockets, char or block devices).
Honor such reparse points with the same meaning as WSL.
2021-01-26 10:06:17 +01:00
Jean-Pierre André a67746c8a8 Relocated the mount point field in volume
The location of the mount point field in the volume attributes was
dependent on compiling options, thus creating an uneasy dependency
for plugins. So relocate the field to be independent on options.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 8fa3dd3f22 Defined ntfs_realloc() and ntfs_free()
Currently memory allocations are done through ntfs_malloc() and
ntfs_calloc(), but releases are done through free(3). Defining an
ntfs_free() relay facilitates the debugging of memory leaks in
plugins.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 76fe04d03d 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.
2021-01-26 10:06:17 +01:00
Jean-Pierre André c3c5c77be3 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)
2021-01-26 10:06:17 +01:00
Jean-Pierre André b086c9ef73 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.
2021-01-26 10:06:17 +01:00
Jean-Pierre André 02673bd04a 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).
2021-01-26 10:06:17 +01:00
Jean-Pierre André 4b8a660006 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.
2020-11-18 11:33:49 +01:00
Jean-Pierre André 7bcae8743f Allowed customization of sbin for tool directory
Enabled the configure option --sbindir to define where a few ntfsprogs
tools should be installed
2020-11-18 11:29:05 +01:00
Erik Larsson 903db231ec 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.
2020-08-25 11:29:42 +03:00
Erik Larsson 1511a5ca51 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).
2020-08-25 11:26:29 +03:00
Erik Larsson 4ecc13c0ac 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.
2020-08-24 16:50:18 +03:00
Jean-Pierre André 39579a045d Fixed possible null dereferencings
A null directory pointer could appear as being dereferenced. Fix that,
though it probably never occurs in real conditions.
2020-08-14 12:03:09 +02:00
Jean-Pierre André cd68a084fc 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.
2020-08-14 11:57:02 +02:00
Jean-Pierre André d6558f1dea 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.
2020-08-14 11:50:35 +02:00
Jean-Pierre André 1bc996f52f 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.
2020-08-14 11:36:57 +02:00
Jean-Pierre André 6bdd1e85ac 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.
2020-08-14 11:32:50 +02:00
Jean-Pierre André 5d6fd5c2d2 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.
2020-08-14 11:27:24 +02:00
Jean-Pierre André 4163390f2b Fixed defining the request argument of ioctl()
An occurrence of changing the request from int to unsigned long was
missing.
2020-03-08 10:34:17 +01:00
Jean-Pierre André 3f65ccd949 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.
2020-03-08 10:17:21 +01:00
Jean-Pierre André 7cd46f95df 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.
2020-03-08 10:03:23 +01:00
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é b68c27ea74 Silenced warnings about string lengths in snprintf()
Adjust string lengths to the worst case estimated by the compiler, even
though they cannot be reached.
2020-03-08 09:29:04 +01:00
Jean-Pierre André c5530af508 Silenced warnings about fallthrough situations in libntfs-3g
Insert a comment when fallthrough situations are desired in switch cases.
2020-03-07 12:00:11 +01:00
Jean-Pierre André ef61c82529 Avoided using a truncate strncpy() in the fuse library
Replace strncpy() by memcpy() when the exact size if known, thus
silencing the compiler warnings.
2020-03-07 11:56:46 +01:00
Jean-Pierre André 688578c1a6 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.
2020-03-07 11:50:26 +01:00
Jean-Pierre André 39384c8a1b 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.
2020-03-07 11:43:49 +01:00