OSDN Git Service
Jean-Pierre André [Wed, 6 Apr 2016 07:27:07 +0000 (09:27 +0200)]
Added clarification about creating a partition to the ntfsclone manual
Try to make clear the option --output feeds data into a partition, but
does not create the partition.
Jean-Pierre André [Wed, 6 Apr 2016 07:10:35 +0000 (09:10 +0200)]
Used plugins to process reparse points
The new "system compression" files used by Windows 10 make use of reparse
points to record the compression parameters, and a specific named data
stream is used to store the compressed data. With this patch, processing
of reparse points can be done by an external plugin only loaded as needed.
Junctions and symlinks, which are also based on reparse points, are now
processed by "internal plugins".
Jean-Pierre André [Wed, 6 Apr 2016 06:51:36 +0000 (08:51 +0200)]
Added an option for preserving the full log file in ntfsclone
Usually, only a few pages of the Windows log file are saved in an
ntfsclone image. This is inappropriate for building reference images
for recovering the log, and the --full-logfile option serves that
purpose.
Jean-Pierre André [Wed, 6 Apr 2016 06:44:38 +0000 (08:44 +0200)]
Reworked decisions to undo related to unreadable records
When an INDX or MFT record could not be read while undoing the creation
of this record, there is nothing to do. However if this was undoing the
deletion of the last entry in an index, a new void index block has to be
created.
Jean-Pierre André [Mon, 22 Feb 2016 07:28:50 +0000 (08:28 +0100)]
Version 2016.2.22
Erik Larsson [Tue, 16 Feb 2016 19:43:00 +0000 (20:43 +0100)]
Fix compilation errors on OpenIndiana caused by missing limit macros.
Erik Larsson [Tue, 16 Feb 2016 19:29:56 +0000 (20:29 +0100)]
endians.h: Fix bad assumption of valid __BYTE_ORDER__ values.
On the OpenIndiana Hipster distribution, compiling with GCC 4.9 would
fail because __BYTE_ORDER__ was defined but not to any of the values
assumed to be associated with this define (__LITTLE_ENDIAN__ or
__BIG_ENDIAN__). Instead it was defined to either
__ORDER_LITTLE_ENDIAN__ or __ORDER_BIG_ENDIAN__. This caused
compilation to fail.
Fixed by checking that all referenced defines are in fact defined
before using them and adding an additional #elif clause for this newly
discovered condition.
Erik Larsson [Tue, 16 Feb 2016 08:38:12 +0000 (09:38 +0100)]
ntfsrecover.c: Fix compiler warning about uninitialized 'savebuf' usage.
The previous fix for the warning referred to 'prevbuf' being used
uninitialized and this is also what the compiler says. However
initializing 'prevbuf' doesn't make the warning go away and further
testing revealed that it is really 'savebuf' being possibly used prior
to initialization that is the source of the warning (the incorrect
warning message is probably an optimization-related gcc bug). So replace
previous ineffective fix with explicit initialization of 'savebuf'.
Erik Larsson [Tue, 16 Feb 2016 08:30:49 +0000 (09:30 +0100)]
Fix compiler warnings about mismatching printf format / argument type.
For 64-bit (e.g. x86_64) Linux the 64-bit wide types resolve to long,
not long long as is the case in 32-bit (e.g. i386) Linux. So we need an
explicit cast to long long for 64-bit types since the format string must
specify the 'll' modifier in order to print 64-bit values.
Jean-Pierre André [Mon, 15 Feb 2016 15:32:03 +0000 (16:32 +0100)]
Version 2016.2.15
Jean-Pierre André [Mon, 15 Feb 2016 11:07:28 +0000 (12:07 +0100)]
Silenced a compiler warning for possibly uninitialized pointer
Some compilers issue a warning when a pointer is initialized in
both alternatives of a condition. Force an extra initialization
to avoid such warnings.
Jean-Pierre André [Mon, 15 Feb 2016 11:02:10 +0000 (12:02 +0100)]
Silenced a compiler warning for different types
Some compilers issue a warning when the alternatives in a "? :"
expression have different signedness.
Jean-Pierre André [Mon, 15 Feb 2016 10:54:33 +0000 (11:54 +0100)]
Avoided pointer cast when checking record types
Some compilers issue warning when casting a pointer to a pointer to
a different type.
When checking a record magic, there is no need to cast pointers.
Jean-Pierre André [Fri, 12 Feb 2016 16:24:27 +0000 (17:24 +0100)]
Updated the drivers copyrights
Extend the copyright to 2016
Jean-Pierre André [Fri, 12 Feb 2016 16:13:21 +0000 (17:13 +0100)]
Closed the volume when a resizing is done
Closing the volume is the way to sync the MFT to disk. When not doing
so, the MFT runlists in $DATA and $Bitmap are not synced if they have
been updated in the second resizing stage relative to runlists which
have grown outside their original MFT record.
Jean-Pierre André [Fri, 12 Feb 2016 16:03:53 +0000 (17:03 +0100)]
Closed the bad sector inode after updating the list
Unlike in most cases, the bad sector inode has to be closed if it
was updated and required MFT extents (when there are a lot of bad
sectors and some of them were outside the truncated partition).
Not doing so causes the inode to not be fully synced to device.
Erik Larsson [Thu, 11 Feb 2016 13:19:41 +0000 (14:19 +0100)]
endians.h: Cast the result of const endianness macros to the right type.
This fixes compiler warnings emitted when you compare an le32 value with
e.g. 'const_cpu_to_le32(-1)' on a little-endian system, because
previously the expansion of the macro expression 'const_cpu_to_le32(-1)'
would be '(-1)' on a little-endian system but '(u32)((((u32)(-1) &
0xff000000u) >> 24) | (((u32)(-1) & 0x00ff0000u) >> 8) | (((u32)(-1) &
0x0000ff00u) << 8) | (((u32)(-1) & 0x000000ffu) << 24))' on a
big-endian system, i.e. the type of the expanded expression would be
'int' (signed) in the little-endian case but 'u32' (unsigned) in the
big-endian case.
With this commit the type of the expanded expression will be 'le32' in
both the little-endian and the big-endian case.
Erik Larsson [Thu, 11 Feb 2016 13:06:53 +0000 (14:06 +0100)]
ntfs-3g_common.h: Fix improper type for 'dmtime' in ntfs_fuse_context_t.
This field is always assigned a signed value, and compared to other
signed values (ntfs_time values are signed little-endian 32-bit
integers).
This fixes two compiler warnings about signed/unsigned comparison.
Erik Larsson [Thu, 11 Feb 2016 12:52:59 +0000 (13:52 +0100)]
mft.c: Fix compiler warning about mismatching format/argument type.
The expression is promoted to 'int' implicitly so we explicitly cast it
to 'u8'.
Erik Larsson [Mon, 8 Feb 2016 17:42:53 +0000 (18:42 +0100)]
efs.c: Fix incorrect type of local variables 'newsize' and 'oldsize'.
These variable are only ever assigned to/from s64 values, so their type
should be s64, not u64. This fixes a compiler warning about
signed/unsigned comparison.
Erik Larsson [Mon, 8 Feb 2016 17:32:24 +0000 (18:32 +0100)]
ntfslabel.c: Fix incorrect label buffer being NULL-terminated.
The UTF-16LE label buffer containing the result of mbs2ucs is the one
that should be NULL-terminated when the label is longer than permitted.
Not the input buffer, which is a function parameter assumed to be
NULL-terminated anyway.
Erik Larsson [Fri, 29 Jan 2016 11:36:06 +0000 (12:36 +0100)]
Change type of all LSN struct members in ntfsrecover.h to leLSN.
This is done to match the type of the LSN struct members in layout.h.
The effect of this change is that while these members were declared with
the le64 type previously, leLSN resolves to sle64. I.e. what was
previously unsigned fields are now signed.
Following this change we also need to switch over a few macros from
unsigned to signed versions in the code that uses these struct
definitions.
Erik Larsson [Fri, 29 Jan 2016 09:49:52 +0000 (10:49 +0100)]
playlog.c: Use const macro for byteswapping const expression.
Erik Larsson [Fri, 29 Jan 2016 09:49:25 +0000 (10:49 +0100)]
playlog.c: Fix improper byteswapping macros used for sle64 members.
Erik Larsson [Thu, 28 Jan 2016 08:22:42 +0000 (09:22 +0100)]
Merge endianness fixes.
Conflicts:
libntfs-3g/attrib.c
Erik Larsson [Thu, 28 Jan 2016 08:11:55 +0000 (09:11 +0100)]
ntfscmp.c: Fix missing byteswap of little-endian attribute type value.
Erik Larsson [Wed, 27 Jan 2016 14:28:55 +0000 (15:28 +0100)]
ntfsmove.c: Fix multiple cases of raw usage of little-endian fields.
There were multiple cases of little-endian fields being used as
CPU-endian without byte swapping. This would result in incorrect
behaviour on big-endian systems.
Erik Larsson [Wed, 27 Jan 2016 14:26:51 +0000 (15:26 +0100)]
ntfsdump_logfile.c: Fix use of wrong byteswapping macro for le16 field.
Erik Larsson [Wed, 27 Jan 2016 14:24:52 +0000 (15:24 +0100)]
ntfsdump_logfile.c: Fix incorrectly parenthesized expression.
On big-endian systems the result of the '!=' operation would be
endian-swapped rather than the first argument (which must have been the
intended action).
Erik Larsson [Wed, 27 Jan 2016 14:23:13 +0000 (15:23 +0100)]
ntfsck.c: Fix comparing le32 values as u32.
This is harmless except when we do strict endianness checking, in which
case this results in a compile error. Fixed by converting values to
CPU endianness before comparing them.
Erik Larsson [Wed, 27 Jan 2016 14:21:05 +0000 (15:21 +0100)]
ntfsck.c: Fix comparison between little-endian and native-endian data.
This comparison would yield the wrong result on big-endian systems.
Erik Larsson [Tue, 26 Jan 2016 09:28:38 +0000 (10:28 +0100)]
ntfstruncate.c: Fix mixed endianness usage of variable 'i'.
In 'dump_resident_attr_val', 'i' was sometimes used as a native-endian
'int'-precision string length value and sometimes used as a little-
endian 16-bit flags value. This type of mixed usage is bad practice and
results in a hard error when strict endianness checking is used.
Fixed by introducing new variable 'flags' to hold the little-endian 16-
bit flags value.
Erik Larsson [Tue, 26 Jan 2016 09:19:44 +0000 (10:19 +0100)]
ntfstruncate.c: Fix incorrect type for CPU-endian value in 'ucstos'.
Erik Larsson [Tue, 26 Jan 2016 09:18:51 +0000 (10:18 +0100)]
ntfstruncate.c: Fix conflicting endianness for variable 'attr_type'.
If the attribute type is specified by the user, 'attr_type' was assigned
a CPU-endian value, however if the attribute type was not specified it
would be assigned the attribute type AT_DATA, which is a little-endian
value. The rest of the code seems to assume that 'attr_type' is
CPU-endian, so this is clearly a bug.
Resolved by fixing the endianness of the variable at little-endian,
converting the input value to little-endian when specified.
Erik Larsson [Tue, 26 Jan 2016 09:03:36 +0000 (10:03 +0100)]
ntfstruncate.c: Fix mixed endianness usage of variable 'u'.
In 'dump_attr_record' the variable 'u' was first used to store a
CPU-endian 32-bit value, and then to store a 16-bit little-endian value.
This is bad practice and results in a hard error when strict endian type
checking is used.
Fixed by storing the 16-bit little-endian flags value in a new variable
'flags'.
Erik Larsson [Tue, 26 Jan 2016 06:55:45 +0000 (07:55 +0100)]
ntfs-3g.c: Fix raw usage of inode time fields without byteswapping.
Erik Larsson [Mon, 25 Jan 2016 10:31:12 +0000 (11:31 +0100)]
volume.c: Fix passing bad pointer type to ntfs_is_[baad|mft]_recordp.
Erik Larsson [Mon, 25 Jan 2016 10:30:13 +0000 (11:30 +0100)]
mst.c: Fix mixed native/little-endian usage of variable 'usn'.
Erik Larsson [Mon, 4 Jan 2016 09:19:05 +0000 (10:19 +0100)]
reparse.c: Fix big-endian bug when converting file name to lowercase.
When looking up the lowercase equivalent of a Unicode character in
ntfs_fix_file_name, no byte swapping was performed on the ntfschar used
as index into the 'locase' array. This would lead to very strange
results on big-endian systems.
Erik Larsson [Mon, 4 Jan 2016 09:08:15 +0000 (10:08 +0100)]
Fix inverted usage of endian conversion macros.
This is mostly a semantic issue since the end result would be the same.
Erik Larsson [Mon, 21 Dec 2015 22:55:31 +0000 (23:55 +0100)]
Fix incorrect usage of native/little-endian types, signed types, etc.
This is harmless with regard to code generation but if we turn on strict
type checking these type mismatches will result in errors.
Erik Larsson [Mon, 21 Dec 2015 22:31:09 +0000 (23:31 +0100)]
Fix endianness issues in log and terminal output.
This commit addresses issues where little-endian variables are emitted
raw to a log or output stream which is to be interpreted by the user.
Outputting data in non-native endianness can cause confusion for anybody
attempting to debug issues with a file system.
Erik Larsson [Mon, 21 Dec 2015 22:21:00 +0000 (23:21 +0100)]
Fix code to use const_cpu_to_X/const_X_to_cpu macros for constants.
This enables the compiler to optimize this code in cases where compiler
support for endianness swapping is not present.
Erik Larsson [Mon, 21 Dec 2015 22:05:36 +0000 (23:05 +0100)]
endians.h: Add const endian conversion macros for s{l,b}e{16,32,64}.
Jean-Pierre André [Tue, 1 Dec 2015 10:12:53 +0000 (11:12 +0100)]
Fixed accessing next log buffer only when it exists
Do not locate the next log buffer until it is known to exist.
Jean-Pierre André [Tue, 1 Dec 2015 10:10:48 +0000 (11:10 +0100)]
Fixed reporting action states when restart page appears outdated
If start buffer is more recent than restart, we update committed LSN
with last record LSN of block (last_end_lsn) while applying action but
forget about it while printing records with -f for investigation
purpose.
Note that while applying actions we use start_buffer to calculate
latest page out of block 2 and block 3 and then from latest take
committed LSN. For -f we don't need buffers so we just compare
directly with committed LSN from restart.
(contributed by Rakesh Pandit)
Jean-Pierre André [Tue, 1 Dec 2015 10:06:11 +0000 (11:06 +0100)]
Rejected invalid null reparse tag
The null reparse tag is considered invalid by Windows, so do the same.
Jean-Pierre André [Tue, 1 Dec 2015 10:00:24 +0000 (11:00 +0100)]
Fixed returning the trimming count to fstrim(8)
When used with the option -v, fstrim(8) reported the maximum trimming count
because the correct value was not returned to the ioctl call.
Jean-Pierre André [Tue, 1 Dec 2015 09:56:01 +0000 (10:56 +0100)]
Defined reparse tag for system compression
The new compression formats used by Windows 10 uses reparse data, and
a new reparse tag which it is useful to define even though these formats
is not yet supported by ntfs-3g.
Jean-Pierre André [Fri, 20 Nov 2015 15:17:48 +0000 (16:17 +0100)]
Fixed special case of decompressing a runlist
When the unreadable directory has an ATTRIBUTE_LIST attribute and an
INDEX_ALLOCATION attribute occupying split over several extents, the first
of which defines a single cluster, the first INDEX_ALLOCATION extent has
lowest_vcn=0 and highest_vcn=0, and the second one has lowest_vcn=1.
This unusual case, which can be created by the combination of a small
volume and near-full MFT records, triggers some special-case behavior in
ntfs_mapping_pairs_decompress_i(). That behavior is incorrect if the
attribute's first extent only contains a single cluster, since in that case
highest_vcn=0 as well.
This configuration has been tested on Windows and it *is* able to
successfully read the directory. This supports the hypothesis that the
volume is valid and NTFS-3g has a bug on the read side.
This bug could, in theory, occur with any non-resident attribute, not just
INDEX_ALLOCATION attributes.
(Contributed by Eric Biggers)
Jean-Pierre André [Fri, 20 Nov 2015 15:14:16 +0000 (16:14 +0100)]
Fixed headers of log play functions in playlog
The functions were made static with a textual description.
Jean-Pierre André [Fri, 20 Nov 2015 15:11:15 +0000 (16:11 +0100)]
Fixed missing error return in playlog
No error was returned from reading a protected record which is part of
an unreadable raw cluster.
Jean-Pierre André [Fri, 20 Nov 2015 15:04:47 +0000 (16:04 +0100)]
Fixed truncating an extended bad cluster list in ntfsresize
This fixes the case where the original bad cluster list requires extents.
The list is processed globally, no relocation is done, and the list is
truncated, possibly fitting into fewer extents.
Jean-Pierre André [Thu, 12 Nov 2015 14:46:33 +0000 (15:46 +0100)]
Removed obsolete code from playlog
The code for dealing with new MFT records had been made more general
Jean-Pierre André [Thu, 12 Nov 2015 14:44:47 +0000 (15:44 +0100)]
Subdivided the replay functions in playlog
Partially unnested play_redos() and play_undos()
Jean-Pierre André [Thu, 12 Nov 2015 14:41:44 +0000 (15:41 +0100)]
Fixed a memory leak in ntfsrecover
A buffer was left leaking memory in reset_logfile()
Jean-Pierre André [Thu, 12 Nov 2015 14:39:20 +0000 (15:39 +0100)]
Silenced a compiler warning (cosmetic)
An argument to ntfs_index_remove() is now unused
Jean-Pierre André [Thu, 12 Nov 2015 14:31:24 +0000 (15:31 +0100)]
Defined the last logfile block as preceding block 4 in ntfsrecover
When block 2 or block 3 points backward to block 4, it is not clear
whether the log file only consists of block 2 or block 3 or the log
file has just wrapped around. The latter is now assumed.
Jean-Pierre André [Mon, 9 Nov 2015 15:22:16 +0000 (16:22 +0100)]
Alleviated constraints relative to reparse points
Some constraints put on reparse points of unknown type (e.g. they cannot
be deleted) are not acceptable to archivers. This patch removes some
constraints.
Jean-Pierre André [Mon, 9 Nov 2015 15:16:39 +0000 (16:16 +0100)]
Decoded the full list of bad clusters in ntfsclone and ntfsresize
When the bad cluster list required extent, ntfsclone and ntfsresize
did not process the extents, leading to unexpected read errors and
unmatching bitmaps. This fix enables the full list to be taken into
account.
Jean-Pierre André [Mon, 9 Nov 2015 15:14:31 +0000 (16:14 +0100)]
Fixed reparse data check for non-Microsoft tags
Windows requires non-Microsoft reparse points (identified by having bit
31 of the reparse tag clear) to have a 16-byte GUID following the regular
reparse point header. This GUID is not, and cannot, be included in the
"reparse data length" field.
(Contributed by Eric Biggers)
Jean-Pierre André [Mon, 9 Nov 2015 15:09:52 +0000 (16:09 +0100)]
Fixed getting space for making an index non resident
Under some rare condition there is no space in an MFT entry to make
an index non-resident, and the index root has to be moved to an extent.
This fix cares for the situation when the attribute list was inserted
beforehand.
Jean-Pierre André [Mon, 9 Nov 2015 15:00:31 +0000 (16:00 +0100)]
Wrote as much data as possible in compressed attribute pwrite
When writing to compressed data, the function ntfs_attr_pwrite()
cannot cross a compression block border. This is a problem for archivers
which rely on libntfs-3g, so the function is now wrapped in another one
which restarts the writing as needed.
Jean-Pierre André [Mon, 9 Nov 2015 14:58:00 +0000 (15:58 +0100)]
Silenced a compiler warning in ntfswipe (cosmetic)
Avoid a signed-to-unsigned compare warning
Jean-Pierre André [Mon, 9 Nov 2015 14:44:33 +0000 (15:44 +0100)]
Fixed relocating the MFT runlists in ntfsresize
The MFT has two runlists which may be partially stored in extents.
When these runlists have to be relocated, the relocations must be done
after the old runlists are not needed any more to read the data of
standard files, but before the MFT may be needed to extend the runlists
of standard files. Before doing so the MFT runlists have to be refreshed
from device in order to collect the updates which cannot be done in
memory during the first stage.
Jean-Pierre André [Mon, 9 Nov 2015 12:18:58 +0000 (13:18 +0100)]
Implemented recovery of updates committed by Windows
ntfsrecover applies to the metadata the updates which were requested on
Windows but could not be completed because they were interrupted by
some event such as a power failure, a hardware crash, a software crash
or the device being unplugged. Doing so, the file system is restored
to the latest consistent state.
No update to libntfs-3g is required by this implementation.
Erik Larsson [Sat, 3 Oct 2015 10:58:08 +0000 (12:58 +0200)]
Use appropriate little-endian/big-endian types in struct definitions.
On-disk struct definitions used native types (u16/u32/u64/s16/s32/s64),
which doesn't say anything about the intended interpretation of the
data. The intention of having little-endian-specific types and
big-endian-specific types must have been to clarify interpretation of
data and intentions in the code. Therefore it seems reasonable to use
these types in struct definitions to clarify what data represention is
used to encode field data.
Because some struct members in layout.h are big-endian, this change also
means moving the duplicated definitions for big-endian byteswapping
macros and big-endian types found in acls.h and security.h to the
appropriate locations in endians.h and types.h respectively in order to
make them available for the struct definitions in layout.h.
Jean-Pierre André [Wed, 30 Sep 2015 07:35:17 +0000 (09:35 +0200)]
Protected against opendir reinitialization in lownfs-3g
Under some condition (probably interference with another process), the
directory list gets reinitialized by releasedir() and opendir() at the
beginning of a partial buffer. So in readdir() skip to the requested
offset. This is a step towards implementing seekdir().
Jean-Pierre André [Wed, 30 Sep 2015 07:08:35 +0000 (09:08 +0200)]
ntfsprogs Builds on Windows use macroes to translate printing formats,
and these macroes redefined "buf" in a way which causes trouble when
"buf" has another meaning. Use "_b" instead.
Jean-Pierre André [Wed, 30 Sep 2015 07:05:47 +0000 (09:05 +0200)]
Displayed reparse point information in ntfsinfo
Added displaying of reparse point data and decode known formats.
Jean-Pierre André [Wed, 30 Sep 2015 07:02:15 +0000 (09:02 +0200)]
Improved the check for a valid $MFTMirr
The test for a valid $MFTMirr could segfault on a badly damaged partition.
Add safety checks.
Jean-Pierre André [Wed, 30 Sep 2015 06:54:27 +0000 (08:54 +0200)]
Fixed a wrong test report in ntfsfix
When used with the "no-action" option, the test for self-located MFT
still reported the partition to have been repaired. Adapt the report to
only tell repairing is possible.
Jean-Pierre André [Wed, 30 Sep 2015 06:51:20 +0000 (08:51 +0200)]
Fixed a bad sanity check in ntfsfix
Fix misordered checks to avoid potential segfaults on badly damaged partitions.
Jean-Pierre André [Wed, 30 Sep 2015 06:44:56 +0000 (08:44 +0200)]
Made secaudit to load the library based on its generic name
When compiled autonomously without the automatically generated dynamic
link stubs, use a generic library name instead of a version dependent one.
(obsolete compile mode rarely used).
Jean-Pierre André [Wed, 30 Sep 2015 06:36:37 +0000 (08:36 +0200)]
Made use of fuse module cache on OpenIndiana
The fuse cache does not handle properly hard-linked files, so ntfs-3g
traditionally disables it by using a null time-out. With an upgrade of
the fuse kernel module on OpenIndiana, cacheing of non hard-linked files
is now possible, so use it.
Jean-Pierre André [Wed, 30 Sep 2015 06:25:25 +0000 (08:25 +0200)]
Mentioned the starting sector when it overflows in mkntfs
In an NTFS boot sector, the first sector of the partition is limited to
32 bits and it may overflow on large disks. This field is only used for
booting on the partition and it is ignored by ntfs-3g, but the warning
in mkntfs mislead users, so improve it.
Jean-Pierre André [Wed, 30 Sep 2015 06:18:13 +0000 (08:18 +0200)]
Used incremental offsets when reading a directory in lowntfs-3g
Using incremental offsets avoids misinterpreting readdir() as rewinddir().
It also makes possible to implement seekdir() [not done yet]
Jean-Pierre André [Tue, 14 Jul 2015 06:37:01 +0000 (08:37 +0200)]
Fixed the range of valid subauthority counts in a SID
ntfs_valid_sid() required that the subauthority count be between 1 and 8
inclusively. However, Windows permits more than 8 subauthorities as well
as 0 subauthorities:
- The install.wim file for the latest Windows 10 build contains a file
whose DACL contains a SID with 10 subauthorities.
ntfs_set_ntfs_acl() was failing on this file.
- The IsValidSid() function on Windows returns true for subauthority
less than or equal to 15, including 0.
There was actually already a another SID validation function that had the
Windows-compatible behavior, so I merged the two together.
Contributed by Eric Biggers
Erik Larsson [Tue, 23 Jun 2015 04:43:17 +0000 (06:43 +0200)]
unistr.c: Cleanup of OS X Unicode normalization code.
Normalize coding conventions to fit in with the rest of NTFS-3G,
including line breaks at column 80.
Erik Larsson [Tue, 23 Jun 2015 04:27:33 +0000 (06:27 +0200)]
Skip installing manpages for mount helpers when they aren't available.
Erik Larsson [Tue, 23 Jun 2015 04:26:52 +0000 (06:26 +0200)]
Make installing mkntfs /sbin symlinks dependent on ENABLE_MOUNT_HELPER.
We shouldn't install anything into /sbin unless ENABLE_MOUNT_HELPER is
on, which is only true for Linux (these are Linux-specific symlinks).
Jean-Pierre André [Mon, 1 Jun 2015 10:48:43 +0000 (12:48 +0200)]
Ported clearing the environment when starting mount or umount
When starting mount or umount, the environment was not cleared and
could be used for privilege escalation (CVE-2015-3202).
This is a port of the fix to full fuse by using execle(3) instead
of execl(3)
Jean-Pierre André [Fri, 17 Apr 2015 09:38:33 +0000 (11:38 +0200)]
Implemented rewindind a directory in lowntfs-3g
Rewinding a directory is done by freeing the current list of files and
rebuilding it. Only seeking to the beginning of the list is implemented.
Jean-Pierre André [Fri, 17 Apr 2015 09:31:47 +0000 (11:31 +0200)]
Zeroed uninitialized bytes before writing compressed data
Compressed records may be written as full clusters even though cluster
tails are meaningless. This is to avoid the lower levels doing a read-
modify-write cycle. Be sure to zero the meaningless bytes to avoid
leaking information.
Contributed by Eric Biggers
Jean-Pierre André [Fri, 17 Apr 2015 09:22:49 +0000 (11:22 +0200)]
Packed/unpacked st_rdev transported as 32-bits on OpenIndiana 64-bits
On OpenIndiana 64-bits, st_rdev has major and minor as 32-bits wide each,
but the fuse protocol (common to 32-bit and 64-bit) has an st_rdev field
limited to 32-bit. For now, pack major and minor the same way as in the
32-bit variant (14 and 18 bits).
Jean-Pierre André [Fri, 17 Apr 2015 09:17:51 +0000 (11:17 +0200)]
Simplified NTFS ACLs when group same as owner and same permission as all
When the owner and the group of a file have the same SID, and permissions
for the group is the same as permissions for other, no ACE is needed for
the group.
Jean-Pierre André [Fri, 17 Apr 2015 09:14:36 +0000 (11:14 +0200)]
Fixed setting SIG_DFL on fuse session exit
This is a backport of a fix applied to the (external) fuse library
Jean-Pierre André [Fri, 17 Apr 2015 09:03:58 +0000 (11:03 +0200)]
Upgraded the upper-case table as defined by Windows 7
Newer versions of Windows use more recent definitions of upper-case
table defined by the Unicode consortium. Now using the same table as
Windows 7, windows 8 and Windows 10. This only has an effect on file
systems newly created by mkntfs.
Jean-Pierre André [Fri, 17 Apr 2015 09:00:00 +0000 (11:00 +0200)]
Fixed the DESX encryption/decryption in ntfsdecrypt
The DESX encryption/decryption algorithm was different from the Windows one.
Jean-Pierre André [Fri, 17 Apr 2015 08:56:34 +0000 (10:56 +0200)]
Removed a temporary debug comment (cosmetic)
The comment was a left over from some debugging action.
Jean-Pierre André [Fri, 17 Apr 2015 08:49:23 +0000 (10:49 +0200)]
Added a sanity check to ntfswipe
Unused entries in the MFT may have a bad length leading to fetch fixups
from unallocated memory. Check the condition, but do not wipe, leave it
to chkdsk to decide what should be fixed.
Jean-Pierre André [Fri, 17 Apr 2015 08:41:04 +0000 (10:41 +0200)]
Defended against reusing data from an invalid MFT record
An unused MFT record may show a bad length, leading to fetch fixups from
unallocated memory when allocating the record to a new file. So check
the length before applying the fixups. Such records have been found after
the MFT has been reallocated by a defragmenter, and they are not cleaned
by chkdsk.
Jean-Pierre André [Fri, 17 Apr 2015 08:35:26 +0000 (10:35 +0200)]
Updated the read-only flag even when the security attribute was cached
When chmod'ing a file, no new ACL has to be created if the one needed
is already present in the cache. However the read-only flag may have
to be updated, so that it is kept as the opposite of S_IWUSR.
Jean-Pierre André [Fri, 17 Apr 2015 08:27:24 +0000 (10:27 +0200)]
Removed the double try to unmount partition in ntfsfix
When the unmounting of the partition fails after running ntfsfix, a
second try was attempted. This cannot be done and leads to more errors
because some essential records have been freed, so better quit without
making a second try.
Jean-Pierre André [Fri, 17 Apr 2015 08:21:02 +0000 (10:21 +0200)]
Fixed displaying "UserMapping" as a file name
Fix the capitalization of the user mapping file name to be filled with
the output of secaudit with option -u.
Jean-Pierre André [Fri, 17 Apr 2015 07:42:19 +0000 (09:42 +0200)]
Rephrased a misleading report message in ntfswipe
When using the "--no-action" option, ntfswipe should display a count
of would-be wiped bytes without suggesting any has been wiped.
Jean-Pierre André [Fri, 17 Apr 2015 07:37:11 +0000 (09:37 +0200)]
Avoided logging meaningless fixup errors in ntfswipe
As ntfswipe examines all MFT entries, it may find uninitialized ones.
They should not be considered as erroneous ones even if the fixups
are wrong.
Jean-Pierre André [Fri, 17 Apr 2015 07:33:04 +0000 (09:33 +0200)]
Avoided mentioning deleted inodes in non-verbose output of ntfswipe
In non-verbose ntfswipe, avoid displaying deleted inodes as erroneous
ones.
Jean-Pierre André [Fri, 17 Apr 2015 07:26:59 +0000 (09:26 +0200)]
Added clarifications about several options to the ntfswipe manual
Clarified the usage of fast wiping, info and verbose options.
Jean-Pierre André [Fri, 17 Apr 2015 07:21:58 +0000 (09:21 +0200)]
Fixed getting sector size from a partition image (Windows variant)
On Windows, when processing a partition image, get the sector size
from the boot sector instead of the containing partition.