fix bug preventing ability to read compressed files from windows 8 partitions (bz967301)

epel9
Tom Callaway 12 years ago
parent e3e74104dc
commit 8a4f93d917

@ -0,0 +1,39 @@
--- libntfs-3g/compress.c.ref 2013-05-07 10:50:28.000000000 +0200
+++ libntfs-3g/compress.c 2013-05-13 16:37:17.000000000 +0200
@@ -5,7 +5,7 @@
* Copyright (c) 2004-2005 Anton Altaparmakov
* Copyright (c) 2004-2006 Szabolcs Szakacsits
* Copyright (c) 2005 Yura Pakhuchiy
- * Copyright (c) 2009-2011 Jean-Pierre Andre
+ * Copyright (c) 2009-2013 Jean-Pierre Andre
*
* This program/include file is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as published
@@ -753,6 +753,7 @@
ofs = 0;
} else {
s64 tdata_size, tinitialized_size;
+ int decompsz;
/*
* Compressed cb, decompress it into the temporary buffer, then
@@ -810,7 +811,10 @@
if (cb_pos + 2 <= cb_end)
*(u16*)cb_pos = 0;
ntfs_log_debug("Successfully read the compression block.\n");
- if (ntfs_decompress(dest, cb_size, cb, cb_size) < 0) {
+ /* Do not decompress beyond the requested block */
+ to_read = min(count, cb_size - ofs);
+ decompsz = ((ofs + to_read - 1) | (NTFS_SB_SIZE - 1)) + 1;
+ if (ntfs_decompress(dest, decompsz, cb, cb_size) < 0) {
err = errno;
free(cb);
free(dest);
@@ -819,7 +823,6 @@
errno = err;
return -1;
}
- to_read = min(count, cb_size - ofs);
memcpy(b, dest + ofs, to_read);
total += to_read;
count -= to_read;

@ -8,7 +8,7 @@
Name: ntfs-3g
Summary: Linux NTFS userspace driver
Version: 2013.1.13
Release: 4%{?dist}
Release: 5%{?dist}
License: GPLv2+
Group: System Environment/Base
Source0: http://tuxera.com/opensource/%{name}_ntfsprogs-%{version}%{?subver}.tgz
@ -29,6 +29,8 @@ Patch0: ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch
Patch1: ntfsck.c.4Ksectors.patch
# https://bugzilla.redhat.com/show_bug.cgi?id=958681
Patch2: ntfs-3g-truncated-check.patch
# http://tuxera.com/forum/viewtopic.php?p=37574#p37574
Patch3: compress-lastblock-v2.patch
%description
NTFS-3G is a stable, open source, GPL licensed, POSIX, read/write NTFS
@ -76,6 +78,7 @@ included utilities see man 8 ntfsprogs after installation).
%patch0 -p1 -b .unsupported
%patch1 -p0 -b .4k
%patch2 -p0 -b .truncated
%patch3 -p0 -b .compressfix
%build
CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64"
@ -174,6 +177,9 @@ rm -rf %{buildroot}%{_defaultdocdir}/%{name}/README
%exclude %{_mandir}/man8/ntfs-3g*
%changelog
* Tue May 28 2013 Tom Callaway <spot@fedoraproject.org> - 2:2013.1.13-5
- fix bug preventing reads on compressed files on windows 8 partitions (bz967301)
* Mon May 6 2013 Tom Callaway <spot@fedoraproject.org> - 2:2013.1.13-4
- apply fixes from upstream for issue with 4K sector drives (bz951603)
and truncated check for Interix types on a 32-bit CPU (bz958681)

Loading…
Cancel
Save