Erik Larsson
11a3997a0d
Merge tag '2021.8.22' into edge.strict_endians
...
Conflicts:
libntfs-3g/attrib.c
libntfs-3g/bootsect.c
ntfsprogs/ntfsfix.c
2021-09-06 15:12:08 +02:00
Jean-Pierre André
a337c4c1eb
Renamed ntfs_index_entry_consistent() as ntfs_index_entry_inconsistent()
...
The original name was error prone when checking the condition.
2021-07-19 09:23:23 +02:00
Jean-Pierre André
2bf5077804
Checked consistency of index blocks
...
Improved existing consistency checks of index blocks and grouped them
into a specific function.
2021-07-19 09:23:23 +02:00
Jean-Pierre André
5c002438f2
Checked that indexes do not exceed the index block size
...
Make sure the used part of an index block fits into the allocated buffer.
Note : a negative size may cause overflow on 32-bit cpus.
(contributed by Rakesh Pandit)
2021-07-12 08:31:18 +02:00
Jean-Pierre André
7f45544ed7
Added and grouped generic attribute checks
...
Checked that attributes are [non-]resident when they have to be, and
grouped consistency checks on each of them in a dedicated function.
Consequenly request the checks where needed and remove existing index
checks.
2021-07-12 08:31:18 +02:00
Jean-Pierre André
436fe09f87
Checked consistency of index entries
...
Make sure the data and key in indexes do not overflow from index entries
2021-07-12 08:31:18 +02:00
Jean-Pierre André
3f3b771cb0
Added consistency checks of index root
...
The index root must lie within the space allocated for it.
2021-05-17 15:33:04 +03:00
Erik Larsson
a00610ed15
Merge branch 'edge' into edge.strict_endians
...
Conflicts:
include/ntfs-3g/layout.h
libntfs-3g/acls.c
libntfs-3g/attrib.c
libntfs-3g/bootsect.c
libntfs-3g/dir.c
libntfs-3g/mft.c
libntfs-3g/reparse.c
ntfsprogs/ntfsinfo.c
ntfsprogs/ntfsresize.c
ntfsprogs/playlog.c
src/lowntfs-3g.c
src/ntfs-3g_common.c
2021-03-05 14:48:11 +02:00
Jean-Pierre André
094f9b3f2d
Fixed a minor endianness ajustment bug
...
The endianness ajustment was the wrong one though it did the correct thing.
2021-01-26 10:06:18 +01:00
Jean-Pierre André
cd68a084fc
Recovered space when an index root is shortened
...
In rare situations, removing an entry from an index root while
rebalancing the index tree, its space was not recovered from the index
root, causing chkdsk to complain. Truncate the index root when this
happens.
2020-08-14 11:57:02 +02:00
Erik Larsson
26ed262ae4
Merge tag '2017.2.15' into edge.strict_endians
...
Conflicts:
include/ntfs-3g/layout.h
include/ntfs-3g/logfile.h
libntfs-3g/reparse.c
libntfs-3g/unistr.c
ntfsprogs/ntfsdump_logfile.c
ntfsprogs/ntfsfix.c
ntfsprogs/ntfsinfo.c
ntfsprogs/ntfsrecover.c
ntfsprogs/ntfsresize.c
ntfsprogs/playlog.c
src/lowntfs-3g.c
src/ntfs-3g.c
2017-03-21 05:41:54 +01:00
Jean-Pierre André
ea9b8a487c
Fixed memory leak when failing to lookup an index
...
When an index could not be used, the search context was not freed
2017-02-11 10:29:39 +01:00
Erik Larsson
34bb449324
Merge branch 'edge' into edge.strict_endians
...
Conflicts:
libntfs-3g/dir.c
libntfs-3g/index.c
libntfs-3g/runlist.c
ntfsprogs/ntfsfix.c
ntfsprogs/ntfsinfo.c
2016-02-05 18:02:02 +01:00
Erik Larsson
9893ea9ee6
Merge endianness fixes.
...
Conflicts:
libntfs-3g/attrib.c
2016-01-28 09:22:42 +01:00
Erik Larsson
760ddd62cf
Merge endianness fixes required for the strict endians code to compile.
...
Conflicts:
libntfs-3g/attrib.c
libntfs-3g/dir.c
libntfs-3g/logfile.c
libntfs-3g/volume.c
ntfsprogs/ntfscp.c
ntfsprogs/ntfsdump_logfile.c
ntfsprogs/ntfsfallocate.c
ntfsprogs/ntfsfix.c
ntfsprogs/ntfsinfo.c
ntfsprogs/ntfsresize.c
ntfsprogs/ntfstruncate.c
2016-01-28 09:21:09 +01:00
Erik Larsson
85588b8e92
Replace all le16 "not" negations with le16_not(...).
2016-01-28 08:28:59 +01:00
Erik Larsson
b61e7ff449
Replace all le16 "or" calculations with le16_or(...).
2016-01-28 08:28:53 +01:00
Erik Larsson
2b4c3a618c
Replace all le16 "and" calculations with le16_and(...).
2016-01-28 08:28:50 +01:00
Erik Larsson
9f5ad52e5f
Replace all le32 non-zero "and" test conditions with !le32_andz(...).
2016-01-28 08:28:48 +01:00
Erik Larsson
1b7bfaa133
Replace all le16 zero "and" test conditions with le16_andz(...).
2016-01-28 08:28:47 +01:00
Erik Larsson
35c72761c7
Replace all le16 non-zero "and" test conditions with !le16_andz(...).
2016-01-28 08:28:46 +01:00
Erik Larsson
e366bef954
Replace all le16 zero test conditions with "le16_cmpz(...)".
2016-01-28 08:28:38 +01:00
Erik Larsson
9cf04fd2cd
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.
2015-12-21 23:55:31 +01:00
Erik Larsson
dfa4a6647f
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.
2015-12-21 23:21:00 +01:00
Jean-Pierre André
1aa9882810
Silenced a compiler warning (cosmetic)
...
An argument to ntfs_index_remove() is now unused
2015-11-12 15:39:20 +01:00
Jean-Pierre André
f7bc5249bc
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.
2015-11-09 16:22:16 +01:00
Jean-Pierre André
37bd6661d4
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.
2015-11-09 16:09:52 +01:00
Jean-Pierre André
b76883dc84
major : Fixed computation of index block size (Anton Altaparmakov)
...
When the cluster size is bigger than the index block size, the index
block size unit is 512 (not the sector size) instead of the cluster size.
The partitions formatted by mkntfs and used by ntfs-3g were not
interoperable with Windows when the cluster size is bigger than 4K
and the sector size is not 512.
2011-11-04 11:01:11 +01:00
Jean-Pierre André
058f850eb3
Fixed getting space for making an index non resident
...
In rare situations there is not enough space in the base inode entry
to make an index non resident. The index has to be moved to an extent
first. This happens when not using permissions and inserting a file
whose name has 60 chars into a directory whose name has 184 chars.
(bug reported by Vito Caputo)
2011-03-23 09:22:08 +01:00
jpandre
7bea2202d7
Made direct calls to collation functions
2009-12-16 10:20:57 +00:00
jpandre
af4f6a406a
fix format breaking new lines in error messages
2009-11-05 11:43:36 +00:00
jpandre
b78d895575
Added indexing of reparse data into $Extend/$Reparse
2009-11-03 14:35:53 +00:00
jpandre
2a1d75a3da
Adapted to ntfs-3g.2009.3.8
2009-03-27 09:10:00 +00:00
jpandre
ee37dcab6d
Interpreted symbolic links created by Vista as symbolic links
2008-11-26 15:57:20 +00:00
jpandre
499e106341
Adapted to ntfs-3g.1.2812
2008-08-16 15:17:47 +00:00
jpandre
7c05f13884
Adapted to ntfs-3g-1.2531
2008-05-30 07:40:22 +00:00
jpandre
a38b79897d
Adapted to ntfs-3g.1.2216
2008-02-18 15:15:13 +00:00
jpandre
2ff8218406
Adapted to ntfs-3g-1.2121-RC
2008-01-23 08:16:23 +00:00
jpandre
a892467a88
Fixed bad release of index root
2007-12-04 07:51:30 +00:00
jpandre
a8dc8655d0
Adjusted to v 1.1030
2007-10-29 16:28:33 +00:00
jpandre
d93d9562ee
Fixed a special case in getting next index entry
2007-10-15 14:59:30 +00:00
jpandre
91a4873a23
Implemented a function giving next entry in an index
...
2007-10-12 12:54:49 +00:00
jpandre
a8a33f0bc3
Reverted back relay for free() and consequences on const ptrs
2007-10-09 13:33:11 +00:00
jpandre
8a210f7776
Cleaned code
...
2007-10-09 07:37:07 +00:00
jpandre
e84a56b165
Made two more functions public for temporary use in security.c
2007-10-06 14:39:08 +00:00
jpandre
99b4aba970
*** empty log message ***
2007-09-27 13:29:52 +00:00
szaka
0cee6bc4bb
remove redundant ntfs_attr_get_search_ctx() error logging
2007-07-13 20:05:48 +00:00
szaka
c214b9c11c
No need to check for ENOSPC because ntfs_log_perror() does it now
2007-07-08 20:45:14 +00:00
szaka
3f66b95f14
fix very rare, recoverable directory corruption
2007-07-08 18:41:27 +00:00
szaka
78348655bd
ntfs_ir_truncate(): log all errors
2007-07-07 23:11:19 +00:00