Commit Graph

4888 Commits

Author SHA1 Message Date
Jean-Pierre André
15f300412a 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.
2014-03-11 10:37:27 +01:00
Jean-Pierre André
b80d33785a 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).
2014-03-11 10:32:39 +01:00
Jean-Pierre André
b70df75369 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.
2014-03-11 10:28:02 +01:00
Jean-Pierre André
e6c46d4fa0 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.
2014-03-11 10:16:26 +01:00
Jean-Pierre André
ea8e192613 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.
2014-03-11 10:11:00 +01:00
Jean-Pierre André
d2c7d40a2b 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.
2014-03-11 10:04:54 +01:00
Jean-Pierre André
ddd3a8a329 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.
2014-03-11 09:54:53 +01:00
Jean-Pierre André
7e38a29656 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.
2014-03-11 09:50:02 +01:00
Jean-Pierre André
1d2fc42593 Avoided unnormalized parent directory name in ntfscp
Avoid leading '/' in directory names and use in ntfscp the same rule as fuse.
2014-03-11 09:44:50 +01:00
Jean-Pierre André
04ad1b9c09 Fixed default option for compression in the manual
Mention in the manual that compression is now enabledd by default.
2014-03-11 09:40:18 +01:00
Jean-Pierre André
2ab2994536 Fixed an erroneous reference to compression in the manual
compression was erroneously mentioned in the manual instead of permission.
2014-03-11 09:35:50 +01:00
Jean-Pierre André
1c09012dbc 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.
2014-03-11 09:30:18 +01:00
Jean-Pierre André
0f892b92d6 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.
2014-03-11 09:24:34 +01:00
Jean-Pierre André
8520af7f7d Avoided displaying sync errors in ntfscp with --no-action
Do not loop on displaying errors when nothing is to be done
2014-03-11 09:19:06 +01:00
Jean-Pierre André
fb4a2a6292 Fixed an endianness error in ntfsundelete
Name matching was wrong on big endian CPUs when not using regex
2014-03-11 09:12:41 +01:00
Jean-Pierre André
44d74a5b22 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)
2014-03-11 09:07:59 +01:00
Jean-Pierre André
f53c5a34ee Updated the references to changelog and source repository
References now set to Tuxera and git repository
2014-02-16 21:16:09 +01:00
Jean-Pierre André
d2daead832 Updated copyright claims 2014-02-16 18:25:09 +01:00
Szabolcs Szakacsits
316abf080f Version 2014.2.15 2014-02-15 16:01:40 +02:00
Jean-Pierre André
b921b09fb8 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
2014-01-13 15:21:51 +01:00
Jean-Pierre André
f0c5c2a54f 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)
2013-12-17 10:39:55 +01:00
Jean-Pierre André
5b38218f0b 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.
2013-09-20 16:20:02 +02:00
Jean-Pierre André
91a44b438c 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.
2013-09-20 16:14:55 +02:00
Jean-Pierre André
e9a2d29b33 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)
2013-09-09 19:46:00 +02:00
Jean-Pierre André
2cbdba0c5c 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
2013-09-09 15:39:45 +02:00
Jean-Pierre André
5e18e97d0b Silenced warnings by gcc >= 4.8 about aliasing
Added intermediate variables to avoid warnings by gcc >= 4.8
2013-09-09 15:34:14 +02:00
Jean-Pierre André
89af38f687 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).
2013-09-09 15:27:38 +02:00
Jean-Pierre André
1f7fd0160f 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.
2013-09-09 15:19:50 +02:00
Jean-Pierre André
33bbb9d009 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.
2013-08-06 11:44:40 +02:00
Jean-Pierre André
a28e2a8606 Fixed dealing with errors getting the file size from Windows
Using SetFilePointer() for compatibility with old Windows implies
a specific management of errors....
2013-08-06 11:39:13 +02:00
Jean-Pierre André
ebf35000c9 Fixed computing a file size on Windows
The lower part should not have been sign-extended.
2013-07-30 11:42:59 +02:00
Jean-Pierre André
2c10bd6a98 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.
2013-07-30 11:31:56 +02:00
Jean-Pierre André
50db448f02 Fixed format translations for Windows
Translating "%ll" print formats to "%I64" for Windows was wrong.
2013-07-30 11:27:16 +02:00
Jean-Pierre André
1120b9c0b0 Removed duplicated code in mkntfs
Removed a meaningless duplicated test.
2013-07-30 11:22:34 +02:00
Jean-Pierre André
e221ad783c 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).
2013-07-30 11:17:29 +02:00
Jean-Pierre André
0c8e776c12 Silenced a compiler warning in ntfs-3g.probe
Avoid some compilers to complain about a missing return value...
2013-07-30 11:13:51 +02:00
Jean-Pierre André
ad40849149 Forced 64-bit computation of inode number in ntfsundelete
An inode number computation was done with 32 bits, and could (theoretically)
lead to truncation.
2013-07-30 11:07:12 +02:00
Jean-Pierre André
bcbd157cfc 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.
2013-07-30 11:00:46 +02:00
Jean-Pierre André
b60954ff6a 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.
2013-07-30 10:53:07 +02:00
Jean-Pierre André
c8a43e3f9f 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.
2013-07-30 10:45:22 +02:00
Jean-Pierre André
397848e21d Reserved a single sector for the backup boot sector
Reserve a single sector, instead of a full cluster, for the backup boot
sector.
2013-07-30 10:35:13 +02:00
Jean-Pierre André
9d730b0da1 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.
2013-07-30 10:17:28 +02:00
Jean-Pierre André
66cdec13d9 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.
2013-05-30 10:23:04 +02:00
Jean-Pierre André
db35a16838 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.
2013-05-07 11:42:48 +02:00
Jean-Pierre André
abba388447 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 ".\"
2013-04-26 19:07:47 +02:00
Jean-Pierre André
be58b3b1f6 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.
2013-04-22 19:14:48 +02:00
Jean-Pierre André
c5a11341b0 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.
2013-04-22 19:06:49 +02:00
Jean-Pierre André
baf13fe555 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.
2013-04-22 18:55:26 +02:00
Jean-Pierre André
28cacf40b0 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.
2013-04-22 18:45:48 +02:00
Jean-Pierre André
20801dc6a0 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.
2013-04-22 18:37:51 +02:00