Commit Graph

60 Commits (701cd61cca83d504ad5cf14d908e49b32aad18be)

Author SHA1 Message Date
Erik Larsson 701cd61cca volume.c: Fix passing bad pointer type to ntfs_is_[baad|mft]_recordp. 2016-01-25 11:31:12 +01: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
Erik Larsson 7506d8b80b Rename legacy MS_* flags for ntfs_mount with NTFS_MNT_* flags.
The MS_* flags originated from system constants. However the flags
passed to ntfs_mount were really unrelated to the system constants and
many new MS_* flags had to be introduced as different features were
added to the library. Those flags had no counterparts in any system
APIs, so using the same naming scheme is inappropriate.

Instead, let's namespace these flags similarly to what has already been
done in ntfsprogs/libntfs earlier. This avoids any possible conflicts
with system constants.
The values of the flags themselves are kept the same as earlier, so
backward compatibility is retained.
2012-11-07 16:29:48 +01:00
Erik Larsson ebb38c4b1c API cleanup of const arguments.
- Replaced 'ntfschar*' parameters with 'const ntfschar*' where
  appropriate (the function does not need to modify the string).
- Replaced some instances of 'u8*' and 'char*' read-only buffer
  arguments with 'const u8*' and 'const char*'.
2012-11-07 14:15:53 +01:00
Jean-Pierre André 559270a8f6 Prevented partitions with metadata cached in Windows from being mounted
Windows 8 includes a "fast restart" feature for restarting without fully
remounting the internal volumes. When this mode is selected, metadata
stored in the cache (probably hiberfil.sys) is used instead of what
is actually on disk, and this may lead to inconsistencies when changes
have been made by ntfs-3g in the meantime.

This patch tries to prevent ntfs-3g from mounting in read-write mode
when a fast restart of Windows 8 is detected. It relies on the restart
pages in the $LogFile being identified as version 2.0, which is
apparently related to data being cached for hibernation or fast restarting.
2012-09-25 09:46:54 +02:00
Jean-Pierre André 0b2a85b612 Forced option ro when mounting a read-only device
External devices, such as USB keys, may have a switch to make them
temporarily unwriteable. When such a device is plugged in, mount it
as read-only by default.
2012-09-12 09:47:36 +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é 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é 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é 59ecea5c80 new : allow compression in default setup
With the default mount options, compression of new files are now done
if the parent directory is marked for compression. The mount option
"compression" is not needed any more, but the option "nocompression"
can be used to disable compression of new files.

The default option also applies to applications using libntfs-3g with
no mount command.
2011-10-20 18:55:32 +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
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é 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
Szaka f246d6ce97 Update ntfs-3g.org references 2011-03-27 15:29:48 +03: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é d4e2a501a5 Enabled forensic mounting 2010-12-21 15:51:07 +01:00
Jean-Pierre André 135cb75249 Fixed logging corrupted $UpCase 2010-11-09 09:40:02 +01:00
Jean-Pierre André 563f5dda3f Implemented a basic check on upcase table 2010-10-26 08:59:51 +02:00
Jean-Pierre André 693aa8780d enabled case insensitive file names in lowntfs-3g 2010-05-25 10:12:44 +02:00
Jean-Pierre André 3745d0a1e3 marked files whose name has a dot initial as "hidden" if option hide_dot_files 2010-05-25 09:58:36 +02:00
jpandre 6f72ec189d Logged the outcome of making $TXF_DATA resident 2010-01-16 09:26:01 +00:00
jpandre da39179421 Merged Anton's patch for $TXF_DATA attribute 2010-01-08 11:15:46 +00:00
jpandre c708a2bdee Fixed TXF_DATA attribute on root directory when made non-resident 2010-01-04 08:09:44 +00:00
jpandre 41a371f4a7 Redesigned caches for indexing cached entries 2009-12-17 17:36:06 +00:00
jpandre 9279c2e493 Fixed inappropriate casts 2009-11-25 14:29:08 +00:00
jpandre a75724fea8 Fixed a few misleading endianness types 2009-11-24 14:18:53 +00:00
jpandre f259fb44df Improved cluster allocation on volumes too filled 2009-07-01 19:16:33 +00:00
jpandre 1e822076d6 Adapted to ntfs-3g.2009.3.8 2009-03-27 09:15:24 +00:00
jpandre a13ee0c82c Fed the free spaces in context for calls from security API 2009-03-27 08:36:07 +00:00
jpandre 93b695f1cc Adapted to ntfs-3g-2009.2.1 2009-02-12 20:32:21 +00:00
jpandre 11216c6942 Adapted to ntfs-3g-2009.1.1 2009-01-23 11:11:44 +00:00
jpandre d3f3a19866 Adapted to ntfs-3g.1.5222-RC 2009-01-05 13:28:06 +00:00
jpandre e5286c09d6 Adapted to ntfs-3g.1.2926-RC 2008-09-19 13:39:38 +00:00
jpandre 412838056a Adapted to ntfs-3g.1.2712 2008-07-13 17:55:57 +00:00
jpandre 7c05f13884 Adapted to ntfs-3g-1.2531 2008-05-30 07:40:22 +00:00
jpandre 2fa89952ff Fixed cache creation when mount fails 2008-03-12 16:22:24 +00:00
jpandre 53fa335624 Adapted to ntfs-3g.1.2310 2008-03-10 15:35:54 +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 038156ba82 Reengineered LRU caches, made generic, and applied to finding inode numbers 2008-01-10 17:32:55 +00:00
jpandre 3a51d80655 Adjusted to v 1.1104 2007-11-20 11:05:49 +00:00
jpandre 13a68a1864 Upgraded to v1.1004 2007-10-06 14:48:10 +00:00
szaka 64f9f0dc1a ntfs_volume_check_hiberfile: relaxed too strict check: if the hiberfil.sys
header has garbage then the volume is not hibernated
2007-09-12 21:11:12 +00:00
szaka 19a3585d23 ntfs_volume_startup: cleanup 2007-08-25 21:20:28 +00:00
szaka 718160d167 fix compilation with glibc 2.7 (Tom "spot" Callaway) 2007-08-25 20:27:02 +00:00
szaka 0cee6bc4bb remove redundant ntfs_attr_get_search_ctx() error logging 2007-07-13 20:05:48 +00:00
szaka 496c285c5d ntfs_attr_free()/ntfs_inode_free(): don't scare users with bogus errors 2007-07-09 22:18:07 +00:00
szaka b4470951ac remove unused ntfs_device_umount() 2007-06-08 23:11:55 +00:00
szaka 655d656321 ntfs_umount() can return error 2007-06-08 23:09:43 +00:00