OSDN Git Service

android-x86/external-ntfs-3g.git
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.

10 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)

10 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

10 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.

10 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

10 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.

10 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

10 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

10 years agoAllowed setting the serial number to 0x8000000000000000 or greater
Jean-Pierre André [Tue, 11 Mar 2014 08:07:59 +0000 (09:07 +0100)]
Allowed setting the serial number to 0x8000000000000000 or greater

The serial number of an ntfs volume should be processed as an unsigned
number (fix by E. Talsma)

10 years agoUpdated the references to changelog and source repository
Jean-Pierre André [Sun, 16 Feb 2014 20:16:09 +0000 (21:16 +0100)]
Updated the references to changelog and source repository

References now set to Tuxera and git repository

10 years agoUpdated copyright claims
Jean-Pierre André [Sun, 16 Feb 2014 17:25:09 +0000 (18:25 +0100)]
Updated copyright claims

10 years agoVersion 2014.2.15
Szabolcs Szakacsits [Sat, 15 Feb 2014 14:01:40 +0000 (16:01 +0200)]
Version 2014.2.15

10 years agoMade ntfsdecrypt compatible with libgrypt-1.6
Jean-Pierre André [Mon, 13 Jan 2014 14:21:51 +0000 (15:21 +0100)]
Made ntfsdecrypt compatible with libgrypt-1.6

The upcoming libgrypt-1.6 drops the "module" interface which was used
by ntfsdecrypt for decrypting files which were encrypted with the "DESX"
algorithm. This algorithm is a Microsoft variant of DES with a key size
of 128 bits, and is not natively supported by libgrypt. The module interface
made possible to declare an external algorithm so that all the encryption
modes could be processed the same way whether the algorithm was internal
or external.
This patch makes DESX a specific case, so that the module interface is
not needed any more. It is compatible with current libgrypt and upcoming
libgrypt-1.6

10 years agoIgnored unmapped regions when checking whether sparse
Jean-Pierre André [Tue, 17 Dec 2013 09:39:55 +0000 (10:39 +0100)]
Ignored unmapped regions when checking whether sparse

Updating an attribute may imply decompressing runlists which are not
contiguous, leaving an unmapped region between them. When checking whether
the attribute has been made sparse, such unmapped regions should be ignored
This mostly happens after updating an index. (fix by Forrest Liu)

10 years agoLogged more details when an attribute is not found
Jean-Pierre André [Fri, 20 Sep 2013 14:20:02 +0000 (16:20 +0200)]
Logged more details when an attribute is not found

Log the inode number and attribute type when an attribute is not found.
This simplifies identifying relevant ones among such log messages.

10 years agoAllowed DACLs to to not have any ACE
Jean-Pierre André [Fri, 20 Sep 2013 14:14:55 +0000 (16:14 +0200)]
Allowed DACLs to to not have any ACE

Windows server 2012 apparently uses files with no ACEs in their DACL,
thus denying any access to any process except system backup.
Such DACLs should however be considered valid.

10 years agoFixed memory leak while comparing attributes with bad sectors
Jean-Pierre André [Mon, 9 Sep 2013 17:46:00 +0000 (19:46 +0200)]
Fixed memory leak while comparing attributes with bad sectors

When bad sectors were found when comparing attributes, the attribute
descriptors were not closed and freed (fixed by Rakesh Pandit)

10 years agoSilenced warnings by gcc >= 4.8 about non-checked return values
Jean-Pierre André [Mon, 9 Sep 2013 13:39:45 +0000 (15:39 +0200)]
Silenced warnings by gcc >= 4.8 about non-checked return values

Added tests on the value returned by setuid() to avoid warnings by
gcc >= 4.8

10 years agoSilenced warnings by gcc >= 4.8 about aliasing
Jean-Pierre André [Mon, 9 Sep 2013 13:34:14 +0000 (15:34 +0200)]
Silenced warnings by gcc >= 4.8 about aliasing

Added intermediate variables to avoid warnings by gcc >= 4.8

10 years agoFixed expanding a resident attribute without inserting holes
Jean-Pierre André [Mon, 9 Sep 2013 13:27:38 +0000 (15:27 +0200)]
Fixed expanding a resident attribute without inserting holes

When calling ntfstruncate() to expand a resident attribute, the function
is called again recursively, losing the requirement for not inserting
holes. This is for forwarding the requirement (used by ntfscp).

10 years agoFixed testing whether a stream has been wiped out
Jean-Pierre André [Mon, 9 Sep 2013 13:19:50 +0000 (15:19 +0200)]
Fixed testing whether a stream has been wiped out

When testing whether a stream has been wiped out for possibly changing
its compression status, only the non-resident case was considered.
This fixes the test for streams which were never made non-resident.

11 years agoFixed creating a new image file on Windows
Jean-Pierre André [Tue, 6 Aug 2013 09:44:40 +0000 (11:44 +0200)]
Fixed creating a new image file on Windows

Creating a new image file (clone or metadata) by ntfsclone failed on
Windows, because the file was not opened with the needed flags.

11 years agoFixed dealing with errors getting the file size from Windows
Jean-Pierre André [Tue, 6 Aug 2013 09:39:13 +0000 (11:39 +0200)]
Fixed dealing with errors getting the file size from Windows

Using SetFilePointer() for compatibility with old Windows implies
a specific management of errors....

11 years agoFixed computing a file size on Windows
Jean-Pierre André [Tue, 30 Jul 2013 09:42:59 +0000 (11:42 +0200)]
Fixed computing a file size on Windows

The lower part should not have been sign-extended.

11 years agoFixed struct formats for running on 64-bit Windows
Jean-Pierre André [Tue, 30 Jul 2013 09:31:56 +0000 (11:31 +0200)]
Fixed struct formats for running on 64-bit Windows

Added a few paddings for field alignment in structs whose layout has to
match 64-bit Windows internals.

11 years agoFixed format translations for Windows
Jean-Pierre André [Tue, 30 Jul 2013 09:27:16 +0000 (11:27 +0200)]
Fixed format translations for Windows

Translating "%ll" print formats to "%I64" for Windows was wrong.

11 years agoRemoved duplicated code in mkntfs
Jean-Pierre André [Tue, 30 Jul 2013 09:22:34 +0000 (11:22 +0200)]
Removed duplicated code in mkntfs

Removed a meaningless duplicated test.

11 years agoImproved emulation of stat(2) on Windows
Jean-Pierre André [Tue, 30 Jul 2013 09:17:29 +0000 (11:17 +0200)]
Improved emulation of stat(2) on Windows

Made a distinction between a file and a partition when emulating stat(2)
on Windows (useful for ntfsclone).