OSDN Git Service

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

11 years agontfsclone.c: Fix missing space in error message.
Erik Larsson [Tue, 6 Nov 2012 01:07:53 +0000 (02:07 +0100)]
ntfsclone.c: Fix missing space in error message.

11 years agoFix compilation of libfuse-lite on Solaris/OpenIndiana.
Erik Larsson [Sun, 28 Oct 2012 04:23:39 +0000 (05:23 +0100)]
Fix compilation of libfuse-lite on Solaris/OpenIndiana.

The OpenSolaris port of libfuse, from which our Solaris-port of
libfuse-lite originated, had to be supplied with some additional
compiler flags in order to compile.
The configure script now detects whether it is running on a Solaris
system. If that is the case it passes the proper compiler flags to
libfuse-lite, so it can compile properly.

Tested on:
- OpenIndiana oi_151a3 / gcc 3.4.3
- OpenIndiana oi_151a7 / gcc 4.3.3
- Solaris 11.1 / gcc 4.5.2

11 years agoconfigure.ac: Disable checks for libfuse when not building ntfs-3g.
Erik Larsson [Sat, 27 Oct 2012 11:18:07 +0000 (13:18 +0200)]
configure.ac: Disable checks for libfuse when not building ntfs-3g.

When we aren't building ntfs-3g but only the tools, then there's no need
for libfuse. Still the configure script checked for libfuse availability
and wouln't proceed unless either libfuse was detected or libfuse-lite
was enabled.

This commit fixes this issue by running the libfuse checks only when
ntfs-3g is built, meaning that we can now build the ntfsprogs even when
libfuse library or headers aren't available.

11 years agoInserted updated definitions of reparse tags into layout.h
Jean-Pierre André [Fri, 5 Oct 2012 08:42:19 +0000 (10:42 +0200)]
Inserted updated definitions of reparse tags into layout.h

Replace the obsolete definition of reparse tags in layout.h by the
current definitions from msdn, and use them in reparse.c instead of
redefining them.

11 years agoFixed a memory leak caused by disabling getting/setting DOS names
Jean-Pierre André [Fri, 5 Oct 2012 08:35:59 +0000 (10:35 +0200)]
Fixed a memory leak caused by disabling getting/setting DOS names

After rejecting a DOS name setting on a hardlinked file, the search
context has to be freed.

11 years agoDisabled getting/setting DOS names on hardlinked files
Jean-Pierre André [Wed, 3 Oct 2012 09:23:58 +0000 (11:23 +0200)]
Disabled getting/setting DOS names on hardlinked files

As the path passed to ntfs-3g for getxattr(2)/setxattr(2) are not
guaranteed to be the one mentioned by the caller when there are hard links,
getting/setting DOS names have to be discontinued in that situation.
Getting/setting DOS names is still possible when there is a single
non-DOS name.

11 years agoPrevented partitions with metadata cached in Windows from being mounted
Jean-Pierre André [Tue, 25 Sep 2012 07:46:54 +0000 (09:46 +0200)]
Prevented partitions with metadata cached in Windows from being mounted

Windows 8 includes a "fast restart" feature for restarting without fully
remounting the internal volumes. When this mode is selected, metadata
stored in the cache (probably hiberfil.sys) is used instead of what
is actually on disk, and this may lead to inconsistencies when changes
have been made by ntfs-3g in the meantime.

This patch tries to prevent ntfs-3g from mounting in read-write mode
when a fast restart of Windows 8 is detected. It relies on the restart
pages in the $LogFile being identified as version 2.0, which is
apparently related to data being cached for hibernation or fast restarting.

11 years agobootsect.c: Don't allow negative start clusters for $MFT/$MFTMirr.
Erik Larsson [Mon, 24 Sep 2012 09:35:41 +0000 (11:35 +0200)]
bootsect.c: Don't allow negative start clusters for $MFT/$MFTMirr.

Negative values for mft_lcn / mftmirr_lcn don't make any sense and must
be detected as corruptions.

11 years agoForced option ro when mounting a read-only device
Jean-Pierre André [Wed, 12 Sep 2012 07:47:36 +0000 (09:47 +0200)]
Forced option ro when mounting a read-only device

External devices, such as USB keys, may have a switch to make them
temporarily unwriteable. When such a device is plugged in, mount it
as read-only by default.

11 years agoAccepted processing restart pages v 2.0 with no warning (used by Windows 8)
Jean-Pierre André [Wed, 12 Sep 2012 07:42:24 +0000 (09:42 +0200)]
Accepted processing restart pages v 2.0 with no warning (used by Windows 8)

In the $LogFile, Windows 8 defines restart pages with version 2.0.
The checks designed for version 1.1 appear to apply, so accept v 2.0
and apply the usual checks.

11 years agoAllowed SACLs to to not have any ACE
Jean-Pierre André [Wed, 12 Sep 2012 07:36:21 +0000 (09:36 +0200)]
Allowed SACLs to to not have any ACE

Accept security descriptors in which the SACL is present though it does not
contain any ACE. Such security descriptors have been found in Windows
installation files.

11 years agoAdded an option to secaudit for getting a user mapping proposal
Jean-Pierre André [Wed, 12 Sep 2012 07:31:35 +0000 (09:31 +0200)]
Added an option to secaudit for getting a user mapping proposal

Get a user mapping proposal by designating a file created on Windows
by the user to be mapped to the current one on Linux.
This is expected to be easier to use than "usermap".

11 years agontfsinfo.c: Fix printing all the flags in hex in 'ntfs_dump_flags'.
Erik Larsson [Mon, 27 Aug 2012 19:26:57 +0000 (21:26 +0200)]
ntfsinfo.c: Fix printing all the flags in hex in 'ntfs_dump_flags'.

The variable 'flags' was modified along the way and did not contain the
original flags at the end as assumed by the last printout. Fixed by
storing the original state of the flags in a temporary const variable.

11 years agoAllowed commas within option fsname on OpenIndiana
Jean-Pierre André [Wed, 22 Aug 2012 09:08:20 +0000 (11:08 +0200)]
Allowed commas within option fsname on OpenIndiana

On OpenIndiana, the device names have commas in them. Do not interpret
commas as option separators within the option fsname. As a consequence
this option has to be the last one.

11 years agoMerged libfuse for OpenIndiana into libfuse-lite
Jean-Pierre André [Wed, 22 Aug 2012 09:02:36 +0000 (11:02 +0200)]
Merged libfuse for OpenIndiana into libfuse-lite

The libfuse used by OpenIndiana has the same features as libfuse-lite
though requiring some code variants. Merging them simplifies supporting
both.

Variants for OpenIndiana are selected when defining __SOLARIS__

11 years agoFixed the returned files types in readdir()
Jean-Pierre André [Mon, 20 Aug 2012 12:34:16 +0000 (14:34 +0200)]
Fixed the returned files types in readdir()

The type of special files (symlinks, fifos, etc.) was not returned in
readdir() and they appeared wrongly in the field d_type of "struct dirent".
This prevented some applications which relied on d_type (which does
not exist in Solaris) from navigating in an NTFS tree.

11 years agoFixed Windows-type inheritance for creator-owner ACE
Jean-Pierre André [Mon, 20 Aug 2012 12:29:51 +0000 (14:29 +0200)]
Fixed Windows-type inheritance for creator-owner ACE

Inheriting a creator-owner ACE the Windows way led to a buggy ACL

11 years agoRestored interpreting UTIME_NOW and UTIME_OMIT from external fuse >= 2.9
Jean-Pierre André [Mon, 20 Aug 2012 12:24:49 +0000 (14:24 +0200)]
Restored interpreting UTIME_NOW and UTIME_OMIT from external fuse >= 2.9

Use of UTIME_NOW and UTIME_OMIT had been temporarily removed when using
external fuse, because early versions of external fuse 2.9 did not
support them. They can now be restored as they are supported by released
versions of fuse 2.9

11 years agoMade secaudit to be runnable on OpenIndiana
Jean-Pierre André [Mon, 20 Aug 2012 12:22:10 +0000 (14:22 +0200)]
Made secaudit to be runnable on OpenIndiana

A few differences in dynamic linking.

11 years agoChanged "blocks" to "sectors" in the mkntfs manual
Jean-Pierre André [Mon, 20 Aug 2012 12:17:09 +0000 (14:17 +0200)]
Changed "blocks" to "sectors" in the mkntfs manual

The last (optional) argument in mkntfs was described as a block count,
which may be confusing because in ext[123] a block means a cluster.

11 years agoInserted in the manual an explanation for the $Info stream in $UpCase
Jean-Pierre André [Mon, 20 Aug 2012 12:14:15 +0000 (14:14 +0200)]
Inserted in the manual an explanation for the $Info stream in $UpCase

11 years agoInserted an $Info stream in $UpCase to comply with Windows 8
Jean-Pierre André [Mon, 20 Aug 2012 12:01:53 +0000 (14:01 +0200)]
Inserted an $Info stream in $UpCase to comply with Windows 8

Since Windows 8 a new stream is added to the upper case file to record
a CRC of the upper case data. This way, if the file does not match the
one defined on the current Windows system, chkdsk can tell whether the
file is damaged or just out of date, and an error is only displayed if
the file is damaged.

The $Info data has been checked to be ignored by Windows XP, Windows
Vista and Windows 7. If not present, chkdsk for Windows 8 complains about
a wrong upper case file.

11 years agoFixed the computation of named attributes sizes in mkntfs
Jean-Pierre André [Mon, 20 Aug 2012 11:57:00 +0000 (13:57 +0200)]
Fixed the computation of named attributes sizes in mkntfs

The named attributes sizes were wrongly computed in mkntfs. This did not
lead to visible errors so far owing to 8-byte alignments in attribute
records (current names $SDS, $R, $O, etc).

11 years agoCosmetic : avoided having a hardcoded knowledge of upcase table size in mkntfs
Jean-Pierre André [Mon, 20 Aug 2012 11:53:48 +0000 (13:53 +0200)]
Cosmetic : avoided having a hardcoded knowledge of upcase table size in mkntfs

11 years agoAvoided an unnecessary runlist update when appending data to a file
Jean-Pierre André [Mon, 20 Aug 2012 11:48:49 +0000 (13:48 +0200)]
Avoided an unnecessary runlist update when appending data to a file

Appending data to a file is done in two steps : first extending the
file to the required size, then inserting data in the created space.
There is no need to recompute the runlist at the end of the first
step, just be sure the original configuration is rolled back if inserting
data leads to an error.

11 years agoFixed displaying progress percentage for metadata images
Jean-Pierre André [Mon, 20 Aug 2012 11:44:33 +0000 (13:44 +0200)]
Fixed displaying progress percentage for metadata images

When building (options -ms) or restoring a metadata image, the progress
percentages were wrong (evaluated against a wrong base)

11 years agoIgnored permissions when listing xattrs for special files
Jean-Pierre André [Mon, 20 Aug 2012 10:45:21 +0000 (12:45 +0200)]
Ignored permissions when listing xattrs for special files

Special files (FIFOs, SOCKETs, etc.) are not allowed to have user extended
attributes. When listing their extended attributes, return none without
checking whether the calling process is allowed to access these files.

11 years agoExtended Windows-type ACL inheritance, as needed by Windows 8
Jean-Pierre André [Mon, 20 Aug 2012 10:36:45 +0000 (12:36 +0200)]
Extended Windows-type ACL inheritance, as needed by Windows 8

Windows 8 uses "Authenticated user" principals which needs to be replaced
by the actual owner when inheriting

11 years agoProcessed ACLs with no mentioned rights for owner (used by Windows8)
Jean-Pierre André [Mon, 20 Aug 2012 10:28:15 +0000 (12:28 +0200)]
Processed ACLs with no mentioned rights for owner (used by Windows8)

Windows 8 uses ACL patterns in which the owner has only implicit rights
(pattern not used by previous Windows versions)

12 years agoFixed the fixing of the backup boot sector in ntfsfix
Jean-Pierre André [Fri, 6 Jul 2012 07:56:50 +0000 (09:56 +0200)]
Fixed the fixing of the backup boot sector in ntfsfix

ntfsfix now checks and update the backup boot sector on the last sector of
the partition (instead of the sector next to end of the file system). After
an ntfsresize the file system generally does not use the maximum size because
of different roundings and required alignments in the resizing and the
repartitioning.

12 years agoProcessed junctions and symlinks whose target references another one
Jean-Pierre André [Fri, 6 Jul 2012 07:48:05 +0000 (09:48 +0200)]
Processed junctions and symlinks whose target references another one

When the target of a junction or a Windows-type symlink references another
junction or symlink, the search for the full path on the current partition
and its translation for case-sensitive access is interrupted. The target can
now be dereferenced, provided the end of the path needed no translation.

12 years agoExtended the wiping of file tails to all data attributes in ntfswipe
Jean-Pierre André [Mon, 18 Jun 2012 11:00:17 +0000 (13:00 +0200)]
Extended the wiping of file tails to all data attributes in ntfswipe

This patch adds the wiping of the tails of named data attributes to
ntfswipe.

12 years agoAdded processing of SACLs to secaudit on Windows (nickgarvey)
Jean-Pierre André [Mon, 18 Jun 2012 10:57:40 +0000 (12:57 +0200)]
Added processing of SACLs to secaudit on Windows (nickgarvey)

This patch adds the processing of SACLs to secaudit on Windows, but
requested the required privileges.

12 years agoAdded inheritance of the set-group-id flag
Jean-Pierre André [Mon, 18 Jun 2012 10:53:25 +0000 (12:53 +0200)]
Added inheritance of the set-group-id flag

So far the set-group-id flag could be set in a chmod. This patch enables
the inheritance of the group to files and subdirectories, and the
inheritance of the set-group-id flag to subdirectories.

12 years agoRemoved the suggestions to use option remove_hiberfile
Jean-Pierre André [Mon, 18 Jun 2012 10:46:21 +0000 (12:46 +0200)]
Removed the suggestions to use option remove_hiberfile

The suggestion to use option remove_hiberfile was displayed in the
standard help and when a volume is found dirty. As this option may
lead to loss of data, only mention it in the manual, with a proper
warning.

12 years agoAdded optional wiping of file tails and undelete data to ntfswipe (Bogdan)
Jean-Pierre André [Mon, 18 Jun 2012 10:41:51 +0000 (12:41 +0200)]
Added optional wiping of file tails and undelete data to ntfswipe (Bogdan)

Added more wiping options to ntfswipe (to avoid leaking of deleted data).

12 years agoAdded an optional argument (number of seconds) to the option delay_mtime
Jean-Pierre André [Mon, 18 Jun 2012 10:34:56 +0000 (12:34 +0200)]
Added an optional argument (number of seconds) to the option delay_mtime

The option delay_mtime avoid updating the mtime of a file after each
individual updating. With this patch, the frequency of the update can
be adjusted to needs (default 60s). This is mainly useful for big files
which are kept open for a long period (file system images, virtual
computers, etc.)

12 years agoProcessed ACL inheritance for authenticated users
Jean-Pierre André [Mon, 18 Jun 2012 10:27:38 +0000 (12:27 +0200)]
Processed ACL inheritance for authenticated users

Under some conditions, Windows defines an ACL inheritance for an
unidentified authenticated user. With this patch, such an unidentified
user is treated as any user (same as "world").

12 years agoFixed a wrong computation of ACL size (minor issue)
Jean-Pierre André [Mon, 18 Jun 2012 10:26:36 +0000 (12:26 +0200)]
Fixed a wrong computation of ACL size (minor issue)

12 years agoAdded allocation data to output of "ntfsinfo -m"
Jean-Pierre André [Mon, 18 Jun 2012 10:19:27 +0000 (12:19 +0200)]
Added allocation data to output of "ntfsinfo -m"

Volume state and the level of allocation were added to the output
of "ntfsinfo -m", they are useful to identify the state of a volume.

12 years agoImplemented the fixing of the backup boot sector in ntfsfix
Jean-Pierre André [Wed, 21 Mar 2012 18:35:30 +0000 (19:35 +0100)]
Implemented the fixing of the backup boot sector in ntfsfix

This checks the backup boot sector and fixes it as needed.

12 years agoAvoided interpreting UTIME_NOW and UTIME_OMIT from external fuse
Jean-Pierre André [Wed, 21 Mar 2012 18:26:00 +0000 (19:26 +0100)]
Avoided interpreting UTIME_NOW and UTIME_OMIT from external fuse

UTIME_NOW and UTIME_OMIT are needed for implementing utimensat() and
futimens(2), but they cannot yet be used with external fuse.
This patch is to avoid errors if they cannot be used, even with fuse 4.9

12 years agoSet the hidden flag according to the latest name when hide_dot_files is set
Jean-Pierre André [Wed, 21 Mar 2012 18:19:39 +0000 (19:19 +0100)]
Set the hidden flag according to the latest name when hide_dot_files is set

When the hide_dot_files option is set, a file is marked hidden if the
first character in its name is a dot. This patch updates the hidden flag
when the file is renamed or hard linked (useful for text editors which
create files with a temporary name)

12 years agoKept the name of a deleted file in place for easier undeletion
Jean-Pierre André [Wed, 21 Mar 2012 18:14:03 +0000 (19:14 +0100)]
Kept the name of a deleted file in place for easier undeletion

When a file is deleted, there is no need to remove its last name in
the deleted MFT record. The name may be useful for undeleting the file
later (Windows also does not delete the name).

12 years agoCosmetic : moved the basename(3) redefinition to a better location
Jean-Pierre André [Wed, 21 Mar 2012 18:09:52 +0000 (19:09 +0100)]
Cosmetic : moved the basename(3) redefinition to a better location

basename(3) is not available on OpenIndiana and had to be redefined.
Just move the redefinition to a more standard location

12 years agoImplemented the check for already mounted device on OpenIndiana
Jean-Pierre André [Wed, 21 Mar 2012 18:01:33 +0000 (19:01 +0100)]
Implemented the check for already mounted device on OpenIndiana

This adds a variant for checking on OpenIndiana whether a device
is mentioned in /etc/mnttab as being mounted.

12 years agoReverted the workaround for ftruncate() and access(W_OK) on OpenIndiana
Jean-Pierre André [Wed, 21 Mar 2012 17:56:05 +0000 (18:56 +0100)]
Reverted the workaround for ftruncate() and access(W_OK) on OpenIndiana

The special tests for accepting ftruncate(2) and access(W_OK) applied
to a file being created read-only have been implemented in the fuse
kernel module, so there is no need to duplicate them in the file system.

12 years agoAvoided setuid/setgid removal by chown on OpenIndiana
Jean-Pierre André [Wed, 21 Mar 2012 17:52:07 +0000 (18:52 +0100)]
Avoided setuid/setgid removal by chown on OpenIndiana

On OpenIndiana, it is not customary to remove the setuid/setgid flags
when doing a chown, so comply with the local rules.

12 years agoMade sure directories are not hard linked
Jean-Pierre André [Wed, 21 Mar 2012 17:48:38 +0000 (18:48 +0100)]
Made sure directories are not hard linked

On OpenIndiana the fuse kernel module does not prevent link(2) from
hard linking directories, so this has to be done in the lowntfs-3g
driver.

12 years agoMade sure rmdir is only used for directories, and unlink otherwise
Jean-Pierre André [Wed, 21 Mar 2012 17:42:29 +0000 (18:42 +0100)]
Made sure rmdir is only used for directories, and unlink otherwise

On OpenIndiana the fuse kernel module does not prevent unlink(2)
from deleting directories, nor prevent rmdir(2) from deleting files,
so this has to be done in the lowntfs-3g driver.

12 years agoImplemented supplementary group checks for OpenIndiana
Jean-Pierre André [Wed, 21 Mar 2012 17:34:48 +0000 (18:34 +0100)]
Implemented supplementary group checks for OpenIndiana

Checking supplementary groups permissions to access a file relies on
a supplementary group list available in /proc/PID. This patch adds a
variant to implement the checks based on the specific format used
by OpenIndiana.

12 years agoImplemented an option to set a new serial number in ntfslabel
Jean-Pierre André [Mon, 23 Jan 2012 17:22:59 +0000 (18:22 +0100)]
Implemented an option to set a new serial number in ntfslabel

Defined new options --new-serial and --new-half-serial to set a new
serial number (either the given one or a random one) to a file system.
Useful for mounting the original and the cloned file system at the
same time.

12 years agoImplemented an option to set a new serial number in ntfsclone
Jean-Pierre André [Mon, 23 Jan 2012 17:19:17 +0000 (18:19 +0100)]
Implemented an option to set a new serial number in ntfsclone

Defined new options --new-serial and --new-half-serial to set a new
random serial number when cloning or restoring a file system.
Useful for mounting the original and the cloned file system at the
same time.

12 years agoFixed clearing user data when creating metadata images
Jean-Pierre André [Mon, 23 Jan 2012 17:13:59 +0000 (18:13 +0100)]
Fixed clearing user data when creating metadata images

Clearing of user data was wrong when extracting the metadata into a
special format image. In this situation the clearing has to be done
without mounting the file system.

12 years agoImplemented a new option -q to avoid updating the progress information (Matthew Boyle)
Jean-Pierre André [Mon, 23 Jan 2012 17:10:26 +0000 (18:10 +0100)]
Implemented a new option -q to avoid updating the progress information (Matthew Boyle)

The progress bars complexify the integration of ntfsclone into other
tools, the option -q (or --quiet) gets rid of them.

12 years agoFixed debug check for double opening after deleting an inode
Jean-Pierre André [Mon, 23 Jan 2012 17:05:27 +0000 (18:05 +0100)]
Fixed debug check for double opening after deleting an inode

A debug check could be defeated when a deleted inode number was reused.

12 years agoWorked around basename(3) not present on OpenIndiana
Jean-Pierre André [Mon, 23 Jan 2012 17:03:59 +0000 (18:03 +0100)]
Worked around basename(3) not present on OpenIndiana

12 years agoPut the device name as the last option
Jean-Pierre André [Mon, 23 Jan 2012 17:00:18 +0000 (18:00 +0100)]
Put the device name as the last option

On OpenIndiana the device names have commas, so put it as the last option
to prevent defeating the options parsing.

12 years agoMounted with an absolute mount point on OpenIndiana
Jean-Pierre André [Mon, 23 Jan 2012 16:56:15 +0000 (17:56 +0100)]
Mounted with an absolute mount point on OpenIndiana

OpenIndiana requires that the mount points be defined on a full
absolute patch. Give it what it needs.

12 years agoWorked around write checks for ftruncate() and access(W_OK) on OpenIndiana
Jean-Pierre André [Mon, 23 Jan 2012 16:49:38 +0000 (17:49 +0100)]
Worked around write checks for ftruncate() and access(W_OK) on OpenIndiana

When a file is created with no write permissions, ftruncate and
access(W_OK) should be allowed, but this check has to be made by the
file system on OpenIndiana.
This patch is not active on Linux (#ifdef'ed)

12 years agoStrengthened sanity checks on readdir/closedir
Jean-Pierre André [Mon, 23 Jan 2012 16:45:12 +0000 (17:45 +0100)]
Strengthened sanity checks on readdir/closedir

Be more defensive against readdir() on closed directories.

12 years agoPreferred access control by file system on OpenIndiana
Jean-Pierre André [Mon, 23 Jan 2012 16:39:47 +0000 (17:39 +0100)]
Preferred access control by file system on OpenIndiana

ntfs-3g cannot reliably use the access control made by the kernel on
OpenIndiana, so do it at the file system level until this is solved.

12 years agoReturned unmount errors in ntfs-3g.probe (Diego Elio Petteno)
Jean-Pierre André [Mon, 23 Jan 2012 16:34:19 +0000 (17:34 +0100)]
Returned unmount errors in ntfs-3g.probe (Diego Elio Petteno)

ntfs-3g.probe is used to get information about mounting errors, this
extends the use for unmounting errors.

12 years agoAccepted multiple read-only mounts
Jean-Pierre André [Mon, 23 Jan 2012 16:31:15 +0000 (17:31 +0100)]
Accepted multiple read-only mounts

Multiple mounts of a partition is now allowed provided they are all
in read-only mode.

12 years agochanged error return for user access to trusted xattr
Jean-Pierre André [Mon, 23 Jan 2012 16:25:55 +0000 (17:25 +0100)]
changed error return for user access to trusted xattr

When a user queries an extended attribute in the trusted namespace,
the traditional error return was EPERM. This has been recently changed
to ENODATA. See https://lkml.org/lkml/2011/5/27/199

12 years agooutput the numbers of runs and fragments in ntfsinfo
Jean-Pierre André [Mon, 23 Jan 2012 16:20:20 +0000 (17:20 +0100)]
output the numbers of runs and fragments in ntfsinfo

It is difficult to identify whether a file from a user complaining about
bad throughput is over-fragmented, so get the information from ntfsinfo.

12 years agofixed checking whether Windows 7 was hibernated
Jean-Pierre André [Mon, 23 Jan 2012 16:16:07 +0000 (17:16 +0100)]
fixed checking whether Windows 7 was hibernated

On Windows XP and Vista, the system hibernation is identified by the
sequence "hibr" at the beginning of hiberfil.sys. This had been changed
to "HIBR" in Windows 7, so both sequences have to be accepted as
hibernation criteria.

12 years agofixed clearing the end of extents when extracting metadata
Jean-Pierre André [Mon, 23 Jan 2012 16:11:46 +0000 (17:11 +0100)]
fixed clearing the end of extents when extracting metadata

When extracting the metadata, unused data at the end of MFT records is
supposed to be cleared. This was done for the base record of each file,
but not for the extent records.

12 years agoCosmetic : fixed an indentation in unistr
Jean-Pierre André [Mon, 23 Jan 2012 16:09:19 +0000 (17:09 +0100)]
Cosmetic : fixed an indentation in unistr

12 years agoFixed clearing the bad cluster list in ntfsfix
Jean-Pierre André [Mon, 23 Jan 2012 15:59:49 +0000 (16:59 +0100)]
Fixed clearing the bad cluster list in ntfsfix

Clearing the bad cluster list was done by truncating $BadClus:$Bad,
this turned out not to be reliable because chkdsk does not adjust
the size of $BadClus:$Bad when declaring a cluster bad.

12 years agoAllowed building for kfreebsd (Robert Millan)
Jean-Pierre André [Mon, 23 Jan 2012 15:55:04 +0000 (16:55 +0100)]
Allowed building for kfreebsd (Robert Millan)

Extended several #ifdef's to account for "FreeBSD kernel"

12 years agoUsed ENOENT instead of ENODATA when the latter is not defined (Robert Millan)
Jean-Pierre André [Mon, 23 Jan 2012 15:50:25 +0000 (16:50 +0100)]
Used ENOENT instead of ENODATA when the latter is not defined (Robert Millan)

ENODATA is not defined by Posix and is lacking on FreeBSD

12 years agoVersion 2012.1.15
Szabolcs Szakacsits [Sun, 15 Jan 2012 13:21:52 +0000 (15:21 +0200)]
Version 2012.1.15

12 years agoPrefix all functions and macros in ntfsprogs/list.h with 'ntfs_/NTFS_'.
Erik Larsson [Wed, 11 Jan 2012 10:44:09 +0000 (11:44 +0100)]
Prefix all functions and macros in ntfsprogs/list.h with 'ntfs_/NTFS_'.

This avoids name collisions with Mac OS X system headers (specifically
/usr/include/sys/queue.h). It's quite possible that other operating
systems also have similarly named macros in their system headers since
the function/macro names are very generic.

12 years agontfswipe.c: Deduplicated MFT write code in wipe_mft.
Erik Larsson [Mon, 9 Jan 2012 11:57:26 +0000 (12:57 +0100)]
ntfswipe.c: Deduplicated MFT write code in wipe_mft.

12 years agontfswipe.c: Code cleanup.
Erik Larsson [Mon, 9 Jan 2012 03:48:21 +0000 (04:48 +0100)]
ntfswipe.c: Code cleanup.

Changed the code to use the structs in layout.h instead of addressing
byte addresses directly. This makes the code a lot more readable.

12 years agontfswipe.c: Big endian fix for wipe_mft.
Erik Larsson [Mon, 9 Jan 2012 02:54:11 +0000 (03:54 +0100)]
ntfswipe.c: Big endian fix for wipe_mft.

The 'bytes_in_use' member was not byteswapped after being read from the
buffer and used in a calculation.