OSDN Git Service
Chih-Wei Huang [Wed, 3 Apr 2019 17:47:38 +0000 (01:47 +0800)]
Android: move libfuse-lite to Android.bp
The library is also used by exfat.
Chih-Wei Huang [Fri, 22 Mar 2019 11:38:30 +0000 (19:38 +0800)]
Change ioctl() cmd argument to be unsigned int
On Linux, the ioctl() function is defined in <sys/ioctl.h> with a request
argument defined as an unsigned long. However the libfuse library defines
it as a signed int. This is inconsistent.
The values defined for the ioctl() command are meant to be unsigned. For
instance FITRIM is defined as 0xc0185879 in <linux/fs.h>, which does not
fit into a signed int.
As a consequence the clang compiler complains:
external/ntfs-3g/libntfs-3g/ioctl.c:398:7: error: overflow converting case value to switch condition type (
3222820985 to
18446744072637405305) [-Werror,-Wswitch]
case FITRIM:
^
bionic/libc/kernel/uapi/linux/fs.h:169:16: note: expanded from macro 'FITRIM'
#define FITRIM _IOWR('X', 121, struct fstrim_range)
^
bionic/libc/kernel/uapi/asm-generic/ioctl.h:51:29: note: expanded from macro '_IOWR'
#define _IOWR(type,nr,size) _IOC(_IOC_READ | _IOC_WRITE, (type), (nr), (_IOC_TYPECHECK(size)))
^
bionic/libc/kernel/uapi/asm-generic/ioctl.h:46:32: note: expanded from macro '_IOC'
#define _IOC(dir,type,nr,size) (((dir) << _IOC_DIRSHIFT) | ((type) << _IOC_TYPESHIFT) | ((nr) << _IOC_NRSHIFT) | ((size) << _IOC_SIZESHIFT))
^
1 error generated.
Th problem has been reported to https://github.com/libfuse/libfuse/issues/367
According to the discussion, we should change unsigned int. If change it to
unsigned long, an int would be sign extended to a wrong value.
Chih-Wei Huang [Thu, 21 Feb 2019 16:33:58 +0000 (00:33 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into oreo-x86
Chih-Wei Huang [Thu, 21 Feb 2019 16:32:53 +0000 (00:32 +0800)]
android: define HAVE_STRUCT_STAT_ST_ATIM
In bionic `st_atim' is a member of `struct stat'.
Chih-Wei Huang [Thu, 21 Feb 2019 16:31:51 +0000 (00:31 +0800)]
android: fix warnings
Chih-Wei Huang [Thu, 21 Feb 2019 14:39:07 +0000 (22:39 +0800)]
android: define _FILE_OFFSET_BITS=64
This works in the current bionic.
Remove unused _LARGEFILE_SOURCE.
Chih-Wei Huang [Thu, 21 Feb 2019 14:34:10 +0000 (22:34 +0800)]
android: remove unnecessary macros
These have been defined in newer bionic.
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.
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.
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.
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.
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.
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]
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().
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.
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.
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.
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.
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
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.
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.
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.
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.
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.
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
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.
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".
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.
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.
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.
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.
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.
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.
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.
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.
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.
Chih-Wei Huang [Tue, 12 Dec 2017 09:20:00 +0000 (17:20 +0800)]
Fix building errors on Android 8.1
Define MAJOR_IN_SYSMACROS to provide prototypes of major and minor.
Chih-Wei Huang [Thu, 30 Nov 2017 06:23:56 +0000 (14:23 +0800)]
android: fix parsing issue of Android 8.0
Android 8.0 stupidly uses comma in vold's device node name, say
"/dev/block/vold/public:8,32". The libfuse-lite can't parse it
correctly since a comma is usually used as a separator between
options.
Modify the options parser to handle it specially.
Chih-Wei Huang [Wed, 29 Nov 2017 07:35:50 +0000 (15:35 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into oreo-x86
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.
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.
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).
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.
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.
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.
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.
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.
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
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.
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.
Chih-Wei Huang [Thu, 1 Jun 2017 03:18:38 +0000 (11:18 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into nougat-x86
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.
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.
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.
Chih-Wei Huang [Thu, 23 Mar 2017 13:16:19 +0000 (21:16 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into marshmallow-x86
Jean-Pierre André [Thu, 23 Mar 2017 09:39:59 +0000 (10:39 +0100)]
Version 2017.3.23
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.
Erik Larsson [Tue, 21 Mar 2017 11:06:04 +0000 (12:06 +0100)]
ntfsusermap.c: Fix warning about implicit conversion between enums.
Erik Larsson [Tue, 21 Mar 2017 10:58:30 +0000 (11:58 +0100)]
Fix bad native->little endian byteswap of little endian value.
Erik Larsson [Tue, 21 Mar 2017 10:55:41 +0000 (11:55 +0100)]
Use signed endian conversion macros for signed little-endian members.
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.
Jean-Pierre André [Wed, 15 Feb 2017 16:04:57 +0000 (17:04 +0100)]
Version 2017.2.15
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
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)
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)
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)
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.
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
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.
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)
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)
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)
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)
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)
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)
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.
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
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)
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
Jean-Pierre André [Sat, 11 Feb 2017 08:15:33 +0000 (09:15 +0100)]
Logged more information when a plugin could not be loaded
Put the explanation from dlerr() into the syslog when a plugin could
not be loaded.
Jean-Pierre André [Sat, 11 Feb 2017 08:11:51 +0000 (09:11 +0100)]
Decoded the reparse tag for deduplication in ntfsinfo
Take into account the reparse tag for deduplication and display its meaning
Jean-Pierre André [Sat, 11 Feb 2017 08:08:22 +0000 (09:08 +0100)]
Included <paths.h> where useful in fuse-lite
Both fusermount.c and mount_util.c use _PATH_MOUNTED, so they should
include <paths.h>, which provides this definition.
This is required for building with the musl C library.
Contributed by Thomas Petazzoni
Jean-Pierre André [Sat, 11 Feb 2017 08:00:49 +0000 (09:00 +0100)]
Denied creating/removing files or directories from $Extend
$Extend is a directory reserved for metadata specific to Windows.
Inserting other files or directories there leads to problems with
some Windows versions.
Jean-Pierre André [Sat, 11 Feb 2017 07:57:37 +0000 (08:57 +0100)]
Replaced secaudit by ntfssecaudit in its own usage output
The usage output did not match the command name change
Jean-Pierre André [Sat, 11 Feb 2017 07:53:20 +0000 (08:53 +0100)]
Fixed bad indentations (cosmetic)
Jean-Pierre André [Fri, 2 Sep 2016 06:30:07 +0000 (08:30 +0200)]
Improved opening/closing $Secure when un/mounting NTFS volume
Call ntfs_close_secure() earlier, check for error, and other cleanups
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Thu, 28 Jul 2016 14:30:05 +0000 (16:30 +0200)]
Corrected code with misleading indentation
GCC 6 reports a warning in ntfs_allowed_dir_access() because the code has
misleading indentation. Fix by adding braces. There is no actual change
in behavior because of the '(allowed == 2)' condition.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Thu, 28 Jul 2016 14:26:21 +0000 (16:26 +0200)]
Corrected validation of multi sector transfer protected records
The validation contained an off-by-one error. The
expression '(u32)(usa_ofs + (usa_count * 2)) > size' used 'usa_count'
after it had been decremented to skip the update sequence number entry.
Consequently, the code could read out of bounds, up to two bytes past the
end of the MST-protected record.
Furthermore, as documented in the comment in layout.h for "NTFS_RECORD"
and also on MSDN for "MULTI_SECTOR_HEADER", the update sequence array
must end before the last le16 in the first logical sector --- not merely
before the end of the record.
Fix the validation and move it into a helper function, as it was done
identically in the read and write paths.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Thu, 28 Jul 2016 14:22:16 +0000 (16:22 +0200)]
Always opened $Secure when mounting NTFS volume
Currently, applications that wish to access security descriptors have to
explicitly open the volume's security descriptor index ("$Secure") using
ntfs_open_secure(). Applications are also responsible for closing the
index when done with it. However, the cleanup function for doing,
ntfs_close_secure(), cannot be called easily by all applications because
it requires a SECURITY_CONTEXT argument, not simply the ntfs_volume.
Some applications therefore have to close the inode and index contexts
manually in order to clean up properly.
This proposal updates libntfs-3g to open $Secure unconditonally as part
of ntfs_mount(), so that applications do not have to worry about it.
This proposal updates libntfs-3g to open $Secure unconditonally as part
of ntfs_mount(), so that applications do not have to worry about it.
ntfs_close_secure() is updated to take in a ntfs_volume for internal use,
and ntfs_destroy_security_context() is now the function to call to free
memory associated with a SECURITY_CONTEXT rather than a ntfs_volume.
Some memory leaks in error paths of ntfs_open_secure() are also fixed.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Thu, 28 Jul 2016 14:19:29 +0000 (16:19 +0200)]
Fixed tautological comparison
Wrong comparison in ntfscmp.c
Jean-Pierre André [Thu, 28 Jul 2016 14:16:42 +0000 (16:16 +0200)]
Removed unused variables
A few variables in xattrs.c are not used any more
Jean-Pierre André [Thu, 28 Jul 2016 14:13:59 +0000 (16:13 +0200)]
Allowed using full library API on systems without extended attributes support
A number of functions in libntfs-3g are generally useful, but are tied to
extended attributes support and are not included when the library is
built on platforms without extended attributes support.
This proposal updates libntfs-3g to always include these functions.
The only tricky part is dealing with the XATTR_CREATE and XATTR_REPLACE
flags. These flags are defined in <sys/xattr.h>, so they must be
redefined on platforms without extended attributes support.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Thu, 28 Jul 2016 14:10:14 +0000 (16:10 +0200)]
Cleaned up file name collation code
- Update documentation for COLLATION_RULES
- Document how ntfs_names_full_collate() compares names
- Update comments and DEBUG code to reflect that ntfs_names_full_collate()
always access 'upcase', even in CASE_SENSITIVE mode
- Remove unneeded assignments to 'c1' and 'c2' in IGNORE_CASE mode
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Tue, 19 Jul 2016 09:53:28 +0000 (11:53 +0200)]
Allowed dlopen API to be either in libc or libdl
On Linux, the functions in the dlopen API are in libdl. However, on
FreeBSD, libdl doesn't exist and the functions are instead in libc.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Tue, 19 Jul 2016 09:50:32 +0000 (11:50 +0200)]
Made plugin.h include all prerequisite declarations
Only <plugin.h> to be included in plugins code.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Tue, 19 Jul 2016 09:49:04 +0000 (11:49 +0200)]
Renamed include guard for plugin.h to _NTFS_PLUGIN_H
Be consistent with other NTFS-3G headers and use the "_NTFS_" prefix.
Signed-off-by: Eric Biggers <ebiggers3@gmail.com>
Jean-Pierre André [Tue, 19 Jul 2016 09:44:59 +0000 (11:44 +0200)]
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.
Jean-Pierre André [Tue, 19 Jul 2016 09:40:20 +0000 (11:40 +0200)]
Tolerated garbage put by Windows 10 into the last ACE
For some reason, Windows 10 sometimes inserts garbage after the
last ACE of an ACL. The ACL consistency check has to tolerate this.
Chih-Wei Huang [Wed, 6 Jul 2016 17:33:21 +0000 (01:33 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into marshmallow-x86
Chih-Wei Huang [Wed, 6 Jul 2016 17:31:42 +0000 (01:31 +0800)]
Android.mk: create symbolic links required by vold