Commit Graph

498 Commits

Author SHA1 Message Date
Jean-Pierre André
ad53f4c24a Enabled getting the sector size from an ioctl on FreeBSD and MacOSX (Erik Larsson)
The sector size is needed for formatting a volume unless forced through
an option or using the traditional sector size.
2011-09-14 12:21:59 +02:00
Erik Larsson
8d06955ea4 Cleaned up and moved label changing functionality into libntfs-3g.
The label changing code in ntfslabel was cleaned up and modified to use the more
advanced functionality of libntfs-3g instead of using older custom code to
resize and create resident attributes.
The core label changing functionality was also moved into the library so it can
be reused by other programs.
2011-09-13 09:43:30 +02:00
Jean-Pierre André
4dd63e0fd1 Fixed the setting of attributes by secaudit
The setting of attributes was done in the "standard information",
it must also be propagated to the indexes in parent directories.
2011-09-12 18:41:25 +02:00
Erik Larsson
b8103bbcfe Permit $VOLUME_NAME to be 0-sized, even when $AttrDef says otherwise.
When clearing a volume name in Windows, $VOLUME_NAME is set to size 0, even if
the standard $AttrDef says that the minimum size is 2.

So the definition in $AttrDef doesn't reflect actual Windows behaviour in this
particular case, and to clear volume names ourselves the way Windows does it,
we must must add a special rule to permit us to truncate the $VOLUME_NAME
attribute to 0 even when $AttrDef specifies a higher value as minimum size.
2011-09-12 09:07:00 +02:00
Jean-Pierre André
178ae712c3 Fixed the truncation of dos file names
Truncate dos file names to 12 ntfschars instead of 12 utf-8 bytes
2011-09-08 09:52:51 +02:00
Jean-Pierre André
0b8b7521a4 Fixed the FullyMapped flag when making an attribute resident
When an attribute is truncated and made resident, the NAttrFullyMapped
flags has to be cleared, otherwise the attribute cannot be properly
mapped when the attribute is later made non-resident again.
2011-08-30 16:02:32 +02:00
Jean-Pierre André
0b827cc978 Avoid endless recursion when MFT extents are described in themselves
When getting extents of MFT, we must be sure they are in the MFT part which
has already been mapped, otherwise we fall into an endless recursion.

Situations have been met where extents locations are described in themselves,
as a consequence of a bug, probably unrelated to ntfs-3g.
This is a severe error which chkdsk cannot fix.
2011-08-30 15:56:36 +02:00
Jean-Pierre André
a1161d552f cosmetic : Removed a pointless store in ntfs_attr_make_resident() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André
ae020fc4a7 cosmetic : Removed two dead stores in remove_object_id_index() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André
35ad185ade cosmetic : Removed a pointless variable initialization in upgrade_secur_desc() (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André
246019fcd5 fix : Fixed ntfs_rl_extend() returning garbage in error case (Fabian Keil) 2011-08-04 15:49:36 +02:00
Jean-Pierre André
fa3d7a5728 minor : Fixed ntfs_upcase_build_default() returning garbage in error case (Fabian Keil) 2011-08-04 15:49:35 +02:00
Jean-Pierre André
12e54df513 cosmetic : Removed more unneeded variables warned by gcc 4.6 2011-08-04 15:49:35 +02:00
Erik Larsson
182c5c2a2f Fix: Forgot to update state bits after last change. 2011-08-03 15:49:40 +02:00
Erik Larsson
7f2d1efa82 Bugfix: ntfs_mft_load didn't fill in the size fields in the $MFT inode. 2011-08-03 11:13:40 +02:00
Jean-Pierre André
919eeb71df Improved compression (faster) 2011-07-05 12:17:30 +02:00
Jean-Pierre André
5cd49257b0 Removed unneeded variables as warned by gcc 4.6 2011-07-05 12:17:29 +02:00
Jean-Pierre André
47a4b0ba17 Fixed a too restrictive consistency check in attrib.c 2011-07-05 12:17:29 +02:00
Jean-Pierre André
262ed5f7df Cleared attribute flags controlling recursive writes 2011-07-05 12:17:28 +02:00
Jean-Pierre André
571dbc5784 Fixed device path canonicalization for use by devmapper (basilinya)
For some reason, when the monted device is "/dev/mapper/*", a record
in the form "/dev/dm-*" ends up in /etc/mtab and the device cannot be
unmounted.

The reason is unclear, the /dev/mapper name is not a symlink, and the
function doing the name change is not known. No detailed feedback from
the users having met the issue.

The patch changes the name back to the /dev/mapper name after realpath()
is called, and, if there is an actual change, both the name passed to
ntfs-3g and the one passed to fuse and mount are logged in the hope
of getting a clue about what is happening.

But ntfs-3g is probably not the right place for a fix.
2011-07-05 12:17:12 +02:00
Jean-Pierre André
82b00364a8 Fixed setting DOS names when defined with lower-case chars 2011-07-05 12:17:11 +02:00
Jean-Pierre André
f510c5cdf4 Got the target libs to build libntfs-3g and libfuse-lite if selected 2011-07-05 12:17:11 +02:00
Jean-Pierre André
e4db980830 Translated the junctions to lower case when ignore_case is set
When ignore_case is set, the file names are returned lower-case in
readdir() in order to make file name completions possible. This patch
does the same for junction points to avoid directory locks when used
with non-matching names.
2011-04-08 18:19:17 +02:00
Szaka
f246d6ce97 Update ntfs-3g.org references 2011-03-27 15:29:48 +03: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
Jean-Pierre André
f219d2e07e Fixed inconsistent interface to ntfs_initialize_file_security()
The "flags" argument of ntfs_initialize_file_security() is intended to
feed the one to ntfs_mount(). Having the same type for both may avoid
future problems.
2011-03-23 09:20:10 +01:00
Jean-Pierre André
c879697b12 Fixed type of argument (same value)
A boolean argument had been replaced by a tri-state one, but the change
was forgotten in one instance. No visible effect, the value is the same.
2011-03-23 09:10:10 +01:00
Jean-Pierre André
2363a26297 Removed duplicated code
A patch had been applied twice, duplication caused to no visible effects.
2011-03-23 09:02:15 +01:00
Jean-Pierre André
402924cc50 Fixed cluster mapping ahead of mapped runlist
A corner case was wrong and could cause aborted writes with error
"Run lists overlap. Cannot merge" when the clusters required by the
write are described in different MFT extents.
This can only happen in very fragmented files when the cluster size
is smaller than 4096 bytes. It does not cause any metadata corruption.
2011-03-01 12:14:53 +01:00
Jean-Pierre André
30c06f9092 Fixed dealing with holes when expanding an attribute 2011-02-16 12:22:30 +01:00
Jean-Pierre André
a46a395006 Updated copyright notices 2011-02-08 13:52:12 +01:00
Jean-Pierre André
4c6cf9d977 Moved the knowledge of default upcase size to unistr.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André
82ce1fcdfa Improved appending data to a long hole 2011-02-08 13:52:12 +01:00
Jean-Pierre André
addc9be334 Merged sparse testing when appending with ntfsprogs requirement 2011-02-08 13:52:12 +01:00
Jean-Pierre André
d58b21ec1d Fixed possible wrong hole size when overwriting compressed data 2011-02-08 13:52:12 +01:00
Jean-Pierre André
9ddc70f19b Moved listxattr() to a specific source module 2011-01-17 15:50:25 +01:00
Jean-Pierre André
6bf4af7544 Fixed allocated size when an attribute update causes unnamed data to be expelled 2011-01-10 11:18:16 +01:00
Jean-Pierre André
9b2ecca3df Do not record inode open when failed (debug only) 2011-01-10 11:16:39 +01:00
Jean-Pierre André
53599b1a98 Switched to the same Upcase table as Vista 2010-12-21 15:51:08 +01:00
Jean-Pierre André
0cb35ac7aa Enabled expanding an attribute without creating a hole 2010-12-21 15:51:07 +01:00
Jean-Pierre André
d4e2a501a5 Enabled forensic mounting 2010-12-21 15:51:07 +01:00
Jean-Pierre André
bb142bc742 Fixed deleting files using ignore_case option 2010-12-21 15:51:07 +01:00
Erik Larsson
7287c05ff4 Made ntfsprogs compilation conditional and turned off by default. It is enabled with '--enable-ntfsprogs'. 2010-12-16 17:35:06 +01:00
Erik Larsson
daa1f3edcd Bugfixes for 'make extra'. 2010-12-16 10:08:34 +01:00
Jean-Pierre André
48caa7a45e Took care of alignments needed on some processors 2010-11-09 09:43:31 +01:00
Jean-Pierre André
a70e40021d Added detail to an error message to discriminate from a similar one 2010-11-09 09:41:00 +01:00
Jean-Pierre André
135cb75249 Fixed logging corrupted $UpCase 2010-11-09 09:40:02 +01:00
Jean-Pierre André
351aec3f7a Enabled renaming of system extended attributes 2010-10-26 08:59:52 +02:00
Jean-Pierre André
563f5dda3f Implemented a basic check on upcase table 2010-10-26 08:59:51 +02:00
Jean-Pierre André
8b910e9e80 Improved names comparing on big-endian computers 2010-10-26 08:59:51 +02:00