OSDN Git Service

android-x86/external-ntfs-3g.git
8 years agontfsdump_logfile.c: Fix incorrectly parenthesized expression.
Erik Larsson [Wed, 27 Jan 2016 14:24:52 +0000 (15:24 +0100)]
ntfsdump_logfile.c: Fix incorrectly parenthesized expression.

On big-endian systems the result of the '!=' operation would be
endian-swapped rather than the first argument (which must have been the
intended action).

8 years agontfsck.c: Fix comparing le32 values as u32.
Erik Larsson [Wed, 27 Jan 2016 14:23:13 +0000 (15:23 +0100)]
ntfsck.c: Fix comparing le32 values as u32.

This is harmless except when we do strict endianness checking, in which
case this results in a compile error. Fixed by converting values to
CPU endianness before comparing them.

8 years agontfsck.c: Fix comparison between little-endian and native-endian data.
Erik Larsson [Wed, 27 Jan 2016 14:21:05 +0000 (15:21 +0100)]
ntfsck.c: Fix comparison between little-endian and native-endian data.

This comparison would yield the wrong result on big-endian systems.

8 years agontfstruncate.c: Fix mixed endianness usage of variable 'i'.
Erik Larsson [Tue, 26 Jan 2016 09:28:38 +0000 (10:28 +0100)]
ntfstruncate.c: Fix mixed endianness usage of variable 'i'.

In 'dump_resident_attr_val', 'i' was sometimes used as a native-endian
'int'-precision string length value and sometimes used as a little-
endian 16-bit flags value. This type of mixed usage is bad practice and
results in a hard error when strict endianness checking is used.

Fixed by introducing new variable 'flags' to hold the little-endian 16-
bit flags value.

8 years agontfstruncate.c: Fix incorrect type for CPU-endian value in 'ucstos'.
Erik Larsson [Tue, 26 Jan 2016 09:19:44 +0000 (10:19 +0100)]
ntfstruncate.c: Fix incorrect type for CPU-endian value in 'ucstos'.

8 years agontfstruncate.c: Fix conflicting endianness for variable 'attr_type'.
Erik Larsson [Tue, 26 Jan 2016 09:18:51 +0000 (10:18 +0100)]
ntfstruncate.c: Fix conflicting endianness for variable 'attr_type'.

If the attribute type is specified by the user, 'attr_type' was assigned
a CPU-endian value, however if the attribute type was not specified it
would be assigned the attribute type AT_DATA, which is a little-endian
value. The rest of the code seems to assume that 'attr_type' is
CPU-endian, so this is clearly a bug.

Resolved by fixing the endianness of the variable at little-endian,
converting the input value to little-endian when specified.

8 years agontfstruncate.c: Fix mixed endianness usage of variable 'u'.
Erik Larsson [Tue, 26 Jan 2016 09:03:36 +0000 (10:03 +0100)]
ntfstruncate.c: Fix mixed endianness usage of variable 'u'.

In 'dump_attr_record' the variable 'u' was first used to store a
CPU-endian 32-bit value, and then to store a 16-bit little-endian value.
This is bad practice and results in a hard error when strict endian type
checking is used.

Fixed by storing the 16-bit little-endian flags value in a new variable
'flags'.

8 years agontfs-3g.c: Fix raw usage of inode time fields without byteswapping.
Erik Larsson [Tue, 26 Jan 2016 06:55:45 +0000 (07:55 +0100)]
ntfs-3g.c: Fix raw usage of inode time fields without byteswapping.

8 years agovolume.c: Fix passing bad pointer type to ntfs_is_[baad|mft]_recordp.
Erik Larsson [Mon, 25 Jan 2016 10:31:12 +0000 (11:31 +0100)]
volume.c: Fix passing bad pointer type to ntfs_is_[baad|mft]_recordp.

8 years agomst.c: Fix mixed native/little-endian usage of variable 'usn'.
Erik Larsson [Mon, 25 Jan 2016 10:30:13 +0000 (11:30 +0100)]
mst.c: Fix mixed native/little-endian usage of variable 'usn'.

8 years agoreparse.c: Fix big-endian bug when converting file name to lowercase.
Erik Larsson [Mon, 4 Jan 2016 09:19:05 +0000 (10:19 +0100)]
reparse.c: Fix big-endian bug when converting file name to lowercase.

When looking up the lowercase equivalent of a Unicode character in
ntfs_fix_file_name, no byte swapping was performed on the ntfschar used
as index into the 'locase' array. This would lead to very strange
results on big-endian systems.

8 years agoFix inverted usage of endian conversion macros.
Erik Larsson [Mon, 4 Jan 2016 09:08:15 +0000 (10:08 +0100)]
Fix inverted usage of endian conversion macros.

This is mostly a semantic issue since the end result would be the same.

8 years agoFix incorrect usage of native/little-endian types, signed types, etc.
Erik Larsson [Mon, 21 Dec 2015 22:55:31 +0000 (23:55 +0100)]
Fix incorrect usage of native/little-endian types, signed types, etc.

This is harmless with regard to code generation but if we turn on strict
type checking these type mismatches will result in errors.

8 years agoFix endianness issues in log and terminal output.
Erik Larsson [Mon, 21 Dec 2015 22:31:09 +0000 (23:31 +0100)]
Fix endianness issues in log and terminal output.

This commit addresses issues where little-endian variables are emitted
raw to a log or output stream which is to be interpreted by the user.

Outputting data in non-native endianness can cause confusion for anybody
attempting to debug issues with a file system.

8 years agoFix code to use const_cpu_to_X/const_X_to_cpu macros for constants.
Erik Larsson [Mon, 21 Dec 2015 22:21:00 +0000 (23:21 +0100)]
Fix code to use const_cpu_to_X/const_X_to_cpu macros for constants.

This enables the compiler to optimize this code in cases where compiler
support for endianness swapping is not present.

8 years agoendians.h: Add const endian conversion macros for s{l,b}e{16,32,64}.
Erik Larsson [Mon, 21 Dec 2015 22:05:36 +0000 (23:05 +0100)]
endians.h: Add const endian conversion macros for s{l,b}e{16,32,64}.

8 years agoUse appropriate little-endian/big-endian types in struct definitions.
Erik Larsson [Sat, 3 Oct 2015 10:58:08 +0000 (12:58 +0200)]
Use appropriate little-endian/big-endian types in struct definitions.

On-disk struct definitions used native types (u16/u32/u64/s16/s32/s64),
which doesn't say anything about the intended interpretation of the
data. The intention of having little-endian-specific types and
big-endian-specific types must have been to clarify interpretation of
data and intentions in the code. Therefore it seems reasonable to use
these types in struct definitions to clarify what data represention is
used to encode field data.

Because some struct members in layout.h are big-endian, this change also
means moving the duplicated definitions for big-endian byteswapping
macros and big-endian types found in acls.h and security.h to the
appropriate locations in endians.h and types.h respectively in order to
make them available for the struct definitions in layout.h.

9 years agoVersion 2015.3.14.
Erik Larsson [Sat, 14 Mar 2015 11:49:43 +0000 (12:49 +0100)]
Version 2015.3.14.

9 years agoEnable ioctl in ntfs-3g unconditionally when building with fuse-lite.
Erik Larsson [Sat, 14 Mar 2015 10:11:43 +0000 (11:11 +0100)]
Enable ioctl in ntfs-3g unconditionally when building with fuse-lite.

fuse-lite announces a FUSE_VERSION which may not always match the exact
capabilities of the library. Hence we add a special case for 'ioctl',
which we know exists in fuse-lite regardless of the version number
published.

9 years agoFix improper #ifdef conditions around FUSE_CAP_IOCTL_DIR.
Erik Larsson [Sat, 14 Mar 2015 05:53:31 +0000 (06:53 +0100)]
Fix improper #ifdef conditions around FUSE_CAP_IOCTL_DIR.

The capability actually appeared in FUSE 2.9, not 2.8. However in order
to maintain similarity to earlier #ifdef:s, we simpy check if
FUSE_CAP_IOCTL_DIR is defined rather than checking the FUSE version.

9 years agoVersion 2015.3.13.
Erik Larsson [Fri, 13 Mar 2015 14:04:43 +0000 (15:04 +0100)]
Version 2015.3.13.

9 years agousermap.c: Fix uninitialized variable warning in main.
Erik Larsson [Fri, 13 Mar 2015 08:06:17 +0000 (09:06 +0100)]
usermap.c: Fix uninitialized variable warning in main.

If platform was non-Win32 and open_security_api() failed, the variable
'ok' would end up being uninitialized.

9 years agolowntfs-3g.c: Fix uninitialized variable warning in ntfs_fuse_getxattr.
Erik Larsson [Fri, 13 Mar 2015 08:02:38 +0000 (09:02 +0100)]
lowntfs-3g.c: Fix uninitialized variable warning in ntfs_fuse_getxattr.

The variable 'res' was never initialized if the #ifdef condition
'!KERNELPERMS | (POSIXACLS & !KERNELACLS)' evaluated to true and there
was an error allocating memory for 'value'.

9 years agontfsclone.c: Compile fix for OS X.
Erik Larsson [Fri, 13 Mar 2015 07:59:20 +0000 (08:59 +0100)]
ntfsclone.c: Compile fix for OS X.

OS X keeps the statfs declarations in sys/mount.h.

9 years agoCompile fix for FUSE versions earlier than 2.8.0.
Erik Larsson [Fri, 13 Mar 2015 07:57:38 +0000 (08:57 +0100)]
Compile fix for FUSE versions earlier than 2.8.0.

9 years agoSet release version 2015.3.5
Jean-Pierre André [Thu, 5 Mar 2015 17:47:06 +0000 (18:47 +0100)]
Set release version 2015.3.5

9 years agoUpdated the copyright on the drivers to 2015
Jean-Pierre André [Thu, 5 Mar 2015 17:25:17 +0000 (18:25 +0100)]
Updated the copyright on the drivers to 2015

9 years agoMade to ignore the -s ("sloppy") mount option
Jean-Pierre André [Thu, 22 Jan 2015 07:42:43 +0000 (08:42 +0100)]
Made to ignore the -s ("sloppy") mount option

autofs passes the sloppy option to mount(8) for all file systems to mean
that mount should not choke on invalid options such as those meant for
remote mounting on another operating system through nfs or cifs.
Following a recent change, mount(8) passes the -s option on to any file
system, even to local ones (which are not expected to get foreign options),
so ntfs-3g now has to ignore -s.

9 years agoSet the fuse protocol fall back to 7.12 when available
Jean-Pierre André [Mon, 10 Nov 2014 07:52:23 +0000 (08:52 +0100)]
Set the fuse protocol fall back to 7.12 when available

The support for ioctls has been added to fuse when using protocol 7.18,
and an equivalent upgrade has been done in fuse lite with commit [ae9aee].
For old kernels, a fall back to protocol 7.8 was implemented, but this
appears not to be supported in not-so-old kernels (e.g. 2.6.35).
With this patch, the fall back protocol is set to 7.12 or to the highest
level supported by the kernel.

9 years agoFixed accessing security attributes the old way on ntfs 3.x
Jean-Pierre André [Mon, 10 Nov 2014 07:43:32 +0000 (08:43 +0100)]
Fixed accessing security attributes the old way on ntfs 3.x

When the security attribute is present, chkdsk may set a null security id
in the standard attributes, and this should not be considered as an error.
(this partially reverts commit [70e5b1])

9 years agoFixed reading the MFT bitmap when expanding downward
Jean-Pierre André [Mon, 20 Oct 2014 06:58:04 +0000 (08:58 +0200)]
Fixed reading the MFT bitmap when expanding downward

When expanding downward the MFT bitmap was wrongly read when fragmented,
leading to inconsistencies and cancellation of the process.

9 years agoSilenced a const qualifier dropping (cosmetic)
Jean-Pierre André [Tue, 2 Sep 2014 08:03:23 +0000 (10:03 +0200)]
Silenced a const qualifier dropping (cosmetic)

9 years agoDevelopped an option --unused-fast for faster ntfswipe
Jean-Pierre André [Tue, 2 Sep 2014 07:55:53 +0000 (09:55 +0200)]
Developped an option --unused-fast for faster ntfswipe

When the new option --unused-fast is used, clusters which appear as wiped
are not written again. This is useful for avoiding virtual partitions to
be extended to their full size.

Contributed by michael

9 years agoDisabled option remove_hiberfile on read-only mounts
Jean-Pierre André [Tue, 2 Sep 2014 07:50:27 +0000 (09:50 +0200)]
Disabled option remove_hiberfile on read-only mounts

The mount options remove_hiberfile and read-only are contradictory.
When both are mentioned, ignore remove_hiberfile.

9 years agoReengineered the compression algorithm
Jean-Pierre André [Tue, 2 Sep 2014 07:45:16 +0000 (09:45 +0200)]
Reengineered the compression algorithm

This patch changes the algorithm to use hash chains instead of binary
trees, with much stronger hashing.  It also introduces useful (for
performance) parameters, such as the "nice match length" and "maximum
search depth", that are similar to those used in other commonly used
compression algorithms such as zlib's DEFLATE implementation.

The speed improvement is very significant, with some loss of compression
rate. The compression rate is still better than then Windows one.

Contributed by Eric Biggers

9 years agoInserted missing ea.h and ioctl.h in devel file list
Jean-Pierre André [Tue, 2 Sep 2014 07:39:12 +0000 (09:39 +0200)]
Inserted missing ea.h and ioctl.h in devel file list

ea.h and ioctl.h were not mentioned in include/ntfs-3g/Makefile.am
so they were not released as public headers in devel files.

9 years agoFixed fstrim(8) applied to partitions
Jean-Pierre André [Mon, 4 Aug 2014 15:39:50 +0000 (17:39 +0200)]
Fixed fstrim(8) applied to partitions

The new way goes via /sys/dev/block/MAJOR:MINOR to map partitions to
devices and get discard parameters of the parent device. It also ensures
that the partition is aligned to the discard block size.

Contributed by Richard W.M. Jones

9 years agoImplemented fstrim(8)
Jean-Pierre André [Thu, 31 Jul 2014 12:03:11 +0000 (14:03 +0200)]
Implemented fstrim(8)

fstrim(8) discards unused blocks on a mounted filesystem. It is useful for
solid-state drives (SSDs) and thinly-provisioned storage.
Only trimming the full device (with no option) is supported.

Contributed by Richard W.M. Jones

10 years agoUpgraded fuse-lite to support ioctls
Jean-Pierre André [Wed, 30 Jul 2014 14:44:18 +0000 (16:44 +0200)]
Upgraded fuse-lite to support ioctls

This is backporting code from the full FUSE library in order to support
ioctls. The fuse protocol level negociated is now 7.18 instead of 7.8.
A fallback protocol to 7.8 is provided for compatibility with older kernels.

32-bit ioctls are not supported by a 64-bit library

10 years agoEnabled new manual entries for ntfsprogs utilities
Jean-Pierre André [Wed, 25 Jun 2014 10:50:45 +0000 (12:50 +0200)]
Enabled new manual entries for ntfsprogs utilities

There were no manual entries so far for ntfswipe, ntfsdecrypt, ntfstruncate
and ntfsfallocate.

10 years agoAdded a manual entry for ntfsfallocate
Jean-Pierre André [Wed, 25 Jun 2014 10:48:35 +0000 (12:48 +0200)]
Added a manual entry for ntfsfallocate

10 years agoAdded a manual entry for ntfstruncate
Jean-Pierre André [Wed, 25 Jun 2014 10:47:33 +0000 (12:47 +0200)]
Added a manual entry for ntfstruncate

10 years agoAdded a manual entry for ntfsdecrypt
Jean-Pierre André [Wed, 25 Jun 2014 10:46:36 +0000 (12:46 +0200)]
Added a manual entry for ntfsdecrypt

10 years agoAdded a manual entry for ntfswipe
Jean-Pierre André [Wed, 25 Jun 2014 10:45:15 +0000 (12:45 +0200)]
Added a manual entry for ntfswipe

10 years agoFixed inappropriate description of ntfs_build_basic_posix() (cosmetic)
Jean-Pierre André [Mon, 23 Jun 2014 09:46:58 +0000 (11:46 +0200)]
Fixed inappropriate description of ntfs_build_basic_posix() (cosmetic)

Fixed a missing description and wrongly copied+pasted comment

10 years agoFixed checking permissions when Posix ACLs are compiled in but not enabled
Jean-Pierre André [Mon, 23 Jun 2014 09:26:00 +0000 (11:26 +0200)]
Fixed checking permissions when Posix ACLs are compiled in but not enabled

When the Posix ACLs are not enabled in the mount options, the permission
checks should not take into account the extra owners and groups of the
file.

10 years agoFixed processing umask when Posix ACLs are compiled in but not enabled
Jean-Pierre André [Mon, 23 Jun 2014 09:20:21 +0000 (11:20 +0200)]
Fixed processing umask when Posix ACLs are compiled in but not enabled

When Posix ACLs are used, the umask is ignored and the initial permissions
of created files are taken for the parent directory. However the umask
should still be used when the Posix ACLs are not enabled in the mount
options.

10 years agoFixed a wrong function header in usermap
Jean-Pierre André [Mon, 23 Jun 2014 09:16:02 +0000 (11:16 +0200)]
Fixed a wrong function header in usermap

A wrong header was defined for ntfs_initialize_file_security()

10 years agoFixed ownership of files created by root with no user mapping
Jean-Pierre André [Mon, 23 Jun 2014 09:11:07 +0000 (11:11 +0200)]
Fixed ownership of files created by root with no user mapping

Ownership of files should always represent the creator of files.
This fixes a situation, currently disabled, where there is no user
mapping and the owner of the parent directory is used as the owner
of the created file.

10 years agoDisabled the default user mapping when Windows inheritance is used
Jean-Pierre André [Mon, 23 Jun 2014 08:59:38 +0000 (10:59 +0200)]
Disabled the default user mapping when Windows inheritance is used

Windows-type inheritance is meaningful only when used with user
identifications known to Windows, so avoid using default ones.

10 years agoFixed apparent const violation in secaudit.c for Windows (cosmetic)
Jean-Pierre André [Mon, 23 Jun 2014 08:53:23 +0000 (10:53 +0200)]
Fixed apparent const violation in secaudit.c for Windows (cosmetic)

The prototype for SetFileSecurityW() does not exhibit a const attribute
for the second attribute, thus triggering a compiler warning.
This warning can be silenced by copying the argument.

10 years agoFixed const violation in win32_io.c (cosmetic)
Jean-Pierre André [Mon, 23 Jun 2014 08:46:31 +0000 (10:46 +0200)]
Fixed const violation in win32_io.c (cosmetic)

Fixed the read-modify-write procedure to be compatible with the
write-only one to avoid violating the "const" attibute of the latter.

10 years agoShowed Windows ownership in secaudit with verbose option
Jean-Pierre André [Mon, 23 Jun 2014 08:41:39 +0000 (10:41 +0200)]
Showed Windows ownership in secaudit with verbose option

The Windows ownership can now be displayed without using the "very
verbose" option, and when used on Windows the login name is displayed.

10 years agoIncluded ntfsfallocate in the quarantined ntfsprogs
Jean-Pierre André [Mon, 23 Jun 2014 08:33:22 +0000 (10:33 +0200)]
Included ntfsfallocate in the quarantined ntfsprogs

ntfsfallocate is the equivalent of fallocate(1) :
Usage : ntfsfallocate [-n] [-p] [-o offset] -l length filename
For now, it is only released as a quarantined ntfsprogs because it can
produce configurations which cause subsequent updates of the file by
Windows to hang.

10 years agoDefined the configure option --enable-quarantined for non functional utilities
Jean-Pierre André [Mon, 23 Jun 2014 08:15:24 +0000 (10:15 +0200)]
Defined the configure option --enable-quarantined for non functional utilities

Distributions have complained about releasing a non-functional ntfsck.
Actually, ntfsck and a few other developer-oriented utilities were not
meant to be released by distributions and are only compiled in if the
configure option --enable-extra is set, and, for some reason, this
option is set by most distributions.

In order to get distributions to not complain, though making the source
code available for candidate developers to improve it, the non functional
or developer-oriented utilities (ntfsck, ntfsdump_logfile, ntfsmftalloc
and ntfsmove) are now only compiled in if the configure option
--enable-quarantined is set.

10 years agoFixed getting inherited security ids from cache
Jean-Pierre André [Thu, 22 May 2014 07:52:42 +0000 (09:52 +0200)]
Fixed getting inherited security ids from cache

When using Windows inheritance, the cacheing of ACLs for files created
within a directory only depended on the directory. Actually it also
depends on the user who creates the file. With the patch, only the ACLs
created by the owner of the directory are cached.

10 years agoFixed ignoring the umask mount option when permissions are used
Jean-Pierre André [Thu, 22 May 2014 07:45:46 +0000 (09:45 +0200)]
Fixed ignoring the umask mount option when permissions are used

When permissions are used, umask(2) is supposed to be active and the
umask mount option is supposed to be ignored, but it was still wrongly
applied. This caused permission restrictions when an external disk was
automatically mounted with standard options.

10 years agoFixed checking static groups against process owner
Jean-Pierre André [Thu, 22 May 2014 07:38:47 +0000 (09:38 +0200)]
Fixed checking static groups against process owner

When grouping of users are determined from /etc/group (a compile-time
option not currently used), the groups examined for checking access rights
to a file were wrongly derived from the uid of the file instead of the
uid of the current process.

10 years agoRecognized interactive users as any user
Jean-Pierre André [Thu, 22 May 2014 07:30:07 +0000 (09:30 +0200)]
Recognized interactive users as any user

Since Vista, the standard directory /Users/Public which should be accessed
by any user is actually restricted to a few group of users, among them
the interactive ones. To make this directory accessible without using
the Posix ACLs, all Linux users are considered as interactive.
However, when Posix ACLs are used, users supposed to be interactive have
to be put into a secondary group mapped to the equivalent Windows group.

10 years agoDecoded more "well-known" and generic SIDs in secaudit
Jean-Pierre André [Thu, 22 May 2014 07:25:11 +0000 (09:25 +0200)]
Decoded more "well-known" and generic SIDs in secaudit

More SIDs found in common situations are displayed with their meaning.

10 years agoImproved the ownership definition when inheriting and user mapping fails
Jean-Pierre André [Thu, 22 May 2014 07:19:52 +0000 (09:19 +0200)]
Improved the ownership definition when inheriting and user mapping fails

When using the Windows permission inheritance mode and the current user
has not been mapped, try to derive a reasonable user from the parent
directory.

10 years agoImproved the conditions for double inheritance of an ACE
Jean-Pierre André [Thu, 22 May 2014 07:07:43 +0000 (09:07 +0200)]
Improved the conditions for double inheritance of an ACE

The Windows-type inheritance of an ACE may imply creating two ACE's : one
for access and one for further inheritance. The conditions for doing so,
and the flags set on created ACE were sometimes wrong.
Note : the rules have been derived from testing multiple situations, but
there still are some gray cases.

10 years agoDecoded the GENERIC_ALL flag in secaudit
Jean-Pierre André [Thu, 22 May 2014 07:01:37 +0000 (09:01 +0200)]
Decoded the GENERIC_ALL flag in secaudit

The GENERIC_ALL flags was not decoded and could lead to displaying no
access to some directories.

10 years agoDisplayed the parent directory of selected files in usermap
Jean-Pierre André [Thu, 22 May 2014 06:58:03 +0000 (08:58 +0200)]
Displayed the parent directory of selected files in usermap

Displaying the parent directory facilitates the identification of files
selected by usermap as a base for defining the mapping of Windows users
to Linux ones.

10 years agoIgnored chmod/chown/setfacl when Windows inheritance is applied
Jean-Pierre André [Thu, 22 May 2014 06:46:08 +0000 (08:46 +0200)]
Ignored chmod/chown/setfacl when Windows inheritance is applied

chmod/chown/setfacl can only define permissions according to Linux rules
with references to owner and group. Windows rules are more general and
propagated through inheritance, and chmod/chown/setfacl may create unwanted
deviations from these rules. Ignoring them prevents text editors from
creating such deviations when updating a file and creating a backup one.

10 years agoAllowed group mapping of a few well-known SIDs
Jean-Pierre André [Thu, 22 May 2014 06:36:41 +0000 (08:36 +0200)]
Allowed group mapping of a few well-known SIDs

Since Vista, Windows defines a /Users/Public directory supposed to be
public, but actually only allowed to a few user categories (interactive,
batch, etc.) This patch makes possible to create equivalent Unix groups
and group users the same way as in Windows. Posix ACLs have to be enabled
for access to /Users/Public to be allowed to several groups.

10 years agoReturned success from ntfsprogs utilities with options --version and --help
Jean-Pierre André [Wed, 23 Apr 2014 08:13:27 +0000 (10:13 +0200)]
Returned success from ntfsprogs utilities with options --version and --help

The ntfsprogs used to return failure when option --version or --help
was used, and this has triggered complains from distribution packagers
who use these options in packaging scripts.
With this patch, success is returned (same behavior as gcc).

10 years agoFixed inserting a new ACL after they have been wiped out by chkdsk
Jean-Pierre André [Wed, 23 Apr 2014 07:53:13 +0000 (09:53 +0200)]
Fixed inserting a new ACL after they have been wiped out by chkdsk

chkdsk deletes the ACLs when they are bad or when they are not used any
more. This fixes inserting a new ACL after the previously last ACL (or
even all of them) was deleted.

10 years agoFixed $Bitmap size in the root index in ntfsresize
Jean-Pierre André [Wed, 23 Apr 2014 07:47:21 +0000 (09:47 +0200)]
Fixed $Bitmap size in the root index in ntfsresize

When the partition is resized, the global bitmap size is adjusted accordingly,
however so far the new size was not set into the parent index (only minor
consequences).

10 years agoFixed inclusion of <sys/param.h> for Solaris/OpenIndiana
Jean-Pierre André [Wed, 23 Apr 2014 07:43:43 +0000 (09:43 +0200)]
Fixed inclusion of <sys/param.h> for Solaris/OpenIndiana

The truncation of oversized file names on Solaris/OpenIndiana requires
the definition of the maximum size from <sys/param.h> instead of
<param.h>

10 years agoFix readdir I/O error on file names larger than 255 bytes in Solaris.
Erik Larsson [Fri, 18 Apr 2014 09:54:54 +0000 (11:54 +0200)]
Fix readdir I/O error on file names larger than 255 bytes in Solaris.

If a readdir operation returned a file name larger than 255 bytes,
Solaris/Illumos would return I/O error from the readdir operation.
Fixed by truncating the file name returned in the readdir operation.

10 years agoFix a possible memory leak
Chih-Wei Huang [Tue, 15 Apr 2014 08:23:07 +0000 (16:23 +0800)]
Fix a possible memory leak

In ntfs_fuse_parse_path(), it's possible that strdup() succeeds but
ntfs_mbstoucs() returns a negative value. In such a case the callers
just treat it as an error and ignores the allocated path buffer
that results in a memory leak.

10 years agoInitialize 'path' correctly
Chih-Wei Huang [Tue, 15 Apr 2014 08:23:07 +0000 (16:23 +0800)]
Initialize 'path' correctly

It fixes the warnings
src/ntfs-3g.c: In function 'ntfs_fuse_readlink':
src/ntfs-3g.c:987:6: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]
src/ntfs-3g.c: In function 'ntfs_fuse_create':
src/ntfs-3g.c:1765:6: warning: 'path' may be used uninitialized in this function [-Wmaybe-uninitialized]

10 years agoMapped the runlist when filling an initial hole
Jean-Pierre André [Sat, 12 Apr 2014 07:32:59 +0000 (09:32 +0200)]
Mapped the runlist when filling an initial hole

A bug was introduced by commit d2c7d40a2b494f9bf355c8bbe78c24fa16925f86 :
when the beginning of a file was a hole and the runlist span over several
MFT extents, the runlist was not mapped on filling the initial hole.
This lead to a crash when using torrent to download big files.

10 years agoAdded a license section to the README file
Jean-Pierre André [Sat, 12 Apr 2014 07:27:27 +0000 (09:27 +0200)]
Added a license section to the README file

Explained the licensing differences between fuse-lite and ntfs-3g proper.

10 years agoImplemented an extended attribute to get/set EAs
Jean-Pierre André [Sat, 12 Apr 2014 07:22:17 +0000 (09:22 +0200)]
Implemented an extended attribute to get/set EAs

The new extended attribute "system.ntfs_ea" can now be used to get or
set the set of EAs of a file or directory.

10 years agoFixed ioctl() error return for ntfsclone on Windows
Jean-Pierre André [Sat, 12 Apr 2014 07:14:08 +0000 (09:14 +0200)]
Fixed ioctl() error return for ntfsclone on Windows

The ioctl() function is not implemented in the Windows variant. By forcing
a negative apparent return, an alternative is triggered to get the
partition size which is normally obtained from an ioctl().

10 years agoSwitched to the relocated bitmap for delayed relocations in ntfsresize
Jean-Pierre André [Tue, 11 Mar 2014 10:15:59 +0000 (11:15 +0100)]
Switched to the relocated bitmap for delayed relocations in ntfsresize

In some rare situations relocated runlists are longer than the original
ones and do not fit into the same extent. When this happens the runlist
updating is delayed and done globally. Be sure to use the updated global
bitmap for making the needed allocations.

10 years agoImplemented updating an encrypted file in ntfsdecrypt
Jean-Pierre André [Tue, 11 Mar 2014 10:10:33 +0000 (11:10 +0100)]
Implemented updating an encrypted file in ntfsdecrypt

Existing encrypted files can be updated provided the encryption method
and key can be extracted from the LOGGED_UTILITY_STREAM attribute.

10 years agoAccepted encryption keys whose EFS purpose is not the first one
Jean-Pierre André [Tue, 11 Mar 2014 10:06:21 +0000 (11:06 +0100)]
Accepted encryption keys whose EFS purpose is not the first one

X509 certificates have a purpose field restricting what the certificate
can be used for, and EFS encryption is such a purpose. Allow EFS encryption
to be at any position in the list.

10 years agoFixed checking whether utimensat() applies to current atime
Jean-Pierre André [Tue, 11 Mar 2014 10:03:06 +0000 (11:03 +0100)]
Fixed checking whether utimensat() applies to current atime

The check was applied to mtime instead of atime

10 years agoRejected reserved files names when option windows_names is set
Jean-Pierre André [Tue, 11 Mar 2014 09:56:31 +0000 (10:56 +0100)]
Rejected reserved files names when option windows_names is set

Windows applies legacy restrictions to file names, so when the option
windows_names is applied, reject the same reserved names, which are
CON, PRN, AUX, NUL, COM1..COM9, and LPT1..LPT9

10 years agoAdded a summary of inodes found by ntfscluster
Jean-Pierre André [Tue, 11 Mar 2014 09:51:47 +0000 (10:51 +0100)]
Added a summary of inodes found by ntfscluster

Output the number of inodes found.

10 years agoImproved the warning for analyzing an extent in ntfscluster
Jean-Pierre André [Tue, 11 Mar 2014 09:47:48 +0000 (10:47 +0100)]
Improved the warning for analyzing an extent in ntfscluster

When analyzing an extent in ntfscluster, mention its base record

10 years agoFixed endianness bugs in ntfscluster
Jean-Pierre André [Tue, 11 Mar 2014 09:43:31 +0000 (10:43 +0100)]
Fixed endianness bugs in ntfscluster

ntfscluster was not suitable for big-endian CPUs

10 years agoFixed displaying the correct sector number in error message
Jean-Pierre André [Tue, 11 Mar 2014 09:37:27 +0000 (10:37 +0100)]
Fixed displaying the correct sector number in error message

When opening a volume, the availability of the last sector is checked,
but the error message mentioned a wrong sector.

10 years agoFixed marking device as closed (Windows variant)
Jean-Pierre André [Tue, 11 Mar 2014 09:32:39 +0000 (10:32 +0100)]
Fixed marking device as closed (Windows variant)

When closing a device, the flag keeping track of open state was not reset,
and this prevented opening again (native Windows variant only).

10 years agoUpdated ctime after setting an ACL
Jean-Pierre André [Tue, 11 Mar 2014 09:28:02 +0000 (10:28 +0100)]
Updated ctime after setting an ACL

When setting a Posix ACL, the ctime was not updated to match ext2/ext3
behavior. This ext2/ext3 behavior has been changed, so do the same.

10 years agoUsed MFT record 15 for the first extent to MFT:DATA
Jean-Pierre André [Tue, 11 Mar 2014 09:16:26 +0000 (10:16 +0100)]
Used MFT record 15 for the first extent to MFT:DATA

When the runlist of the data attribute of MFT has to be split across
several extents, the location of each extent has to be known from the
runlist present in previous extents. So, force the first extent into
record 15 to avoid a bad layout.

10 years agoTraced dirtying runlists and updated them accordingly
Jean-Pierre André [Tue, 11 Mar 2014 09:11:00 +0000 (10:11 +0100)]
Traced dirtying runlists and updated them accordingly

Use a new flag to trace changes to a runlist and avoid recomputing the
runlist when no actual change occurred.

10 years agoAvoided full runlist updating in more situations
Jean-Pierre André [Tue, 11 Mar 2014 09:04:54 +0000 (10:04 +0100)]
Avoided full runlist updating in more situations

When a hole in a sparse file was filled, the runlist was fully recomputed.
When a sparse file spans over several MFT extents, this patch leads to
only recompute the runlist from the modified extent to the end.

10 years agoReset the output file to favour appending to image in ntfsclone
Jean-Pierre André [Tue, 11 Mar 2014 08:54:53 +0000 (09:54 +0100)]
Reset the output file to favour appending to image in ntfsclone

When ntfsclone'ing to a file, the target file was truncated to the volume
size. This is not useful on file systems which support sparse files. In
the case of ntfs-3g this leads to prevent optimizations specific to
appending data. So when a sparse output file is detected, it is emptied
to benefit from subsequent appending of data.

10 years agoAvoided double opening of parent directory name in ntfscp
Jean-Pierre André [Tue, 11 Mar 2014 08:50:02 +0000 (09:50 +0100)]
Avoided double opening of parent directory name in ntfscp

Double openings of a file or directory lead to double memory copies and
may lead to inconsistencies. On such situation could occur in ntfscp.

10 years agoAvoided unnormalized parent directory name in ntfscp
Jean-Pierre André [Tue, 11 Mar 2014 08:44:50 +0000 (09:44 +0100)]
Avoided unnormalized parent directory name in ntfscp

Avoid leading '/' in directory names and use in ntfscp the same rule as fuse.

10 years agoFixed default option for compression in the manual
Jean-Pierre André [Tue, 11 Mar 2014 08:40:18 +0000 (09:40 +0100)]
Fixed default option for compression in the manual

Mention in the manual that compression is now enabledd by default.

10 years agoFixed an erroneous reference to compression in the manual
Jean-Pierre André [Tue, 11 Mar 2014 08:35:50 +0000 (09:35 +0100)]
Fixed an erroneous reference to compression in the manual

compression was erroneously mentioned in the manual instead of permission.

10 years agoImproved the description of the silent option in the manual
Jean-Pierre André [Tue, 11 Mar 2014 08:30:18 +0000 (09:30 +0100)]
Improved the description of the silent option in the manual

The silent option acts on chown and chown, but also on permission checking,
and when the option is disabled, permission checking errors may emerge.

10 years agoAdded option --min-fragments to reduce fragmentation in ntfscp
Jean-Pierre André [Tue, 11 Mar 2014 08:24:34 +0000 (09:24 +0100)]
Added option --min-fragments to reduce fragmentation in ntfscp

When copying a file through ntfscp, the file size is known, hence the
space allocation can be optimized to get minimal fragmentation.

10 years agoAvoided displaying sync errors in ntfscp with --no-action
Jean-Pierre André [Tue, 11 Mar 2014 08:19:06 +0000 (09:19 +0100)]
Avoided displaying sync errors in ntfscp with --no-action

Do not loop on displaying errors when nothing is to be done

10 years agoFixed an endianness error in ntfsundelete
Jean-Pierre André [Tue, 11 Mar 2014 08:12:41 +0000 (09:12 +0100)]
Fixed an endianness error in ntfsundelete

Name matching was wrong on big endian CPUs when not using regex