Commit Graph

4825 Commits

Author SHA1 Message Date
Jean-Pierre André
8ae20018df 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.
2012-07-06 09:56:50 +02:00
Jean-Pierre André
db5af00af6 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.
2012-07-06 09:48:05 +02:00
Jean-Pierre André
ab6f7c027d 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.
2012-06-18 13:00:17 +02:00
Jean-Pierre André
7a93d1790a 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.
2012-06-18 12:57:40 +02:00
Jean-Pierre André
0f8ef123ea 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.
2012-06-18 12:53:25 +02:00
Jean-Pierre André
93ac6ce3bf 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.
2012-06-18 12:46:21 +02:00
Jean-Pierre André
24c9f19065 Added optional wiping of file tails and undelete data to ntfswipe (Bogdan)
Added more wiping options to ntfswipe (to avoid leaking of deleted data).
2012-06-18 12:41:51 +02:00
Jean-Pierre André
8f896f112a 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.)
2012-06-18 12:34:56 +02:00
Jean-Pierre André
9704ff9396 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").
2012-06-18 12:27:38 +02:00
Jean-Pierre André
464a9156cd Fixed a wrong computation of ACL size (minor issue) 2012-06-18 12:26:36 +02:00
Jean-Pierre André
9ae4165ee8 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.
2012-06-18 12:19:27 +02:00
Jean-Pierre André
dba29ee6e7 Implemented the fixing of the backup boot sector in ntfsfix
This checks the backup boot sector and fixes it as needed.
2012-03-21 19:35:30 +01:00
Jean-Pierre André
1ad9bdad4d 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
2012-03-21 19:26:00 +01:00
Jean-Pierre André
911ecba5e2 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)
2012-03-21 19:19:39 +01:00
Jean-Pierre André
4e29280cb2 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).
2012-03-21 19:14:03 +01:00
Jean-Pierre André
37ae85a9d5 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
2012-03-21 19:09:52 +01:00
Jean-Pierre André
2b779a6510 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.
2012-03-21 19:01:33 +01:00
Jean-Pierre André
66416041ec 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.
2012-03-21 18:56:05 +01:00
Jean-Pierre André
1c93e2a97d 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.
2012-03-21 18:52:07 +01:00
Jean-Pierre André
319958545e 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.
2012-03-21 18:48:38 +01:00
Jean-Pierre André
e82240f499 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.
2012-03-21 18:42:29 +01:00
Jean-Pierre André
f78cc45208 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.
2012-03-21 18:34:48 +01:00
Jean-Pierre André
66d30c86b3 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.
2012-01-23 18:22:59 +01:00
Jean-Pierre André
54f96e4af1 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.
2012-01-23 18:19:17 +01:00
Jean-Pierre André
e7bfd31de4 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.
2012-01-23 18:13:59 +01:00
Jean-Pierre André
4a0892eb26 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.
2012-01-23 18:10:26 +01:00
Jean-Pierre André
cd0be288b9 Fixed debug check for double opening after deleting an inode
A debug check could be defeated when a deleted inode number was reused.
2012-01-23 18:05:27 +01:00
Jean-Pierre André
a5e656751d Worked around basename(3) not present on OpenIndiana 2012-01-23 18:03:59 +01:00
Jean-Pierre André
e85d986494 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.
2012-01-23 18:00:18 +01:00
Jean-Pierre André
08ad3b4977 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.
2012-01-23 17:56:15 +01:00
Jean-Pierre André
458c5eb191 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)
2012-01-23 17:49:38 +01:00
Jean-Pierre André
b25178fec3 Strengthened sanity checks on readdir/closedir
Be more defensive against readdir() on closed directories.
2012-01-23 17:45:12 +01:00
Jean-Pierre André
ac8a980e7a 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.
2012-01-23 17:39:47 +01:00
Jean-Pierre André
d85675bf6d 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.
2012-01-23 17:34:19 +01:00
Jean-Pierre André
528b4303b2 Accepted multiple read-only mounts
Multiple mounts of a partition is now allowed provided they are all
in read-only mode.
2012-01-23 17:31:15 +01:00
Jean-Pierre André
c9edd32113 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
2012-01-23 17:25:55 +01:00
Jean-Pierre André
0aa68c128d 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.
2012-01-23 17:20:20 +01:00
Jean-Pierre André
3c6e88cb0f 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.
2012-01-23 17:16:07 +01:00
Jean-Pierre André
5593ee2711 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.
2012-01-23 17:11:46 +01:00
Jean-Pierre André
4ce33daf6c Cosmetic : fixed an indentation in unistr 2012-01-23 17:09:19 +01:00
Jean-Pierre André
162b4f8051 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.
2012-01-23 16:59:49 +01:00
Jean-Pierre André
9b5bd2cbbc Allowed building for kfreebsd (Robert Millan)
Extended several #ifdef's to account for "FreeBSD kernel"
2012-01-23 16:55:04 +01:00
Jean-Pierre André
d06ee35332 Used ENOENT instead of ENODATA when the latter is not defined (Robert Millan)
ENODATA is not defined by Posix and is lacking on FreeBSD
2012-01-23 16:50:25 +01:00
Szabolcs Szakacsits
e38154dde2 Version 2012.1.15 2012-01-15 15:21:52 +02:00
Erik Larsson
e08c40170b 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.
2012-01-13 13:37:33 +01:00
Erik Larsson
9fca9caf5c ntfswipe.c: Deduplicated MFT write code in wipe_mft. 2012-01-13 08:54:46 +01:00
Erik Larsson
50774cd274 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.
2012-01-13 08:54:46 +01:00
Erik Larsson
7e2ee67097 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.
2012-01-13 08:54:46 +01:00
Erik Larsson
887ccbf868 ntfswipe.c: Write newly manufactured MFT entries to $MFTMirr if needed.
'wipe_mft' didn't write any $MFTMirr entries for newly manufactured
entries (i.e. entries that were unused and therefore competely wiped and
replaced with a newly initialized copy).
2012-01-13 08:54:46 +01:00
Erik Larsson
7213211c96 ntfswipe.c: Fixed writing incorrect $MFTMirr entries in wipe_mft.
The dereferencing of 'offset' and 'usa' from the MFT record wasn't an
le16* dereference but a u8* dereference, leading to only the least
significant byte (little-endian systems) or the most significant byte
(big-endian systems) being part of the value. (So while this bug could
go unnoticed on little-endian systems for volumes with small values of
'usa', it caused even more significant problems on big-endian systems.)

Fixed by properly casting the address to le16* before dereferencing.
2012-01-13 08:54:46 +01:00