OSDN Git Service

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

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.

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

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

11 years agoSilenced a compiler warning in ntfs-3g.probe
Jean-Pierre André [Tue, 30 Jul 2013 09:13:51 +0000 (11:13 +0200)]
Silenced a compiler warning in ntfs-3g.probe

Avoid some compilers to complain about a missing return value...

11 years agoForced 64-bit computation of inode number in ntfsundelete
Jean-Pierre André [Tue, 30 Jul 2013 09:07:12 +0000 (11:07 +0200)]
Forced 64-bit computation of inode number in ntfsundelete

An inode number computation was done with 32 bits, and could (theoretically)
lead to truncation.

11 years agoOutput the modification time when scanning files by ntfsundelete
Jean-Pierre André [Tue, 30 Jul 2013 09:00:46 +0000 (11:00 +0200)]
Output the modification time when scanning files by ntfsundelete

When trying to undelete a file which was modified several times the
same day, it is difficult to tell which one is the latest unless the
modification time is displayed.

11 years agoFixed delayed deletion of files opened multiple times in lowntfs-3g
Jean-Pierre André [Tue, 30 Jul 2013 08:53:07 +0000 (10:53 +0200)]
Fixed delayed deletion of files opened multiple times in lowntfs-3g

Reworked the delayed deletion of open files in lowntfs-3g to cope with
situations where a file was opened multiple times. In such circumstances,
multiple ghost names are created, to avoid having to check the full list
when opening and closing, which are much more frequent than deleting.

11 years agoImproved the manual description of the size option of ntfsresize
Jean-Pierre André [Tue, 30 Jul 2013 08:45:22 +0000 (10:45 +0200)]
Improved the manual description of the size option of ntfsresize

Tried to make clear an NTFS file system size is smaller than the
partition size, and the size wanted by ntfsresize is the partition
size.

11 years agoReserved a single sector for the backup boot sector
Jean-Pierre André [Tue, 30 Jul 2013 08:35:13 +0000 (10:35 +0200)]
Reserved a single sector for the backup boot sector

Reserve a single sector, instead of a full cluster, for the backup boot
sector.

11 years agoSet the backup boot sector in ntfsresize when the size is reliable
Jean-Pierre André [Tue, 30 Jul 2013 08:17:28 +0000 (10:17 +0200)]
Set the backup boot sector in ntfsresize when the size is reliable

Traditionally the backup boot sector is not set by ntfsresize because
the exact partition size is not yet known. A chkdsk is triggered to
subsequently insert it.
However ntfsresize is frequently activated by a partition editor which
has an exact knowledge of the wanted layout, and the backup boot sector
can be inserted by ntfsresize. This is only done if the target partition
size is defined with no unit suffix, and it is a multiple of the sector
size. Anyway the backup boot sector cannot overwrite useful data as it
is inserted between the file system size and the target partition size.

11 years agoFixed processing compressed data beyond file size
Jean-Pierre André [Thu, 30 May 2013 08:23:04 +0000 (10:23 +0200)]
Fixed processing compressed data beyond file size

Windows 8 does not zero any more the end of a compression block beyond
what is needed to reach the end of a file. We must now be careful not
to decompress more data than needed.

11 years agoFixed size truncation when checking for Interix types on 32-bit CPU
Jean-Pierre André [Tue, 7 May 2013 09:42:48 +0000 (11:42 +0200)]
Fixed size truncation when checking for Interix types on 32-bit CPU

A cast, intended to avoid comparing signed to unsigned, led to truncate
the size on a 32-bit CPU, hence to wrongly check for Interix types.

11 years agoFixed the reversing of slashes in relative Windows-type symlinks
Jean-Pierre André [Fri, 26 Apr 2013 17:07:47 +0000 (19:07 +0200)]
Fixed the reversing of slashes in relative Windows-type symlinks

When translating Windows-type symlinks to Linux ones, the directory
separator has to be changed from '\' to '/'. The change was wrong
for multiple "..\" and ".\"

11 years agoFixed usa checking by ntfsck on 4K sectors
Jean-Pierre André [Mon, 22 Apr 2013 17:14:48 +0000 (19:14 +0200)]
Fixed usa checking by ntfsck on 4K sectors

The usa sequence is used to make sure the sectors containing metadata
are fully written. The values are always put at the end of 512-byte
chunks even if the sectors are greater.

11 years agoRemoved obsoleted references to utime_omit_ok
Jean-Pierre André [Mon, 22 Apr 2013 17:06:49 +0000 (19:06 +0200)]
Removed obsoleted references to utime_omit_ok

When issuing an utimensat as a consequence of utime(2) or utimensat(2),
fuse had temporarily defined a flag utime_omit_ok to identify whether
the file system supports the values UTIME_OMIT and UTIME_NOW to mean
specific timestamp updatings. The flag has been obsoleted and all
file system are now supposed to comply with the convention.

11 years agoFixed updating all the MFT runs in a relocated MFT in ntfsresize
Jean-Pierre André [Mon, 22 Apr 2013 16:55:26 +0000 (18:55 +0200)]
Fixed updating all the MFT runs in a relocated MFT in ntfsresize

When the MFT is partially located beyond the end of a resized partition,
it has to be relocated after the other files have been processed
because the MFT data is needed to do the relocations. When the MFT runlist
is split over extents, all of them have to be processed.

11 years agoFixed trying to update the MFT and Bitmap on a test run of ntfsresize
Jean-Pierre André [Mon, 22 Apr 2013 16:45:48 +0000 (18:45 +0200)]
Fixed trying to update the MFT and Bitmap on a test run of ntfsresize

When the beginning of the MFT is beyond the end of the resized
partition, a specific procedure has to be used to relocate this part
of the MFT and adjust the bitmap accordingly. On a test run, these
updates should not be done.

11 years agoUsed /proc/mounts for checking existing mounts
Jean-Pierre André [Mon, 22 Apr 2013 16:37:51 +0000 (18:37 +0200)]
Used /proc/mounts for checking existing mounts

The file /etc/mtab is traditionally checked to avoid multiple mountings
of the same device, but this is not accurate enough in some conditions.
So use /proc/mounts when available and fall back to /etc/mtab on
systems which do not have /proc/mounts.

11 years agoIncreased the maximum format size on Windows
Jean-Pierre André [Mon, 22 Apr 2013 16:31:16 +0000 (18:31 +0200)]
Increased the maximum format size on Windows

The long long printing formats (such as %lld or %llx) have to be
translated to %I64 on older Windows systems, and the buffers to
receive the translated format must be able to hold the tool banners
which can be quite lengthy.

11 years agoFixed a use of uninitialized variable compiler warning
Jean-Pierre André [Wed, 13 Feb 2013 07:54:34 +0000 (08:54 +0100)]
Fixed a use of uninitialized variable compiler warning

Author: Anton Altaparmakov
Date:   Wed Feb 13 02:29:47 2013 +0000

This is a fix to the use of hd library to get the legacy BIOS geometry.

11 years agoMade compilation with --enable-really-static option to ./configure work
Jean-Pierre André [Wed, 13 Feb 2013 07:51:47 +0000 (08:51 +0100)]
Made compilation with --enable-really-static option to ./configure work

Author: Anton Altaparmakov
Date:   Wed Feb 13 02:29:47 2013 +0000

This is a fix to the use of hd library to get the legacy BIOS geometry.

11 years agoAdded use of hd library to get the legacy BIOS geometry
Jean-Pierre André [Tue, 12 Feb 2013 14:45:54 +0000 (15:45 +0100)]
Added use of hd library to get the legacy BIOS geometry

Author: Anton Altaparmakov <anton@tuxera.com>
Date:   Tue Feb 12 10:33:55 2013 +0000

    Modify libntfs-3g to make use of hd library to get the legacy BIOS geometry
    from EDD.  We scan all whole disk devices on the system and check if they
    match the open ntfs device and if not we scan all partition devices on the
    system and check if they match the open ntfs device.

    If we find a partition device to match then we find its parent device again
    using the hd library.

    Once we have the parent of the partition device or we matched a whole disk
    device we get the legacy EDD sectors per track and heads again using the hd
    library.

    Use of the hd library is auto detected (based on finding <hd.h> header file,
    being able to link against libhd and finding the hd_list symbol in libhd.

    Use can also be disabled/enabled/libhd prefix specified at ./configure time.
    See ./configure --help for details.

    Note this obviously requires libhd to be installed.  On Ubuntu 12/04 systems
    the relevant packages needed are libhd-dev and libhd16 (on older Ubuntu
    versions it will be libhdN where N is some number <= 16 but an easy way to
    get the right package is to simply install libhd-dev which by dependency
    pulls in the correct libhdN package) whilst on SLES systems the relevant
    packages needed are hwinfo and hwinfo-devel.

11 years agoMade the meaning of the size argument of ntfsresize more clear in the manual
Jean-Pierre André [Sat, 9 Feb 2013 14:19:34 +0000 (15:19 +0100)]
Made the meaning of the size argument of ntfsresize more clear in the manual

The size argument of ntfsresize is the target partition size. This is
not the file system size as returned by df(1) or statvfs(3) because a
sector is reserved for the backup boot sector, and the remaining sector
count might not be a multiple of clusters per sector.

11 years agoInitialize the random generator for the internal guid generator
Jean-Pierre André [Sat, 9 Feb 2013 14:12:56 +0000 (15:12 +0100)]
Initialize the random generator for the internal guid generator

When uuid/uuid.h is not available, mkntfs uses a home-made guid
generator. Better initialize the random generator to get a random guid.

11 years agoFixed rescuing clusters by physical sectors in ntfsclone
Jean-Pierre André [Sat, 9 Feb 2013 14:07:06 +0000 (15:07 +0100)]
Fixed rescuing clusters by physical sectors in ntfsclone

When a sector is unreadable, consider the whole sector as bad, instead
of trying to find which 512-byte parts of it are bad. This was causing
unwanted retries for devices with 4K sectors.

11 years agoFixed setting a magic header to unreadable sectors in ntfsclone
Jean-Pierre André [Sat, 9 Feb 2013 14:04:41 +0000 (15:04 +0100)]
Fixed setting a magic header to unreadable sectors in ntfsclone

The magic header of an unreadable sectors should have the size of
"BadSectoR", not the size of a pointer to it.

11 years agoRejected reading a volume from stdin in ntfsclone
Jean-Pierre André [Sat, 9 Feb 2013 14:01:36 +0000 (15:01 +0100)]
Rejected reading a volume from stdin in ntfsclone

Reading a volume must be done in a seekable way. Better throw a proper
error.

11 years agoPorted ntfsundelete to Windows
Jean-Pierre André [Sat, 9 Feb 2013 13:56:46 +0000 (14:56 +0100)]
Ported ntfsundelete to Windows

Made a few adaptations to what is available on Windows.

11 years agoTranslated %ll print editing formats to %I64 on Windows
Jean-Pierre André [Sat, 9 Feb 2013 11:57:22 +0000 (12:57 +0100)]
Translated %ll print editing formats to %I64 on Windows

Older msvcrt.dll (on XP and earlier) did not support "%ll" print editing
formats frequently used by ntfsclone. So translate them to "%I64" when
running on Windows. This format appears to be supported by all Windows
versions. Error messages from libntfs-3g are still not translated.

11 years agoPorted ntfsclone to Windows
Jean-Pierre André [Sat, 9 Feb 2013 11:54:44 +0000 (12:54 +0100)]
Ported ntfsclone to Windows

This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.

11 years agoFixed bad copying of the backup boot sector in ntfsclone
Jean-Pierre André [Sat, 9 Feb 2013 11:53:38 +0000 (12:53 +0100)]
Fixed bad copying of the backup boot sector in ntfsclone

This patch fixes the sector offset to the backup boot sector when creating
a metadata image.

11 years agoRevert "Ported ntfsclone to Windows", should be "Fixed bad copying of the backup...
Jean-Pierre André [Sat, 9 Feb 2013 11:50:16 +0000 (12:50 +0100)]
Revert "Ported ntfsclone to Windows", should be "Fixed bad copying of the backup boot sector"

This reverts commit 92cd41b6e5b3dd755065d345a8f2c44db7b5ce48.

The title and description were wrong

11 years agoPorted ntfsclone to Windows
Jean-Pierre André [Sat, 9 Feb 2013 11:14:19 +0000 (12:14 +0100)]
Ported ntfsclone to Windows

This mainly means using the functions in win32_io.c instead of the
standard msvcrt.dll ones in order to be able to truncate files and
create sparse ones.

11 years agoCleaned selecting stdout or stderr for messages from ntfsclone
Jean-Pierre André [Sat, 9 Feb 2013 11:12:02 +0000 (12:12 +0100)]
Cleaned selecting stdout or stderr for messages from ntfsclone

Depending on the options selected, ntfsclone messages are output on
stdout or stderr. This is now done through standard logging procedures.

11 years agoAvoided displaying in non-verbose mode information which is not computed
Jean-Pierre André [Sat, 9 Feb 2013 11:08:58 +0000 (12:08 +0100)]
Avoided displaying in non-verbose mode information which is not computed

The summary of 'runcount.runs' and 'runcount.fragments' was displayed in
non-verbose mode. However these variables are not updated in non-verbose
mode, so they would always be 0.
We now only display this summary in verbose mode.

11 years agoEnabled relocating the MFT when shrinking a volume
Jean-Pierre André [Sat, 9 Feb 2013 11:00:02 +0000 (12:00 +0100)]
Enabled relocating the MFT when shrinking a volume

This patch makes it possible to shrink a volume to a small size such that
the existing $MFT is beyond the new size.

11 years agoMade possible to run ntfsundelete on systems with no regex.h
Jean-Pierre André [Sat, 9 Feb 2013 10:56:09 +0000 (11:56 +0100)]
Made possible to run ntfsundelete on systems with no regex.h

The filtering of files to undelete is usually done through the regex
library. This patch offers an alternate way when such a library is
not readily available (typically on Windows).

11 years agoAvoided meaningless errors logging during ntfsundelete scans
Jean-Pierre André [Sat, 9 Feb 2013 10:51:40 +0000 (11:51 +0100)]
Avoided meaningless errors logging during ntfsundelete scans

When ntfsundelete scans the $MFT for possible deleted files, it may
examine extries which have never been used, producing error messages
which most users do not understand. This patch silences such messages.

11 years agoCosmetic : use symbolic names for ntfsclone control codes
Jean-Pierre André [Sat, 9 Feb 2013 10:48:54 +0000 (11:48 +0100)]
Cosmetic : use symbolic names for ntfsclone control codes

Defining symbolic names makes it easier to identify where they are used.

11 years agoAllowed cloning a file system despite allocation errors
Jean-Pierre André [Sat, 9 Feb 2013 10:41:39 +0000 (11:41 +0100)]
Allowed cloning a file system despite allocation errors

Allow the "--ignore-fs-check" option to be used when cloning a file system
which has allocation errors. This is useful when there is a fear that
repairing the file system might create further damage, or when the repair
has to be made on another computer.

11 years agoAdded a display of the location of an inconsistency in an image
Jean-Pierre André [Sat, 9 Feb 2013 10:37:31 +0000 (11:37 +0100)]
Added a display of the location of an inconsistency in an image

When an ntfsclone image appears to be corrupted, show at which position
the error happens. This is useful for providing support.

11 years agoFixed the ntfsfix option for testing in the manual
Jean-Pierre André [Sat, 9 Feb 2013 10:33:17 +0000 (11:33 +0100)]
Fixed the ntfsfix option for testing in the manual

The option for checking the behavior of ntfsfix without writing anything
is "--no-action", not "--do-nothing".

11 years agoAdded a new option for testing the consistency of an ntfsclone image
Jean-Pierre André [Sat, 9 Feb 2013 10:29:21 +0000 (11:29 +0100)]
Added a new option for testing the consistency of an ntfsclone image

This patch adds a new option -n to ntfsclone for simulating a restore
without writing anything. This is useful for checking the consistency
of an image without destroying the original partition.

11 years agoUpgraded the Win32 interface for use with ntfsprogs
Jean-Pierre André [Sat, 9 Feb 2013 10:22:41 +0000 (11:22 +0100)]
Upgraded the Win32 interface for use with ntfsprogs

Upgrade the Win32 interface (win32_io.c) which was designed for Cygwin
so that it can be used for using the ntfsprogs utilities on native Windows.
Two new entries are added for truncating a file and creating a sparse
file, both of which not being supported through msvcrt.dll.

11 years agoFixed wiping fragmented metadata when creating a metadata image
Jean-Pierre André [Sat, 9 Feb 2013 10:12:45 +0000 (11:12 +0100)]
Fixed wiping fragmented metadata when creating a metadata image

When creating a metadata image, all user data is supposed to be wiped off,
but this was wrong for $MFT and directory indexes when they were
fragmented. This patch cleans the tails of metadata fragments.

11 years agoAdded directions for getting a user mapping proposal through secaudit
Jean-Pierre André [Sat, 9 Feb 2013 10:06:39 +0000 (11:06 +0100)]
Added directions for getting a user mapping proposal through secaudit

The definition of the user mapping needed to interoperate permissions
with Windows is too complex for most users. Even the "usermap" utility
is too complex. This patch adds explanations for using the "-u" option
of secaudit to get a user mapping proposal

11 years agoVersion 2012.1.13
Szabolcs Szakacsits [Sun, 13 Jan 2013 06:31:50 +0000 (08:31 +0200)]
Version 2012.1.13

11 years agoRename legacy MS_* flags for ntfs_mount with NTFS_MNT_* flags.
Erik Larsson [Wed, 7 Nov 2012 15:29:48 +0000 (16:29 +0100)]
Rename legacy MS_* flags for ntfs_mount with NTFS_MNT_* flags.

The MS_* flags originated from system constants. However the flags
passed to ntfs_mount were really unrelated to the system constants and
many new MS_* flags had to be introduced as different features were
added to the library. Those flags had no counterparts in any system
APIs, so using the same naming scheme is inappropriate.

Instead, let's namespace these flags similarly to what has already been
done in ntfsprogs/libntfs earlier. This avoids any possible conflicts
with system constants.
The values of the flags themselves are kept the same as earlier, so
backward compatibility is retained.

11 years agoAPI cleanup of const arguments.
Erik Larsson [Wed, 7 Nov 2012 13:15:53 +0000 (14:15 +0100)]
API cleanup of const arguments.

- Replaced 'ntfschar*' parameters with 'const ntfschar*' where
  appropriate (the function does not need to modify the string).
- Replaced some instances of 'u8*' and 'char*' read-only buffer
  arguments with 'const u8*' and 'const char*'.

11 years agoconfigure.ac: Restructure uuid library detection.
Erik Larsson [Tue, 6 Nov 2012 09:30:48 +0000 (10:30 +0100)]
configure.ac: Restructure uuid library detection.

The 'uuid' library functionality may be located in a separate 'uuid'
library, but it may also be included in the standard C library. This is
the case on Mac OS X.

Instead of relying on the uuid code being located in a 'uuid' library,
we restructure the code so that it checks different libraries, in order
for the 'uuid_generate' function. This code is easy to extend if we
would find a new configuration where uuid_generate is located in a
different library.

11 years agontfsclone.c: Cleanup in error message.
Erik Larsson [Tue, 6 Nov 2012 07:23:04 +0000 (08:23 +0100)]
ntfsclone.c: Cleanup in error message.

11 years agoacls.c: Fix compiler warning regarding usage of uninitialized variable.
Erik Larsson [Tue, 6 Nov 2012 01:12:48 +0000 (02:12 +0100)]
acls.c: Fix compiler warning regarding usage of uninitialized variable.

This warning is really a false alarm, but fix it anyway.