Commit Graph

635 Commits

Author SHA1 Message Date
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é
9442db0d8b Added use of hd library to get the legacy BIOS geometry
Author: Anton Altaparmakov <anton@tuxera.com>
Date:   Tue Feb 12 10:33:55 2013 +0000

    Modify libntfs-3g to make use of hd library to get the legacy BIOS geometry
    from EDD.  We scan all whole disk devices on the system and check if they
    match the open ntfs device and if not we scan all partition devices on the
    system and check if they match the open ntfs device.

    If we find a partition device to match then we find its parent device again
    using the hd library.

    Once we have the parent of the partition device or we matched a whole disk
    device we get the legacy EDD sectors per track and heads again using the hd
    library.

    Use of the hd library is auto detected (based on finding <hd.h> header file,
    being able to link against libhd and finding the hd_list symbol in libhd.

    Use can also be disabled/enabled/libhd prefix specified at ./configure time.
    See ./configure --help for details.

    Note this obviously requires libhd to be installed.  On Ubuntu 12/04 systems
    the relevant packages needed are libhd-dev and libhd16 (on older Ubuntu
    versions it will be libhdN where N is some number <= 16 but an easy way to
    get the right package is to simply install libhd-dev which by dependency
    pulls in the correct libhdN package) whilst on SLES systems the relevant
    packages needed are hwinfo and hwinfo-devel.
2013-02-12 15:45:54 +01:00
Jean-Pierre André
44fbf02a97 Upgraded the Win32 interface for use with ntfsprogs
Upgrade the Win32 interface (win32_io.c) which was designed for Cygwin
so that it can be used for using the ntfsprogs utilities on native Windows.
Two new entries are added for truncating a file and creating a sparse
file, both of which not being supported through msvcrt.dll.
2013-02-09 11:22:41 +01: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é
761ba29110 Inserted updated definitions of reparse tags into layout.h
Replace the obsolete definition of reparse tags in layout.h by the
current definitions from msdn, and use them in reparse.c instead of
redefining them.
2012-10-05 10:42:19 +02:00
Jean-Pierre André
97342d05bc Merged libfuse for OpenIndiana into libfuse-lite
The libfuse used by OpenIndiana has the same features as libfuse-lite
though requiring some code variants. Merging them simplifies supporting
both.

Variants for OpenIndiana are selected when defining __SOLARIS__
2012-08-22 11:02:36 +02:00
Jean-Pierre André
3103a6c383 Extended Windows-type ACL inheritance, as needed by Windows 8
Windows 8 uses "Authenticated user" principals which needs to be replaced
by the actual owner when inheriting
2012-08-20 12:36:45 +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é
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é
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é
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
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
Jean-Pierre André
c0955e5d74 cosmetic : fixed improper wordings (hggdh2) 2011-09-28 16:41:12 +02:00
Jean-Pierre André
08bf2b5bcb Avoided logging meaningless fixup errors in ntfsclone and ntfsresize
Logging of fixup errors for uninitialized inodes cause unnecessary
worries and suspicion of malfunctions in ntfs-3g. This patch silences
these loggings in ntfsclone and ntfsresize which have to analyze all
inodes, including the uninitialized ones.
2011-09-23 11:28:42 +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é
d7926f72d0 Provided support for big writes 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é
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é
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é
30c06f9092 Fixed dealing with holes when expanding an attribute 2011-02-16 12:22:30 +01:00
Jean-Pierre André
3160203c97 Defined option acl to request the use of Posix ACLs 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é
addc9be334 Merged sparse testing when appending with ntfsprogs requirement 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é
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é
1c9ef6293b Moved the definition of leMFT_REF to layout.h 2010-12-21 15:51:07 +01:00
Erik Larsson
b0760b6efa Removed crypto.c/crypto.h which was an addition to libntfs that was unused by ntfsprogs. 2010-12-17 09:27:13 +01:00
Erik Larsson
bcdc76f12d Merge remote branch 'linux-ntfs/libntfs-3g_port-v2_0_0' into PERMISSION_HANDLING_BRANCH
Conflicts:
	.cvsignore
	AUTHORS
	CREDITS
	ChangeLog
	NEWS
	README
	TODO.libntfs
	autogen.sh
	configure.ac
	include/ntfs/Makefile.am
	libntfs-3g/misc.c
	libntfs/Makefile.am
	libntfs/gnome-vfs-method.c
	libntfs/gnome-vfs-module.c
	ntfsprogs.spec.in
	ntfsprogs/.cvsignore
	ntfsprogs/mkntfs.c
	ntfsprogs/ntfscat.8.in
	ntfsprogs/ntfsclone.c
	ntfsprogs/ntfscp.8.in
	ntfsprogs/ntfsinfo.c
	ntfsprogs/ntfsprogs.8.in
	ntfsprogs/ntfsresize.c
	ntfsprogs/ntfsrm.c
	ntfsprogs/ntfsundelete.h
	ntfsprogs/upcase.c
	ntfsprogs/utils.c
	test/Makefile.am
2010-12-17 09:04:01 +01:00
Erik Larsson
f3a30779dd Moved list.h into ntfsprogs and got rid of include/ntfs completely. 2010-12-16 17:34:47 +01:00
Erik Larsson
5a41022810 Removed the libntfs-gnomevfs module as it does not seem reasonable to keep maintaining it in ntfs-3g. 2010-12-16 10:08:27 +01:00
Erik Larsson
3efdd4cf0b Merge remote branch 'linux-ntfs/libntfs-3g_port' into ntfsprogs_merge.redo
Conflicts:
        configure.ac
2010-12-16 10:04:22 +01:00
Erik Larsson
2634f01ef0 Cleaned out some .cvsignore files that came from ntfsprogs. 2010-12-16 10:00:56 +01:00
Erik Larsson
02bab2956c Merge remote branch 'linux-ntfs/libntfs-3g_port' into PERMISSION_HANDLING_BRANCH
Conflicts:
	AUTHORS
	COPYING
	CREDITS
	ChangeLog
	Makefile.am
	NEWS
	README
	autogen.sh
	configure.ac
	include/Makefile.am
2010-12-15 17:12:30 +01:00
Erik Larsson
f9c7a548c7 Removed tree.h/tree.c as it was only referenced by the 'rich' code. 2010-12-15 13:43:38 +01:00
Erik Larsson
6922b7c8d0 Disabled installation of the remaining (internal) headers when doing a 'make install'. 2010-12-04 09:41:30 +01:00
Erik Larsson
713fbb390e Merge commit 'v2_0_0' into libntfs-3g_port-v2_0_0
Conflicts:
	configure.ac
	include/ntfs/Makefile.am
	include/ntfs/attrib.h
	include/ntfs/bitmap.h
	include/ntfs/collate.h
	include/ntfs/debug.h
	include/ntfs/dir.h
	include/ntfs/endians.h
	include/ntfs/index.h
	include/ntfs/inode.h
	include/ntfs/layout.h
	include/ntfs/logfile.h
	include/ntfs/logging.h
	include/ntfs/mft.h
	include/ntfs/ntfstime.h
	include/ntfs/runlist.h
	include/ntfs/support.h
	include/ntfs/types.h
	include/ntfs/unistr.h
	include/ntfs/volume.h
	libntfs/Makefile.am
	libntfs/attrib.c
	libntfs/attrlist.c
	libntfs/bitmap.c
	libntfs/bootsect.c
	libntfs/collate.c
	libntfs/compress.c
	libntfs/debug.c
	libntfs/device.c
	libntfs/device_io.c
	libntfs/dir.c
	libntfs/index.c
	libntfs/inode.c
	libntfs/lcnalloc.c
	libntfs/logfile.c
	libntfs/logging.c
	libntfs/mft.c
	libntfs/mst.c
	libntfs/runlist.c
	libntfs/security.c
	libntfs/unistr.c
	libntfs/unix_io.c
	libntfs/volume.c
	libntfs/win32_io.c
	ntfsprogs/Makefile.am
	ntfsprogs/mkntfs.c
	ntfsprogs/ntfscat.c
	ntfsprogs/ntfsclone.c
	ntfsprogs/ntfscmp.c
	ntfsprogs/ntfscp.c
	ntfsprogs/ntfsinfo.c
	ntfsprogs/ntfsmount.8.in
	ntfsprogs/ntfsmount.c
	ntfsprogs/ntfsundelete.c
	ntfsprogs/upcase.c
2010-12-02 22:31:21 +01:00
Erik Larsson
ce6a516a56 Removed the 'rich' functionality including the ntfsrm tool.
This change should be reverted once the 'rich' stuff is ported to libntfs-3g, but right now it seems like too much work.
2010-12-02 17:10:57 +01:00
Erik Larsson
f893a421c2 Removed libntfs-specific sources. 2010-12-02 16:37:09 +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é
351aec3f7a Enabled renaming of system extended attributes 2010-10-26 08:59:52 +02:00
Jean-Pierre André
1898b11481 Improved appending data to fragmented files 2010-10-26 08:59:51 +02:00
Jean-Pierre André
a92c57735b Added an extended attribute name for creation time 2010-10-26 08:59:51 +02:00
Jean-Pierre André
13b578d9b1 Added a big endian extended attribute name for attrib and times 2010-10-26 08:59:51 +02:00
Jean-Pierre André
9c0e3a7b4e Enabled use of fuse cacheing in lowntfs-3g under conditions 2010-10-26 08:59:51 +02:00
Jean-Pierre André
e1ef554dd2 Grouped system extended attributes functions into a dedicated module 2010-10-26 08:59:51 +02:00
Jean-Pierre André
1afaf16912 Implemented the sync mount option 2010-10-26 08:59:51 +02:00
Jean-Pierre André
ecbc2b9103 Implemented fsync() and fsyncdir() 2010-10-26 08:59:51 +02:00
Jean-Pierre André
dd4910b935 Forced alignment on cached structs 2010-10-26 08:59:51 +02:00