OSDN Git Service

android-x86/external-ntfs-3g.git
8 years agoAdd the header for prototypes of some system calls lollipop-x86
Chih-Wei Huang [Thu, 15 Oct 2015 17:18:52 +0000 (01:18 +0800)]
Add the header for prototypes of some system calls

Define the prototypes of fork/setsid/chdir/dup2/close/_exit to
fix the building errors on Android 6.0.

8 years agoMerge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into lollipop-x86
Chih-Wei Huang [Thu, 15 Oct 2015 17:10:03 +0000 (01:10 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into lollipop-x86

8 years agoProtected against opendir reinitialization in lownfs-3g
Jean-Pierre André [Wed, 30 Sep 2015 07:35:17 +0000 (09:35 +0200)]
Protected against opendir reinitialization in lownfs-3g

Under some condition (probably interference with another process), the
directory list gets reinitialized by releasedir() and opendir() at the
beginning of a partial buffer. So in readdir() skip to the requested
offset. This is a step towards implementing seekdir().

8 years agontfsprogs Builds on Windows use macroes to translate printing formats,
Jean-Pierre André [Wed, 30 Sep 2015 07:08:35 +0000 (09:08 +0200)]
ntfsprogs Builds on Windows use macroes to translate printing formats,
and these macroes redefined "buf" in a way which causes trouble when
"buf" has another meaning. Use "_b" instead.

8 years agoDisplayed reparse point information in ntfsinfo
Jean-Pierre André [Wed, 30 Sep 2015 07:05:47 +0000 (09:05 +0200)]
Displayed reparse point information in ntfsinfo

Added displaying of reparse point data and decode known formats.

8 years agoImproved the check for a valid $MFTMirr
Jean-Pierre André [Wed, 30 Sep 2015 07:02:15 +0000 (09:02 +0200)]
Improved the check for a valid $MFTMirr

The test for a valid $MFTMirr could segfault on a badly damaged partition.
Add safety checks.

8 years agoFixed a wrong test report in ntfsfix
Jean-Pierre André [Wed, 30 Sep 2015 06:54:27 +0000 (08:54 +0200)]
Fixed a wrong test report in ntfsfix

When used with the "no-action" option, the test for self-located MFT
still reported the partition to have been repaired. Adapt the report to
only tell repairing is possible.

8 years agoFixed a bad sanity check in ntfsfix
Jean-Pierre André [Wed, 30 Sep 2015 06:51:20 +0000 (08:51 +0200)]
Fixed a bad sanity check in ntfsfix

Fix misordered checks to avoid potential segfaults on badly damaged partitions.

8 years agoMade secaudit to load the library based on its generic name
Jean-Pierre André [Wed, 30 Sep 2015 06:44:56 +0000 (08:44 +0200)]
Made secaudit to load the library based on its generic name

When compiled autonomously without the automatically generated dynamic
link stubs, use a generic library name instead of a version dependent one.
(obsolete compile mode rarely used).

8 years agoMade use of fuse module cache on OpenIndiana
Jean-Pierre André [Wed, 30 Sep 2015 06:36:37 +0000 (08:36 +0200)]
Made use of fuse module cache on OpenIndiana

The fuse cache does not handle properly hard-linked files, so ntfs-3g
traditionally disables it by using a null time-out. With an upgrade of
the fuse kernel module on OpenIndiana, cacheing of non hard-linked files
is now possible, so use it.

8 years agoMentioned the starting sector when it overflows in mkntfs
Jean-Pierre André [Wed, 30 Sep 2015 06:25:25 +0000 (08:25 +0200)]
Mentioned the starting sector when it overflows in mkntfs

In an NTFS boot sector, the first sector of the partition is limited to
32 bits and it may overflow on large disks. This field is only used for
booting on the partition and it is ignored by ntfs-3g, but the warning
in mkntfs mislead users, so improve it.

8 years agoUsed incremental offsets when reading a directory in lowntfs-3g
Jean-Pierre André [Wed, 30 Sep 2015 06:18:13 +0000 (08:18 +0200)]
Used incremental offsets when reading a directory in lowntfs-3g

Using incremental offsets avoids misinterpreting readdir() as rewinddir().
It also makes possible to implement seekdir() [not done yet]

8 years agoMerge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into lollipop-x86
Chih-Wei Huang [Fri, 21 Aug 2015 13:10:16 +0000 (21:10 +0800)]
Merge branch 'edge' of git://git.code.sf.net/p/ntfs-3g/ntfs-3g into lollipop-x86

9 years agoFixed the range of valid subauthority counts in a SID
Jean-Pierre André [Tue, 14 Jul 2015 06:37:01 +0000 (08:37 +0200)]
Fixed the range of valid subauthority counts in a SID

ntfs_valid_sid() required that the subauthority count be between 1 and 8
inclusively.  However, Windows permits more than 8 subauthorities as well
as 0 subauthorities:

  - The install.wim file for the latest Windows 10 build contains a file
    whose DACL contains a SID with 10 subauthorities.
    ntfs_set_ntfs_acl() was failing on this file.

  - The IsValidSid() function on Windows returns true for subauthority
    less than or equal to 15, including 0.

There was actually already a another SID validation function that had the
Windows-compatible behavior, so I merged the two together.

Contributed by Eric Biggers

9 years agounistr.c: Cleanup of OS X Unicode normalization code.
Erik Larsson [Tue, 23 Jun 2015 04:43:17 +0000 (06:43 +0200)]
unistr.c: Cleanup of OS X Unicode normalization code.

Normalize coding conventions to fit in with the rest of NTFS-3G,
including line breaks at column 80.

9 years agoSkip installing manpages for mount helpers when they aren't available.
Erik Larsson [Tue, 23 Jun 2015 04:27:33 +0000 (06:27 +0200)]
Skip installing manpages for mount helpers when they aren't available.

9 years agoMake installing mkntfs /sbin symlinks dependent on ENABLE_MOUNT_HELPER.
Erik Larsson [Tue, 23 Jun 2015 04:26:52 +0000 (06:26 +0200)]
Make installing mkntfs /sbin symlinks dependent on ENABLE_MOUNT_HELPER.

We shouldn't install anything into /sbin unless ENABLE_MOUNT_HELPER is
on, which is only true for Linux (these are Linux-specific symlinks).

9 years agoPorted clearing the environment when starting mount or umount
Jean-Pierre André [Mon, 1 Jun 2015 10:48:43 +0000 (12:48 +0200)]
Ported clearing the environment when starting mount or umount

When starting mount or umount, the environment was not cleared and
could be used for privilege escalation (CVE-2015-3202).
This is a port of the fix to full fuse by using execle(3) instead
of execl(3)

9 years agoImplemented rewindind a directory in lowntfs-3g
Jean-Pierre André [Fri, 17 Apr 2015 09:38:33 +0000 (11:38 +0200)]
Implemented rewindind a directory in lowntfs-3g

Rewinding a directory is done by freeing the current list of files and
rebuilding it. Only seeking to the beginning of the list is implemented.

9 years agoZeroed uninitialized bytes before writing compressed data
Jean-Pierre André [Fri, 17 Apr 2015 09:31:47 +0000 (11:31 +0200)]
Zeroed uninitialized bytes before writing compressed data

Compressed records may be written as full clusters even though cluster
tails are meaningless. This is to avoid the lower levels doing a read-
modify-write cycle. Be sure to zero the meaningless bytes to avoid
leaking information.

Contributed by Eric Biggers

9 years agoPacked/unpacked st_rdev transported as 32-bits on OpenIndiana 64-bits
Jean-Pierre André [Fri, 17 Apr 2015 09:22:49 +0000 (11:22 +0200)]
Packed/unpacked st_rdev transported as 32-bits on OpenIndiana 64-bits

On OpenIndiana 64-bits, st_rdev has major and minor as 32-bits wide each,
but the fuse protocol (common to 32-bit and 64-bit) has an st_rdev field
limited to 32-bit. For now, pack major and minor the same way as in the
32-bit variant (14 and 18 bits).

9 years agoSimplified NTFS ACLs when group same as owner and same permission as all
Jean-Pierre André [Fri, 17 Apr 2015 09:17:51 +0000 (11:17 +0200)]
Simplified NTFS ACLs when group same as owner and same permission as all

When the owner and the group of a file have the same SID, and permissions
for the group is the same as permissions for other, no ACE is needed for
the group.

9 years agoFixed setting SIG_DFL on fuse session exit
Jean-Pierre André [Fri, 17 Apr 2015 09:14:36 +0000 (11:14 +0200)]
Fixed setting SIG_DFL on fuse session exit

This is a backport of a fix applied to the (external) fuse library

9 years agoUpgraded the upper-case table as defined by Windows 7
Jean-Pierre André [Fri, 17 Apr 2015 09:03:58 +0000 (11:03 +0200)]
Upgraded the upper-case table as defined by Windows 7

Newer versions of Windows use more recent definitions of upper-case
table defined by the Unicode consortium. Now using the same table as
Windows 7, windows 8 and Windows 10. This only has an effect on file
systems newly created by mkntfs.

9 years agoFixed the DESX encryption/decryption in ntfsdecrypt
Jean-Pierre André [Fri, 17 Apr 2015 09:00:00 +0000 (11:00 +0200)]
Fixed the DESX encryption/decryption in ntfsdecrypt

The DESX encryption/decryption algorithm was different from the Windows one.

9 years agoRemoved a temporary debug comment (cosmetic)
Jean-Pierre André [Fri, 17 Apr 2015 08:56:34 +0000 (10:56 +0200)]
Removed a temporary debug comment (cosmetic)

The comment was a left over from some debugging action.

9 years agoAdded a sanity check to ntfswipe
Jean-Pierre André [Fri, 17 Apr 2015 08:49:23 +0000 (10:49 +0200)]
Added a sanity check to ntfswipe

Unused entries in the MFT may have a bad length leading to fetch fixups
from unallocated memory. Check the condition, but do not wipe, leave it
to chkdsk to decide what should be fixed.

9 years agoDefended against reusing data from an invalid MFT record
Jean-Pierre André [Fri, 17 Apr 2015 08:41:04 +0000 (10:41 +0200)]
Defended against reusing data from an invalid MFT record

An unused MFT record may show a bad length, leading to fetch fixups from
unallocated memory when allocating the record to a new file. So check
the length before applying the fixups. Such records have been found after
the MFT has been reallocated by a defragmenter, and they are not cleaned
by chkdsk.

9 years agoUpdated the read-only flag even when the security attribute was cached
Jean-Pierre André [Fri, 17 Apr 2015 08:35:26 +0000 (10:35 +0200)]
Updated the read-only flag even when the security attribute was cached

When chmod'ing a file, no new ACL has to be created if the one needed
is already present in the cache. However the read-only flag may have
to be updated, so that it is kept as the opposite of S_IWUSR.

9 years agoRemoved the double try to unmount partition in ntfsfix
Jean-Pierre André [Fri, 17 Apr 2015 08:27:24 +0000 (10:27 +0200)]
Removed the double try to unmount partition in ntfsfix

When the unmounting of the partition fails after running ntfsfix, a
second try was attempted. This cannot be done and leads to more errors
because some essential records have been freed, so better quit without
making a second try.

9 years agoFixed displaying "UserMapping" as a file name
Jean-Pierre André [Fri, 17 Apr 2015 08:21:02 +0000 (10:21 +0200)]
Fixed displaying "UserMapping" as a file name

Fix the capitalization of the user mapping file name to be filled with
the output of secaudit with option -u.

9 years agoRephrased a misleading report message in ntfswipe
Jean-Pierre André [Fri, 17 Apr 2015 07:42:19 +0000 (09:42 +0200)]
Rephrased a misleading report message in ntfswipe

When using the "--no-action" option, ntfswipe should display a count
of would-be wiped bytes without suggesting any has been wiped.

9 years agoAvoided logging meaningless fixup errors in ntfswipe
Jean-Pierre André [Fri, 17 Apr 2015 07:37:11 +0000 (09:37 +0200)]
Avoided logging meaningless fixup errors in ntfswipe

As ntfswipe examines all MFT entries, it may find uninitialized ones.
They should not be considered as erroneous ones even if the fixups
are wrong.

9 years agoAvoided mentioning deleted inodes in non-verbose output of ntfswipe
Jean-Pierre André [Fri, 17 Apr 2015 07:33:04 +0000 (09:33 +0200)]
Avoided mentioning deleted inodes in non-verbose output of ntfswipe

In non-verbose ntfswipe, avoid displaying deleted inodes as erroneous
ones.

9 years agoAdded clarifications about several options to the ntfswipe manual
Jean-Pierre André [Fri, 17 Apr 2015 07:26:59 +0000 (09:26 +0200)]
Added clarifications about several options to the ntfswipe manual

Clarified the usage of fast wiping, info and verbose options.

9 years agoFixed getting sector size from a partition image (Windows variant)
Jean-Pierre André [Fri, 17 Apr 2015 07:21:58 +0000 (09:21 +0200)]
Fixed getting sector size from a partition image (Windows variant)

On Windows, when processing a partition image, get the sector size
from the boot sector instead of the containing partition.

9 years agoSupported the directory separator on Windows in ntfsprogs (cosmetic)
Jean-Pierre André [Fri, 17 Apr 2015 07:15:25 +0000 (09:15 +0200)]
Supported the directory separator on Windows in ntfsprogs (cosmetic)

On Windows, when an ntfsprogs utility requests a path translation,
translate the '\'s to '/'s so that only '/' have to be interpreted
in libntfs.

9 years agoRephrased the warning for trimming not supported (cosmetic)
Jean-Pierre André [Fri, 17 Apr 2015 07:06:22 +0000 (09:06 +0200)]
Rephrased the warning for trimming not supported (cosmetic)

The initial text looked like an error message

9 years agoAvoided truncation in a debug message in secaudit
Jean-Pierre André [Fri, 17 Apr 2015 07:03:08 +0000 (09:03 +0200)]
Avoided truncation in a debug message in secaudit

When compiled for Windows 64-bit, pointers have to be displayed as
"long long" instead of "long" which is 32-bit

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 agoAdd implementation of fuse_daemonize kitkat-x86
Chih-Wei Huang [Fri, 18 Apr 2014 06:25:13 +0000 (14:25 +0800)]
Add implementation of fuse_daemonize

It's used by exfat.

10 years agoAndroid porting for ntfs-3g
Chih-Wei Huang [Thu, 17 Apr 2014 03:11:59 +0000 (11:11 +0800)]
Android porting for ntfs-3g

It creates ntfs-3g, ntfsfix and mkntfs executables used by vold.

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.