Commit Graph

54 Commits

Author SHA1 Message Date
Jean-Pierre André
004709fcc1 Silenced warnings about fallthrough situations in switch cases of ntfsprogs
Insert comments to silence compiler about fallthrough situations when
they are wanted.
2020-03-08 09:38:00 +01:00
Erik Larsson
9893ea9ee6 Merge endianness fixes.
Conflicts:
	libntfs-3g/attrib.c
2016-01-28 09:22:42 +01:00
Erik Larsson
9cf04fd2cd Fix incorrect usage of native/little-endian types, signed types, etc.
This is harmless with regard to code generation but if we turn on strict
type checking these type mismatches will result in errors.
2015-12-21 23:55:31 +01:00
Jean-Pierre André
6a1c32e538 Fixed the DESX encryption/decryption in ntfsdecrypt
The DESX encryption/decryption algorithm was different from the Windows one.
2015-04-17 11:00:00 +02:00
Jean-Pierre André
c0287870e1 Returned success from ntfsprogs utilities with options --version and --help
The ntfsprogs used to return failure when option --version or --help
was used, and this has triggered complains from distribution packagers
who use these options in packaging scripts.
With this patch, success is returned (same behavior as gcc).
2014-04-23 10:13:27 +02:00
Jean-Pierre André
fb88692394 Implemented updating an encrypted file in ntfsdecrypt
Existing encrypted files can be updated provided the encryption method
and key can be extracted from the LOGGED_UTILITY_STREAM attribute.
2014-03-11 11:10:33 +01:00
Jean-Pierre André
700015c289 Accepted encryption keys whose EFS purpose is not the first one
X509 certificates have a purpose field restricting what the certificate
can be used for, and EFS encryption is such a purpose. Allow EFS encryption
to be at any position in the list.
2014-03-11 11:06:21 +01:00
Jean-Pierre André
b921b09fb8 Made ntfsdecrypt compatible with libgrypt-1.6
The upcoming libgrypt-1.6 drops the "module" interface which was used
by ntfsdecrypt for decrypting files which were encrypted with the "DESX"
algorithm. This algorithm is a Microsoft variant of DES with a key size
of 128 bits, and is not natively supported by libgrypt. The module interface
made possible to declare an external algorithm so that all the encryption
modes could be processed the same way whether the algorithm was internal
or external.
This patch makes DESX a specific case, so that the module interface is
not needed any more. It is compatible with current libgrypt and upcoming
libgrypt-1.6
2014-01-13 15:21:51 +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
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
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
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
2f33075993 Apply fix from crypto.c to ntfsdecrypt 2007-09-27 16:41:22 +03:00
Yura Pakhuchiy
2d645bae53 Apply latest CVS on top. I will rewrite history properly later. 2007-09-27 16:36:53 +03:00
Yura Pakhuchiy
37476cf609 Introduce NTFS_MNT_FORCE instead of third parameter of utils_mount_volume 2007-09-15 18:12:32 +03:00
Yura Pakhuchiy
ad0c5f59c9 Transparently integrate reading of encrypted files into library
This adds crypto.[ch], several exported functions that you are not interested
to use and dependency on >=libconfig-1.0.1 to read list of PFX files with keys.
See libntfs/config for example configuration file.
2007-08-22 16:55:57 +03:00
Yura Pakhuchiy
8981594cf0 ntfsdecrypt: Fix sparse warnings. 2007-06-30 20:19:25 +03: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
antona
5cd2da96ac Fix compile warnings that have sneaked in. 2006-04-19 22:03:58 +00:00
szaka
c7a53338c0 Fix all incorrect getopt_long() return value usages. 2006-04-05 12:43:06 +00:00
szaka
8d11cc8061 cleanup: use ntfs_attr_readall() 2006-03-27 20:10:39 +00:00
cha0smaster
eba747ac93 * Add NTFS_DEV_LIST define. Use it everywhere instead of linux-ntfs-dev@lists.sf.net.
* Replace all ntfs_log_trace where we ask to send mail to us with ntfs_log_error
2005-12-18 16:27:20 +00:00
flatcap
71c5c068b5 use the new logging
add a few function comments (to help folding)
2005-11-26 23:53:22 +00:00
uvman
5b949d07fa Fix comment formats. 2005-10-28 12:55:41 +00:00
antona
fa2217bafa Minor todying. 2005-10-27 21:55:59 +00:00
antona
0e4a1ca252 Fix ntfsdecrypt endianness bugs thus it now works on OSX running on
a dual G5!  (Anton)
2005-10-27 21:46:00 +00:00
antona
98e5cda13e Add some debugging to ntfsdecrypt.c to allow printing of the private
key after it is decrypted (this is ifdeffed out by default).  (Anton)
2005-10-25 22:12:25 +00:00
antona
3adf923766 Fix compilation and warnings in ntfsdecrypt.c on OSX/gcc4.0.1. The
compilation failure was because we use strnlen() which is gnu
specific and not present on my current version of OSX so ntfsdecrypt
now provides own version if it is not present on system.  (Anton)
2005-10-15 22:30:20 +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
cha0smaster
f80efa5e9a Make ntfsdecrypt compile. 2005-08-26 12:25:13 +00:00
antona
68aab0dacd Minor cleanup. 2005-08-10 11:33:10 +00:00
antona
c9d112e9ea Fix ntfsdecrypt to also work with passwordless files. Note this
requires a patched gnutls library or it still does not work.  (Anton)
2005-08-10 10:17:03 +00:00
antona
8ffbca582f Add comment about broken gnutls empty password handling. 2005-08-09 11:07:26 +00:00
antona
5dd973f683 Fix some memleaks in ntfsdecrypt and do some cleanups there.
Fix testing whether to compile crypto code in configure.ac.
2005-08-09 10:57:40 +00:00
antona
16ed5a54b2 Fix breakage introduced by Yuval. 2005-08-06 14:46:42 +00:00
antona
518c9d6fee Deal with non-password better. 2005-08-06 14:37:31 +00:00
uvman
cd37ed9527 fix a few warnings in ntfsdecrypt and make it work. 2005-08-06 14:17:31 +00:00
antona
d0dd037463 Set password to NULL instead of empty string "" so GNU TLS assumes it is not
encrypted.
2005-08-06 06:11:56 +00:00
antona
640573bf12 Finish next stage in ntfsdecrypt evolution. It is now almost finished in that
it fully works to decrypt any ntfs enecrypted file both from Linux and Windows.
All you need to supply is your private key in form of a .prx file as exported
for example by the cypher command in XP SP2 or otherwise as exported by the
management console's certificate manager plugin.
2005-08-05 23:41:52 +00:00
antona
5b087e6d8a Fix a core dump. 2005-07-28 15:14:40 +00:00
antona
2546690ee1 Add EFS structure definitions to layout.h and adapt ntfsdecrypt for it.
More fixes/cleanups to decrypt.c.
This was all Yuval's work but I did some renaming afterwards and some
whitespace cleanups.
2005-07-28 10:36:31 +00:00
antona
8c54a0b1a9 First pass at massive cleanup of ntfsdectypt/decrypt. 2005-07-27 15:55:42 +00:00
antona
0eb4cfbb42 Some more cleanups I missed last time. 2005-07-27 10:48:46 +00:00