Commit Graph

64 Commits (1df34a605628f0a393ce5605e648b0203b9ca6d3)

Author SHA1 Message Date
Jean-Pierre André 1df34a6056 New : implemented an option -d to clear the dirty flag if ntfsfix is successful 2011-11-04 11:15:01 +01:00
Jean-Pierre André cb3aad8a63 Minor : fixed a test of volume dirty flag in ntfsfix 2011-11-04 11:11:40 +01:00
Jean-Pierre André c42c502e92 Developped fixing of a self-located MFT data bug in ntfsfix
Under some rare and obscure circumstances probably unrelated to ntfs-3g,
a part of the runlist of MFT describes its own location, therefore
it cannot be loaded. This patch relocates the MFT extent to inode 15
to fix this. Note : chkdsk cannot fix it and destroys all the files.
2011-10-07 11:33:22 +02:00
Jean-Pierre André 2cc1bcb59d Fixed compiling ntfsfix.c for a Sparc 2011-07-06 17:46:31 +02:00
Jean-Pierre André de151c1add Implemented a new option to clear the list of bad sectors 2011-07-05 12:17:31 +02:00
Jean-Pierre André 1c1c0540e8 Fixed use of uninitialized variable in ntfsfix 2011-07-05 12:17:29 +02:00
Jean-Pierre André 44116675ca Fixed warning for possible use of uninitialized variable in ntfsfix 2011-07-05 12:17:28 +02:00
Jean-Pierre André 86ce44ac58 Made ntfsfix able to use a backup boot sector larger than 512 bytes
When the normal boot sector is not usable, ntfsfix tries to use the last
sector as a boot sector replacement. This implies getting the sector size
and reading both full-sized boot sectors.
2011-03-23 09:46:46 +01:00
Jean-Pierre André 4b408e60ae Strenghtened types in ntfslabel and ntfsfix 2011-03-23 09:27:33 +01:00
Jean-Pierre André 1e7d8809a8 Fixed freeing upcase in ntfsfix (avoiding memory leak detection)
Under some error condition, the upcase table was not freed.
Just cosmetic fix to avoid a memory leak detection.
2011-03-23 09:16:57 +01:00
Jean-Pierre André 309ca32e52 Silenced warning for function with no return 2011-02-08 13:52:13 +01:00
Jean-Pierre André 6b570dfe96 Added tries to fix file systems with incorrect size 2011-02-08 13:52:13 +01:00
Jean-Pierre André a46a395006 Updated copyright notices 2011-02-08 13:52:12 +01:00
Jean-Pierre André 2842936b74 Checked and fixed the upcase table in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André b0849af206 Tried alternate boot sector if cannot start up in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André 9f765effd3 Defined option -n for no action in ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André c60ae578bd Exited with failure code from ntfsfix.c 2011-02-08 13:52:12 +01:00
Jean-Pierre André f22dec0442 Silenced warnings for formats in ntfsfix.c 2010-12-21 15:51:07 +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 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 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 f5f3878a8e Replaced all occurrences of the libntfs-specific NVolWasDirty macro with a test for the VOLUME_IS_DIRTY flag in vol->flags.
This is not a perfect conversion. The VOLUME_IS_DIRTY flag reflects the _current_ state of the volume dirty bit and not the mount-time state.
However, since libntfs-3g (as opposed to libntfs) does not automatically change the dirty bit on mount and unmount (only when ntfs_volume_write_flags is called explicitly), and these tests are done directly after a mount (ntfsclone.c, ntfscp.c, ntfsresize.c, ntfswipe.c, utils.c) or when the volume is in an appropriate state (ntfsfix.c), the result will be the same.
2010-12-02 22:34:35 +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 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
Erik Larsson f03d683fa0 Commented out all references to 'version.h' (which doesn't exist in libntfs-3g) and added a stub implementation of ntfs_libntfs_version in utils.h to allow things to compile. 2010-12-02 15:58:14 +01:00
Erik Larsson 1860eff1da Updated all includes in the basic ntfsprogs utilities for libntfs-3g. 2010-12-02 15:57:58 +01:00
Yura Pakhuchiy 0d264b7d25 Introduce sparse endian annotations. Adopt library (also fix 2 real bugs) and progs (lots of bugs). 2007-06-08 13:47:57 +03:00
yura 10b22550cd more sparse fixes
left only endianness and this stupid problems with s64
2006-12-12 19:00:00 +00:00
aia21 a38ead2f20 Szaka prefers to have the lofgile reset and dirty bit setting done even if they
are already done so remove the conditionals I added.
2006-12-11 10:41:34 +00:00
aia21 8640540b53 Warn about VOLUME_MOUNTED_ON_NT4 wrt Vista in layout.h and do not set the flag
in ntfsfix.
2006-12-09 11:27:37 +00: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
szaka c7a53338c0 Fix all incorrect getopt_long() return value usages. 2006-04-05 12:43:06 +00:00
szaka 0887a0e261 Update a few copyrights 2006-03-29 22:54:22 +00:00
antona 8bf1dc2232 Update my copyright for the files changed in the last commits. 2006-03-27 22:49:50 +00:00
antona cf631e3398 Fix comparison of $MFT and $MFTMirr to not bail out when there are
unused, invalid mft records which are the same in both $MFT and
$MFTMirr.  Ported from kernel driver 2.1.27 release and aplied both
to libntfs/volume.c mount related code and to ntfsprogs/ntfsfix.c's
fixup code.  (Anton)
2006-03-27 22:43:09 +00:00
szaka 67f0045637 Update obsolete description 2006-02-12 02:00:45 +00:00
flatcap abf0cfba5d use new logging 2005-11-20 14:15:33 +00:00
flatcap 8a584700c5 whitespace fixes - no code changes 2005-10-26 22:54:57 +00:00
uvman 0dd0cdc6be Remove {Dputs, Dprintf, Dperror} and convert callers to ntfs_log_*. Make ntfsinfo use ntfs_logging_parse_option(). 2005-10-25 01:28:10 +00:00
szaka dd3ce28cd2 Factor out fix_mount() and fix_mftmirr() from main()
Avoid freeing NULL's to end non-constuctive discussion about its usage
2005-10-22 19:54:01 +00:00
flatcap f4e427e91a implement logging in libntfs
fix whitespace
fix build problems
tidy source code
and more...
2005-10-21 18:05:13 +00:00
antona 1d4958d38c Fix endianness bug (le16 instead of le32 when accessing mft record
bytes_in_use) in volume.c::ntfs_volume_write_flags() and
ntfsfix.c::OLD_ntfs_volume_set_flags().  (Anton)
2005-10-15 23:13:49 +00:00
flatcap 42de4cf905 tidy up some __attribute__ usage 2005-10-12 11:52:40 +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
cha0smaster 3814896a5b fix compiler warning 2005-10-07 13:26:44 +00:00
antona aa7e3cc98e return volume set dirty functionality to ntfsfix on Yura's request. Anton 2005-10-05 13:01:10 +00:00
uvman 62579b84d4 compiler warnings fixes. 2005-10-04 20:36:42 +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
antona 2a104d8eda Megapatch!!! Check evecrything!!! I probably broke everything!!! 2005-09-24 22:54:55 +00:00
szaka 9f50872ec2 Spelling typos, Debian bug #300073 2005-07-12 16:18:10 +00:00