Merge branch 'master' into libntfs-3g_port-edge

Conflicts:
	configure.ac
	libntfs/bootsect.c
	libntfs/logging.c
	ntfsprogs/ntfsmount.c
edge.strict_endians
Erik Larsson 2010-12-19 08:43:56 +01:00
commit ef0190cbd7
5 changed files with 30 additions and 26 deletions

View File

@ -1,3 +1,14 @@
xx/xx/2007 - 2.0.1
- Avoid endless loop when try to mount highly damaged volume with
nubmer of sectors set to 0. (Yura, reported by Erik Larsson)
- Raise FUSE dependency to 2.7.0 because we use user option in
ntfsmount. (Yura, reported by Andrey Rahmatullin)
- ntfsck: Use ntfs_pread instead ops->pread. (Yura, reported by
Christophe GRENIER)
- ntfsclone: Allow metadata cloning to block devices when --force
option is supplied. (Anton)
28/09/2007 - 2.0.0 - ntfsmount sports full read/write, libntfs can read
encrypted files and ntfsresize supports Vista.

View File

@ -12,9 +12,9 @@ NTFS volumes if\fB libntfs\fR was compiled with \fB--enable-crypto\fR option
(it depends on\fB libgcrypt\fR,\fB GNU TLS\fR and \fBlibconfig\fR) and user
wrote configuration file. Configuration file should be placed in
\fB/etc/libntfs/config\fR or \fB$(HOME)/.libntfs/config\fR and contain list
of .PFX key files (see ntfsprogs-<version>/libntfs/config in ntfsprogs source
tarball for sample configuration file). Key files can be created/exported
using\fB cipher\fR tool under windows.
of .PFX key files (see \fBntfsprogs-@VERSION@/libntfs/config\fR in ntfsprogs
sources tarball for sample configuration file). Key files can be
created/exported using\fB cipher\fR tool under windows.
.SH AUTHORS
\fBlibntfs\fR was written by Anton Altaparmakov, Richard Russon, Szabolcs Szakacsits, Yuval Fledel and Yura Pakhuchiy.
.SH AVAILABILITY

View File

@ -198,7 +198,7 @@ static BOOL verify_boot_sector(struct ntfs_device *dev)
current_mft_record = 9;
if (dev->d_ops->pread(dev, buf, sizeof(buf), 0)!=sizeof(buf)) {
if (ntfs_pread(dev, 0, sizeof(buf), buf) != sizeof(buf)) {
check_failed("Failed to read boot sector.\n");
return 1;
}
@ -260,7 +260,8 @@ static runlist *load_runlist(struct ntfs_device *dev, s64 offset_to_file_record,
if (!buf)
return NULL;
if (dev->d_ops->pread(dev, buf, size_of_file_record, offset_to_file_record)!=size_of_file_record) {
if (ntfs_pread(dev, offset_to_file_record, size_of_file_record, buf) !=
size_of_file_record) {
check_failed("Failed to read file record at offset %lld (0x%llx).\n", offset_to_file_record, offset_to_file_record);
return NULL;
}

View File

@ -422,9 +422,17 @@ static void parse_options(int argc, char **argv)
if (S_ISBLK(st.st_mode)) {
opt.blkdev_out = 1;
if (opt.metadata)
if (opt.metadata && !opt.force)
err_exit("Cloning only metadata to a "
"block device isn't supported!\n");
"block device does not usually "
"make sense, aborting...\n"
"If you were instructed to do "
"this by a developer and/or are "
"sure that this is what you want "
"to do, run this utility again "
"but this time add the force "
"option, i.e. add '--force' to "
"the command line arguments.");
}
}
}
@ -523,6 +531,8 @@ static int io_all(void *fd, void *buf, int count, int do_write)
if (i < 0) {
if (errno != EAGAIN && errno != EINTR)
return -1;
} else if (i == 0 && !do_write && opt.restore_image) {
return -1;
} else {
count -= i;
buf = i + (char *) buf;

View File

@ -88,7 +88,6 @@ static struct options {
const char *device; /* Device/File to work with */
const char *filename; /* Resolve this filename to mft number */
s64 inode; /* Info for this inode */
int debug; /* Debug output */
int quiet; /* Less output */
int verbose; /* Extra output */
int force; /* Override common sense */
@ -138,9 +137,6 @@ static void usage(void)
" -v, --verbose More output\n"
" -V, --version Display version information\n"
" -h, --help Display this help\n"
#ifdef DEBUG
" -d, --debug Show debug information\n"
#endif
"\n",
EXEC_NAME);
printf("%s%s\n", ntfs_bugs, ntfs_home);
@ -159,9 +155,6 @@ static int parse_options(int argc, char *argv[])
{
static const char *sopt = "-:dfhi:F:mqtTvV";
static const struct option lopt[] = {
#ifdef DEBUG
{ "debug", no_argument, NULL, 'd' },
#endif
{ "force", no_argument, NULL, 'f' },
{ "help", no_argument, NULL, 'h' },
{ "inode", required_argument, NULL, 'i' },
@ -193,9 +186,6 @@ static int parse_options(int argc, char *argv[])
else
err++;
break;
case 'd':
opts.debug++;
break;
case 'i':
if ((opts.inode != -1) ||
(!utils_parse_size(optarg, &opts.inode, FALSE))) {
@ -281,7 +271,7 @@ static int parse_options(int argc, char *argv[])
err++;
}
if ((opts.inode == -1) && (opts.filename == NULL) && !opts.mft) {
if (opts.inode == -1 && !opts.filename && !opts.mft) {
if (argc > 1)
ntfs_log_error("You must specify an inode to "
"learn about.\n");
@ -303,14 +293,6 @@ static int parse_options(int argc, char *argv[])
}
#ifdef DEBUG
if (!opts.debug)
if (!freopen("/dev/null", "w", stderr)) {
ntfs_log_perror("Failed to freopen stderr to /dev/null");
exit(1);
}
#endif
if (ver)
version();
if (help || err)