Commit Graph

40 Commits

Author SHA1 Message Date
Erik Larsson
038a45a8a1 Fix compilation errors on OpenIndiana caused by missing limit macros. 2016-02-16 20:43:00 +01:00
Erik Larsson
8aca3d4800 ntfsmove.c: Fix multiple cases of raw usage of little-endian fields.
There were multiple cases of little-endian fields being used as
CPU-endian without byte swapping. This would result in incorrect
behaviour on big-endian systems.
2016-01-27 15:28:55 +01:00
Erik Larsson
f076fae75a Fix endianness issues in log and terminal output.
This commit addresses issues where little-endian variables are emitted
raw to a log or output stream which is to be interpreted by the user.

Outputting data in non-native endianness can cause confusion for anybody
attempting to debug issues with a file system.
2015-12-21 23:31:09 +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
Jean-Pierre André
0ec31405c6 Fixed casting data to printf format in ntfsck, ntfsmove and ntfswipe 2011-07-05 12:17:28 +02: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
16dbcbec0c Restored 'local' includes for all the ntfsprogs instead of using system includes (e.g. #include "yada.h" instead of #include <ntfs-3g/yada.h>). 2010-12-16 09:59:42 +01:00
Erik Larsson
18789cdeaa Replaced all occurrences of the libntfs mount flag NTFS_MNT_FORCE with the libntfs-3g mount flag MS_RECOVER.
Note: The NTFS_MNT_FORCE, in addition to what MS_RECOVER does, also bypasses the check for the 'dirty' bit in libntfs' ntfs_mount.
However, this check does not exist in libntfs-3g (libntfs-3g will not check or change the dirty bit, being confident that it can handle volumes marked as 'dirty'), so in essence the same behaviour is achieved with MS_RECOVER.
2010-12-02 22:37:06 +01:00
Erik Larsson
6ff5d3f8a7 Replaced all occurrences of the libntfs mount flag NTFS_MNT_RDONLY with the corresponding libntfs-3g mount flag MS_RDONLY. 2010-12-02 22:36:58 +01:00
Erik Larsson
6b513b1c55 Replaced references to NVolSetWasDirty with appropriate substitutions.
libntfs (unlike libntfs-3g) sets the volume dirty bit automatically on ntfs_mount (if not already set) and also automatically clears the volume dirty bit on ntfs_umount (if it was not already set before mount). The 'WasDirty' flag is set to indicate that the volume was already dirty when it was mounted, so setting it means bypassing the 'clear dirty flag' behaviour on unmount (it does not mean 'set dirty flag on unmount').

NVolSetWasDirty is accordingly replaced with the actions that were intended:
- If the intention was to leave the dirty bit set on unmount, we explicitly set the bit if it is not already set.
- If the intention was to simply update the 'WasDirty' bit to be consistent with earlier changes, we just comment out the statement.
2010-12-02 22:34:45 +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
7478b2396c ntfsmove.c: Adapted calls to ntfs_get_size_for_mapping_pairs to the libntfs-3g interface.
Note: libntfs-3g has a 'max_size' variable to cap the size calculation, but this variable is frequently set to INT_MAX in the libntfs-3g code itself when there is no desire to limit the size calculation. We will do the same here.
2010-12-02 16:56:27 +01:00
Erik Larsson
196f7f6461 Commented out all references to 'version.h' in the 'extra' utilities until libntfs-3g supports such functionality. 2010-12-02 16:49:56 +01:00
Erik Larsson
07bc8d9d17 Redirected all libntfs includes in the 'extra' utilities to libntfs-3g. 2010-12-02 16:47:06 +01:00
Erik Larsson
5b9b4c7e49 Removing all references to the libntfs library version until we have such functionality in libntfs-3g. 2010-12-02 16:38:16 +01:00
Yura Pakhuchiy
37476cf609 Introduce NTFS_MNT_FORCE instead of third parameter of utils_mount_volume 2007-09-15 18:12:32 +03:00
aia21
5302d23f7b - Empty the journal at mount time. (Anton)
- Set the volume dirty bit at mount time (if it is not set already and
  clear it again at umount time but only if it was not set to start
  with.  (Anton)
2006-11-28 10:09:56 +00:00
yura
cb27c9f616 * Rename MS_{RDONLY,NOATIME} to NTFS_MNT_{RDONLY,NOATIME}.
* Introduce NTFS_MNT_CASE_SENSITIVE.
2006-11-12 22:46:50 +00:00
uvman
a117a21941 Comment documentation fixes. 2006-09-25 16:58:38 +00:00
szaka
c7a53338c0 Fix all incorrect getopt_long() return value usages. 2006-04-05 12:43:06 +00:00
flatcap
9cf4759476 upgrade to use new logging 2005-10-28 18:39:52 +00:00
flatcap
8892ba7ac6 remove some colour hacks
remove a few #ifdef DEBUGs and RM_WRITEs
throw in lots of extra traces
2005-10-28 04:32:21 +00:00
flatcap
8a584700c5 whitespace fixes - no code changes 2005-10-26 22:54:57 +00:00
flatcap
139f6c6603 prevent a few name clashes with the new rm code 2005-10-16 22:37:48 +00:00
antona
0c293d0407 - Add API (actually renamed from what Rich/FlatCap did):
volume.[hc]::ntfs_libntfs_version() which returns a pointer to a
  static const string of the libntfs verion, i.e. at the moment this is
  "8.0.0".  This required moving the version specifications from
  libntfs/Makefile.am to configure.ac.  This should hopefully have the
  sideeffect that I will remember to increment it when incrementing the
  ntfsprogs version number when making a release given the two are
  right under one another.  (Anton)
- Change ALL utilities to display the libntfs version they are running
  on.  This should make debugging easier in the case that people are
  running mismatched utilities/library.  (Anton)
2005-10-07 14:10:56 +00:00
antona
8db479a6b1 Patch from Christophe:
A lot of headers are checked by autoconf (AC_CHECK_HEADERS in configure.ac).
Please find a patch that add the missing "#ifdef" to the source code.
2005-09-28 13:47:47 +00:00
szaka
44e60c37c4 Fix 'make extra' (ntfsmove) compilation 2005-09-24 23:46:54 +00:00
antona
2a104d8eda Megapatch!!! Check evecrything!!! I probably broke everything!!! 2005-09-24 22:54:55 +00:00
flatcap
7a142ef54c got bored. don't read the diffs. 2005-07-06 22:47:01 +00:00
flatcap
949043ab36 Tidy whitespace: trailing space; <space><tab> at the beginning of lines
Fix warnings about sign differences
Fix warnings about unused parameters
Tidy a few functions that didn't have { on a new line
2005-06-19 21:09:40 +00:00
cha0smaster
e323ed6a03 Move utils_pathname_to_inode from to library (dir.c), adapt it for library, rename it to ntfs_pathname_to_inode, update all users. 2005-06-12 18:12:55 +00:00
cantab.net!aia21
1159ab3656 Cleanup the ntfs_mapping_pairs_build enhancement.
(Logical change 1.548)
2004-09-13 09:31:42 +00:00
(none)!yura
27e0e7a0c7 Add @stopped_at parameter to ntfs_mapping_pairs_build and adapt all callers.
(Logical change 1.547)
2004-09-12 18:46:04 +00:00
cantab.net!aia21
06086ae5c7 Add start_vcn parameter to ntfs_get_size_for_mapping_pairs() and
ntfs_mapping_pairs_build() and adapt all callers.

(Logical change 1.533)
2004-09-06 09:27:16 +00:00
!uv
d1b5859785 Warning fixes: shadowing variables.
(Logical change 1.508)
2004-08-20 12:30:34 +00:00
!uv
b01733f10a Comment unused code with #if 0
(Logical change 1.506)
2004-08-20 12:04:47 +00:00
cantab.net!aia21
3423a8a909 Rename uchar_t to ntfschar.
(Logical change 1.392)
2004-05-14 13:02:33 +00:00
cantab.net!aia21
123b1028ec Fix lots of warnings about no prototypes by adding
the 'static' keyword.  (Yuval)

(Logical change 1.381)
2004-04-23 13:55:49 +00:00
cantab.net!aia21
e37d6644b2 Fix what seems to be a cut'n'paste error... bitmap_alloc instead of bitmap_free
2003/10/31 18:10:18+00:00 flatcap.org!ntfs
big reorganisation
extra options
will move any attributes now, including dirs
(prevented it touching metadata)

2003/10/29 18:13:30+00:00 flatcap.org!ntfs
move dump_mem to utils

2003/10/28 15:48:10+00:00 flatcap.org!ntfs

(Logical change 1.299)
2004-03-06 17:42:28 +00:00
cantab.net!aia21
76364af60e Initial revision 2004-03-06 17:42:28 +00:00