diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index e69de29..0000000 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..b790e73 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.build*.log +/clog +/*.rpm +/x86_64/ +/ntfs-3g_ntfsprogs-*.tgz diff --git a/CVE-2015-3202.patch b/CVE-2015-3202.patch new file mode 100644 index 0000000..6e5cf08 --- /dev/null +++ b/CVE-2015-3202.patch @@ -0,0 +1,80 @@ +--- ntfs-3g_ntfsprogs-2015.3.14/libfuse-lite/mount_util.c.ref 2015-03-14 15:10:12.000000000 +0100 ++++ ntfs-3g_ntfsprogs-2015.3.14/libfuse-lite/mount_util.c 2015-05-18 11:02:50.330654300 +0200 +@@ -66,6 +66,7 @@ + return -1; + } + if (res == 0) { ++ char *env = NULL; + char templ[] = "/tmp/fusermountXXXXXX"; + char *tmp; + +@@ -87,8 +88,8 @@ + exit(1); + } + rmdir(tmp); +- execl("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts, +- fsname, mnt, NULL); ++ execle("/sbin/mount", "/sbin/mount", "-F", type, "-o", opts, ++ fsname, mnt, NULL, &env); + fprintf(stderr, "%s: failed to execute /sbin/mount: %s\n", progname, + strerror(errno)); + exit(1); +@@ -120,9 +121,16 @@ + return -1; + } + if (res == 0) { ++ char *env = NULL; ++ + setuid(geteuid()); +- execl("/sbin/umount", "/sbin/umount", !lazy ? "-f" : NULL, mnt, +- NULL); ++ if (lazy) { ++ execle("/sbin/umount", "/sbin/umount", mnt, ++ NULL, &env); ++ } else { ++ execle("/sbin/umount", "/sbin/umount", "-f", mnt, ++ NULL, &env); ++ } + fprintf(stderr, "%s: failed to execute /sbin/umount: %s\n", progname, + strerror(errno)); + exit(1); +@@ -302,6 +310,7 @@ + return 0; + } + if (res == 0) { ++ char *env = NULL; + char templ[] = "/tmp/fusermountXXXXXX"; + char *tmp; + +@@ -325,8 +334,8 @@ + exit(1); + } + rmdir(tmp); +- execl("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts, +- fsname, mnt, NULL); ++ execle("/bin/mount", "/bin/mount", "-i", "-f", "-t", type, "-o", opts, ++ fsname, mnt, NULL, &env); + fprintf(stderr, "%s: failed to execute /bin/mount: %s\n", progname, + strerror(errno)); + exit(1); +@@ -353,11 +362,18 @@ + return -1; + } + if (res == 0) { ++ char *env = NULL; ++ + if (setuid(geteuid())) + fprintf(stderr, "%s: failed to setuid : %s\n", progname, + strerror(errno)); +- execl("/bin/umount", "/bin/umount", "-i", mnt, lazy ? "-l" : NULL, +- NULL); ++ if (lazy) { ++ execle("/bin/umount", "/bin/umount", "-i", mnt, "-l", ++ NULL, &env); ++ } else { ++ execle("/bin/umount", "/bin/umount", "-i", mnt, ++ NULL, &env); ++ } + fprintf(stderr, "%s: failed to execute /bin/umount: %s\n", progname, + strerror(errno)); + exit(1); diff --git a/Makefile b/Makefile deleted file mode 100644 index c221ff6..0000000 --- a/Makefile +++ /dev/null @@ -1,21 +0,0 @@ -# Makefile for source rpm: ntfs-3g -# $Id$ -NAME := ntfs-3g -SPECFILE = $(firstword $(wildcard *.spec)) - -define find-makefile-common -for d in common ../common ../../common ; do if [ -f $$d/Makefile.common ] ; then if [ -f $$d/CVS/Root -a -w $$/Makefile.common ] ; then cd $$d ; cvs -Q update ; fi ; echo "$$d/Makefile.common" ; break ; fi ; done -endef - -MAKEFILE_COMMON := $(shell $(find-makefile-common)) - -ifeq ($(MAKEFILE_COMMON),) -# attept a checkout -define checkout-makefile-common -test -f CVS/Root && { cvs -Q -d $$(cat CVS/Root) checkout common && echo "common/Makefile.common" ; } || { echo "ERROR: I can't figure out how to checkout the 'common' module." ; exit -1 ; } >&2 -endef - -MAKEFILE_COMMON := $(shell $(checkout-makefile-common)) -endif - -include $(MAKEFILE_COMMON) diff --git a/boot-gpl.c b/boot-gpl.c new file mode 100644 index 0000000..cde65cc --- /dev/null +++ b/boot-gpl.c @@ -0,0 +1,101 @@ +/* + * NTFS bootsector, adapted from the vfat one. + */ + +/* mkfs.fat.c - utility to create FAT/MS-DOS filesystems +Copyright (C) 1991 Linus Torvalds +Copyright (C) 1992-1993 Remy Card +Copyright (C) 1993-1994 David Hudson +Copyright (C) 1998 H. Peter Anvin +Copyright (C) 1998-2005 Roman Hodek +Copyright (C) 2008-2014 Daniel Baumann +Copyright (C) 2015 Andreas Bombe +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. +You should have received a copy of the GNU General Public License +along with this program. If not, see . +The complete text of the GNU General Public License +can be found in /usr/share/common-licenses/GPL-3 file. +*/ + +#include "boot.h" + +#define BOOTCODE_SIZE 4136 + +/* The "boot code" we put into the filesystem... it writes a message and +tells the user to try again */ + +#define MSG_OFFSET_OFFSET 3 + +const unsigned char boot_array[BOOTCODE_SIZE] = + +"\xeb\x52\x90" /* jump to code at 0x54 (0x7c54) */ +"NTFS \0" /* NTFS signature */ + +"\0\0\0\0\0\0\0\0\0\0\0\0" /* 72 bytes for device parameters */ +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + /* Boot code run at location 0x7c54 */ +"\x0e" /* push cs */ +"\x1f" /* pop ds */ +"\xbe\x71\x7c" /* mov si, offset message_txt (at location 0x7c71) */ + /* write_msg: */ +"\xac" /* lodsb */ +"\x22\xc0" /* and al, al */ +"\x74\x0b" /* jz key_press */ +"\x56" /* push si */ +"\xb4\x0e" /* mov ah, 0eh */ +"\xbb\x07\x00" /* mov bx, 0007h */ +"\xcd\x10" /* int 10h */ +"\x5e" /* pop si */ +"\xeb\xf0" /* jmp write_msg */ + /* key_press: */ +"\x32\xe4" /* xor ah, ah */ +"\xcd\x16" /* int 16h */ +"\xcd\x19" /* int 19h */ +"\xeb\xfe" /* foo: jmp foo */ +/* message_txt: */ +"This is not a bootable disk. Please insert a bootable floppy and\r\n" +"press any key to try again ... \r\n" + /* At location 0xd4, 298 bytes to reach 0x1fe */ + /* 298 = 4 blocks of 72 then 10 */ +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" +"\0\0\0\0\0\0\0\0\0\0\0\0" + +"\0\0\0\0\0\0\0\0\0\0" + /* Boot signature at 0x1fe */ +"\x55\xaa"; diff --git a/check-mftmirr.patch b/check-mftmirr.patch new file mode 100644 index 0000000..666b244 --- /dev/null +++ b/check-mftmirr.patch @@ -0,0 +1,12 @@ +--- libntfs-3g/volume.c.ref 2017-03-23 10:42:44.000000000 +0100 ++++ libntfs-3g/volume.c 2017-12-20 08:11:51.842424300 +0100 +@@ -959,7 +959,8 @@ + vol->mftmirr_size = l; + } + ntfs_log_debug("Comparing $MFTMirr to $MFT...\n"); +- for (i = 0; i < vol->mftmirr_size; ++i) { ++ /* Windows 10 does not update the full $MFTMirr any more */ ++ for (i = 0; (i < vol->mftmirr_size) && (i < FILE_first_user); ++i) { + MFT_RECORD *mrec, *mrec2; + const char *ESTR[12] = { "$MFT", "$MFTMirr", "$LogFile", + "$Volume", "$AttrDef", "root directory", "$Bitmap", diff --git a/ntfs-3g-CVE-2019-9755.patch b/ntfs-3g-CVE-2019-9755.patch new file mode 100644 index 0000000..d54f7e1 --- /dev/null +++ b/ntfs-3g-CVE-2019-9755.patch @@ -0,0 +1,46 @@ +diff -up ntfs-3g_ntfsprogs-2017.3.23/src/lowntfs-3g.c.CVE-2019-9755 ntfs-3g_ntfsprogs-2017.3.23/src/lowntfs-3g.c +--- ntfs-3g_ntfsprogs-2017.3.23/src/lowntfs-3g.c.CVE-2019-9755 2019-03-29 16:08:22.359920075 -0400 ++++ ntfs-3g_ntfsprogs-2017.3.23/src/lowntfs-3g.c 2019-03-29 16:08:28.237794169 -0400 +@@ -4323,7 +4323,8 @@ int main(int argc, char *argv[]) + else { + ctx->abs_mnt_point = (char*)ntfs_malloc(PATH_MAX); + if (ctx->abs_mnt_point) { +- if (getcwd(ctx->abs_mnt_point, ++ if ((strlen(opts.mnt_point) < PATH_MAX) ++ && getcwd(ctx->abs_mnt_point, + PATH_MAX - strlen(opts.mnt_point) - 1)) { + strcat(ctx->abs_mnt_point, "/"); + strcat(ctx->abs_mnt_point, opts.mnt_point); +@@ -4331,6 +4332,9 @@ int main(int argc, char *argv[]) + /* Solaris also wants the absolute mount point */ + opts.mnt_point = ctx->abs_mnt_point; + #endif /* defined(__sun) && defined (__SVR4) */ ++ } else { ++ free(ctx->abs_mnt_point); ++ ctx->abs_mnt_point = (char*)NULL; + } + } + } +diff -up ntfs-3g_ntfsprogs-2017.3.23/src/ntfs-3g.c.CVE-2019-9755 ntfs-3g_ntfsprogs-2017.3.23/src/ntfs-3g.c +--- ntfs-3g_ntfsprogs-2017.3.23/src/ntfs-3g.c.CVE-2019-9755 2019-03-29 16:08:54.691227528 -0400 ++++ ntfs-3g_ntfsprogs-2017.3.23/src/ntfs-3g.c 2019-03-29 16:09:40.362249397 -0400 +@@ -4123,7 +4123,8 @@ int main(int argc, char *argv[]) + else { + ctx->abs_mnt_point = (char*)ntfs_malloc(PATH_MAX); + if (ctx->abs_mnt_point) { +- if (getcwd(ctx->abs_mnt_point, ++ if ((strlen(opts.mnt_point) < PATH_MAX) ++ && getcwd(ctx->abs_mnt_point, + PATH_MAX - strlen(opts.mnt_point) - 1)) { + strcat(ctx->abs_mnt_point, "/"); + strcat(ctx->abs_mnt_point, opts.mnt_point); +@@ -4131,6 +4132,9 @@ int main(int argc, char *argv[]) + /* Solaris also wants the absolute mount point */ + opts.mnt_point = ctx->abs_mnt_point; + #endif /* defined(__sun) && defined (__SVR4) */ ++ } else { ++ free(ctx->abs_mnt_point); ++ ctx->abs_mnt_point = (char*)NULL; + } + } + } diff --git a/ntfs-3g-big-sectors.patch b/ntfs-3g-big-sectors.patch new file mode 100644 index 0000000..1f4c9c5 --- /dev/null +++ b/ntfs-3g-big-sectors.patch @@ -0,0 +1,379 @@ +--- libntfs-3g/bootsect.c.ref 2017-03-23 10:42:44.000000000 +0100 ++++ libntfs-3g/bootsect.c 2018-05-07 09:11:13.004710800 +0200 +@@ -38,6 +38,7 @@ + #include + #endif + ++#include "param.h" + #include "compat.h" + #include "bootsect.h" + #include "debug.h" +@@ -61,6 +62,7 @@ + { + u32 i; + BOOL ret = FALSE; ++ u16 sectors_per_cluster; + + ntfs_log_debug("Beginning bootsector check.\n"); + +@@ -83,15 +85,27 @@ + case 1: case 2: case 4: case 8: case 16: case 32: case 64: case 128: + break; + default: +- ntfs_log_error("Unexpected sectors per cluster value (%d).\n", +- b->bpb.sectors_per_cluster); +- goto not_ntfs; ++ if ((b->bpb.sectors_per_cluster < 240) ++ || (b->bpb.sectors_per_cluster > 249)) { ++ if (b->bpb.sectors_per_cluster > 128) ++ ntfs_log_error("Unexpected sectors" ++ " per cluster value (code 0x%x)\n", ++ b->bpb.sectors_per_cluster); ++ else ++ ntfs_log_error("Unexpected sectors" ++ " per cluster value (%d).\n", ++ b->bpb.sectors_per_cluster); ++ goto not_ntfs; ++ } + } + + ntfs_log_debug("Checking cluster size.\n"); +- i = (u32)le16_to_cpu(b->bpb.bytes_per_sector) * +- b->bpb.sectors_per_cluster; +- if (i > 65536) { ++ if (b->bpb.sectors_per_cluster > 128) ++ sectors_per_cluster = 1 << (256 - b->bpb.sectors_per_cluster); ++ else ++ sectors_per_cluster = b->bpb.sectors_per_cluster; ++ i = (u32)le16_to_cpu(b->bpb.bytes_per_sector) * sectors_per_cluster; ++ if (i > NTFS_MAX_CLUSTER_SIZE) { + ntfs_log_error("Unexpected cluster size (%d).\n", i); + goto not_ntfs; + } +@@ -171,7 +185,7 @@ + int ntfs_boot_sector_parse(ntfs_volume *vol, const NTFS_BOOT_SECTOR *bs) + { + s64 sectors; +- u8 sectors_per_cluster; ++ u16 sectors_per_cluster; + s8 c; + + /* We return -1 with errno = EINVAL on error. */ +@@ -186,7 +200,10 @@ + * below or equal the number_of_clusters) really belong in the + * ntfs_boot_sector_is_ntfs but in this way we can just do this once. + */ +- sectors_per_cluster = bs->bpb.sectors_per_cluster; ++ if (bs->bpb.sectors_per_cluster > 128) ++ sectors_per_cluster = 1 << (256 - bs->bpb.sectors_per_cluster); ++ else ++ sectors_per_cluster = bs->bpb.sectors_per_cluster; + ntfs_log_debug("SectorsPerCluster = 0x%x\n", sectors_per_cluster); + if (sectors_per_cluster & (sectors_per_cluster - 1)) { + ntfs_log_error("sectors_per_cluster (%d) is not a power of 2." +--- ntfsprogs/mkntfs.8.in.ref 2017-03-23 10:42:44.000000000 +0100 ++++ ntfsprogs/mkntfs.8.in 2018-05-07 09:11:13.014132400 +0200 +@@ -132,7 +132,7 @@ + .TP + \fB\-c\fR, \fB\-\-cluster\-size\fR BYTES + Specify the size of clusters in bytes. Valid cluster size values are powers of +-two, with at least 256, and at most 65536 bytes per cluster. If omitted, ++two, with at least 256, and at most 2097152 bytes (2MB) per cluster. If omitted, + .B mkntfs + uses 4096 bytes as the default cluster size. + .sp +--- ntfsprogs/mkntfs.c.ref 2017-03-23 10:42:44.000000000 +0100 ++++ ntfsprogs/mkntfs.c 2018-05-07 09:11:13.035522300 +0200 +@@ -6,7 +6,7 @@ + * Copyright (c) 2002-2006 Szabolcs Szakacsits + * Copyright (c) 2005 Erik Sornes + * Copyright (c) 2007 Yura Pakhuchiy +- * Copyright (c) 2010-2014 Jean-Pierre Andre ++ * Copyright (c) 2010-2018 Jean-Pierre Andre + * + * This utility will create an NTFS 1.2 or 3.1 volume on a user + * specified (block) device. +@@ -119,6 +119,7 @@ + # endif + #endif + ++#include "param.h" + #include "security.h" + #include "types.h" + #include "attrib.h" +@@ -287,7 +288,7 @@ + ntfs_log_info("Copyright (c) 2002-2006 Szabolcs Szakacsits\n"); + ntfs_log_info("Copyright (c) 2005 Erik Sornes\n"); + ntfs_log_info("Copyright (c) 2007 Yura Pakhuchiy\n"); +- ntfs_log_info("Copyright (c) 2010-2014 Jean-Pierre Andre\n"); ++ ntfs_log_info("Copyright (c) 2010-2018 Jean-Pierre Andre\n"); + ntfs_log_info("\n%s\n%s%s\n", ntfs_gpl, ntfs_bugs, ntfs_home); + } + +@@ -3719,11 +3720,11 @@ + /* + * For huge volumes, grow the cluster size until the number of + * clusters fits into 32 bits or the cluster size exceeds the +- * maximum limit of 64kiB. ++ * maximum limit of NTFS_MAX_CLUSTER_SIZE. + */ + while (volume_size >> (ffs(vol->cluster_size) - 1 + 32)) { + vol->cluster_size <<= 1; +- if (vol->cluster_size > 65535) { ++ if (vol->cluster_size >= NTFS_MAX_CLUSTER_SIZE) { + ntfs_log_error("Device is too large to hold an " + "NTFS volume (maximum size is " + "256TiB).\n"); +@@ -3744,15 +3745,18 @@ + "to, or larger than, the sector size.\n"); + return FALSE; + } +- if (vol->cluster_size > 128 * (u32)opts.sector_size) { ++ /* Before Windows 10 Creators, the limit was 128 */ ++ if (vol->cluster_size > 4096 * (u32)opts.sector_size) { + ntfs_log_error("The cluster size is invalid. It cannot be " +- "more that 128 times the size of the sector " ++ "more that 4096 times the size of the sector " + "size.\n"); + return FALSE; + } +- if (vol->cluster_size > 65536) { ++ if (vol->cluster_size > NTFS_MAX_CLUSTER_SIZE) { + ntfs_log_error("The cluster size is invalid. The maximum " +- "cluster size is 65536 bytes (64kiB).\n"); ++ "cluster size is %lu bytes (%lukiB).\n", ++ (unsigned long)NTFS_MAX_CLUSTER_SIZE, ++ (unsigned long)(NTFS_MAX_CLUSTER_SIZE >> 10)); + return FALSE; + } + vol->cluster_size_bits = ffs(vol->cluster_size) - 1; +@@ -4387,6 +4391,7 @@ + u8 *sd; + FILE_ATTR_FLAGS extend_flags; + VOLUME_FLAGS volume_flags = const_cpu_to_le16(0); ++ int sectors_per_cluster; + int nr_sysfiles; + int buf_sds_first_size; + char *buf_sds; +@@ -4639,8 +4644,11 @@ + * already inserted, so no need to worry about these things. + */ + bs->bpb.bytes_per_sector = cpu_to_le16(opts.sector_size); +- bs->bpb.sectors_per_cluster = (u8)(g_vol->cluster_size / +- opts.sector_size); ++ sectors_per_cluster = g_vol->cluster_size / opts.sector_size; ++ if (sectors_per_cluster > 128) ++ bs->bpb.sectors_per_cluster = 257 - ffs(sectors_per_cluster); ++ else ++ bs->bpb.sectors_per_cluster = sectors_per_cluster; + bs->bpb.media_type = 0xf8; /* hard disk */ + bs->bpb.sectors_per_track = cpu_to_le16(opts.sectors_per_track); + ntfs_log_debug("sectors per track = %ld (0x%lx)\n", +--- ntfsprogs/ntfsclone.c.ref 2017-03-23 10:42:44.000000000 +0100 ++++ ntfsprogs/ntfsclone.c 2018-05-07 09:11:38.245007100 +0200 +@@ -3,7 +3,7 @@ + * + * Copyright (c) 2003-2006 Szabolcs Szakacsits + * Copyright (c) 2004-2006 Anton Altaparmakov +- * Copyright (c) 2010-2016 Jean-Pierre Andre ++ * Copyright (c) 2010-2018 Jean-Pierre Andre + * Special image format support copyright (c) 2004 Per Olofsson + * + * Clone NTFS data and/or metadata to a sparse file, image, device or stdout. +@@ -71,6 +71,7 @@ + */ + #define NTFS_DO_NOT_CHECK_ENDIANS + ++#include "param.h" + #include "debug.h" + #include "types.h" + #include "support.h" +@@ -270,7 +271,6 @@ + + #define LAST_METADATA_INODE 11 + +-#define NTFS_MAX_CLUSTER_SIZE 65536 + #define NTFS_SECTOR_SIZE 512 + + #define rounded_up_division(a, b) (((a) + (b - 1)) / (b)) +@@ -393,7 +393,7 @@ + "Efficiently clone, image, restore or rescue an NTFS Volume.\n\n" + "Copyright (c) 2003-2006 Szabolcs Szakacsits\n" + "Copyright (c) 2004-2006 Anton Altaparmakov\n" +- "Copyright (c) 2010-2016 Jean-Pierre Andre\n\n"); ++ "Copyright (c) 2010-2018 Jean-Pierre Andre\n\n"); + fprintf(stderr, "%s\n%s%s", ntfs_gpl, ntfs_bugs, ntfs_home); + exit(0); + } +@@ -756,7 +756,7 @@ + + static void copy_cluster(int rescue, u64 rescue_lcn, u64 lcn) + { +- char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */ ++ char *buff; + /* vol is NULL if opt.restore_image is set */ + s32 csize = le32_to_cpu(image_hdr.cluster_size); + BOOL backup_bootsector; +@@ -783,6 +783,10 @@ + } + } + ++ buff = (char*)ntfs_malloc(csize); ++ if (!buff) ++ err_exit("Not enough memory"); ++ + // need reading when not about to write ? + if (read_all(fd, buff, csize) == -1) { + +@@ -858,6 +862,7 @@ + perr_printf("Write failed"); + #endif + } ++ free(buff); + } + + static s64 lseek_out(int fd, s64 pos, int mode) +@@ -995,7 +1000,11 @@ + struct progress_bar *progress, u64 *p_counter) + { + s64 i; +- char buff[NTFS_MAX_CLUSTER_SIZE]; ++ char *buff; ++ ++ buff = (char*)ntfs_malloc(csize); ++ if (!buff) ++ err_exit("Not enough memory"); + + memset(buff, 0, csize); + +@@ -1004,6 +1013,7 @@ + perr_exit("write_all"); + progress_update(progress, ++(*p_counter)); + } ++ free(buff); + } + + static void restore_image(void) +@@ -1492,7 +1502,7 @@ + + static void copy_wipe_mft(ntfs_walk_clusters_ctx *image, runlist *rl) + { +- char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */ ++ char *buff; + void *fd; + s64 mft_no; + u32 mft_record_size; +@@ -1522,6 +1532,10 @@ + clusters_per_set = mft_record_size/csize; + records_per_set = 1; + } ++ buff = (char*)ntfs_malloc(mft_record_size); ++ if (!buff) ++ err_exit("Not enough memory"); ++ + mft_no = 0; + ri = rj = 0; + wi = wj = 0; +@@ -1554,6 +1568,7 @@ + } + } + image->current_lcn = current_lcn; ++ free(buff); + } + + /* +@@ -1566,7 +1581,7 @@ + + static void copy_wipe_i30(ntfs_walk_clusters_ctx *image, runlist *rl) + { +- char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */ ++ char *buff; + void *fd; + u32 indx_record_size; + u32 csize; +@@ -1595,6 +1610,10 @@ + clusters_per_set = indx_record_size/csize; + records_per_set = 1; + } ++ buff = (char*)ntfs_malloc(indx_record_size); ++ if (!buff) ++ err_exit("Not enough memory"); ++ + ri = rj = 0; + wi = wj = 0; + if (rl[ri].length) +@@ -1627,6 +1646,7 @@ + } + } + image->current_lcn = current_lcn; ++ free(buff); + } + + static void dump_clusters(ntfs_walk_clusters_ctx *image, runlist *rl) +--- ntfsprogs/ntfsresize.c.ref 2017-03-23 10:42:44.000000000 +0100 ++++ ntfsprogs/ntfsresize.c 2018-05-07 09:11:13.076883400 +0200 +@@ -59,6 +59,7 @@ + #include + #endif + ++#include "param.h" + #include "debug.h" + #include "types.h" + #include "support.h" +@@ -243,8 +244,6 @@ + #define DIRTY_INODE (1) + #define DIRTY_ATTRIB (2) + +-#define NTFS_MAX_CLUSTER_SIZE (65536) +- + static s64 rounded_up_division(s64 numer, s64 denom) + { + return (numer + (denom - 1)) / denom; +@@ -404,7 +403,7 @@ + printf("Copyright (c) 2002-2005 Anton Altaparmakov\n"); + printf("Copyright (c) 2002-2003 Richard Russon\n"); + printf("Copyright (c) 2007 Yura Pakhuchiy\n"); +- printf("Copyright (c) 2011-2016 Jean-Pierre Andre\n"); ++ printf("Copyright (c) 2011-2018 Jean-Pierre Andre\n"); + printf("\n%s\n%s%s", ntfs_gpl, ntfs_bugs, ntfs_home); + } + +@@ -1849,9 +1848,13 @@ + static void copy_clusters(ntfs_resize_t *resize, s64 dest, s64 src, s64 len) + { + s64 i; +- char buff[NTFS_MAX_CLUSTER_SIZE]; /* overflow checked at mount time */ ++ char *buff; + ntfs_volume *vol = resize->vol; + ++ buff = (char*)ntfs_malloc(vol->cluster_size); ++ if (!buff) ++ perr_exit("ntfs_malloc"); ++ + for (i = 0; i < len; i++) { + + lseek_to_cluster(vol, src + i); +@@ -1875,6 +1878,7 @@ + resize->relocations++; + progress_update(&resize->progress, resize->relocations); + } ++ free(buff); + } + + static void relocate_clusters(ntfs_resize_t *r, runlist *dest_rl, s64 src_lcn) +--- include/ntfs-3g/param.h.ref 2017-03-23 10:42:44.000000000 +0100 ++++ include/ntfs-3g/param.h 2018-05-07 09:11:13.088302600 +0200 +@@ -40,6 +40,13 @@ + }; + + /* ++ * Parameters for formatting ++ */ ++ ++ /* Up to Windows 10, the cluster size was limited to 64K */ ++#define NTFS_MAX_CLUSTER_SIZE 2097152 /* Windows 10 Creators allows 2MB */ ++ ++/* + * Parameters for compression + */ + diff --git a/ntfs-3g.spec b/ntfs-3g.spec new file mode 100644 index 0000000..713a9b3 --- /dev/null +++ b/ntfs-3g.spec @@ -0,0 +1,681 @@ +# Pass --with externalfuse to compile against system fuse lib +# Default is internal fuse-lite. +%global with_externalfuse %{?_with_externalfuse:1}%{!?_with_externalfuse:0} + +# For release candidates +# %%global subver -RC + +%global oldrhel 0 + +%if 0%{?rhel} +%if 0%{?rhel} < 7 +%global oldrhel 1 +%endif +%endif + +Name: ntfs-3g +Summary: Linux NTFS userspace driver +Version: 2017.3.23 +Release: 11%{?dist} +License: GPLv2+ +Source0: http://tuxera.com/opensource/%%{name}_ntfsprogs-%%{version}%%{?subver}.tgz +%if %{oldrhel} +Source1: 20-ntfs-config-write-policy.fdi +%endif +URL: http://www.ntfs-3g.org/ +%if %{with_externalfuse} +BuildRequires: fuse-devel +Requires: fuse +%endif +%if 0%{?fedora} +Recommends: ntfs-3g-system-compression +%endif +BuildRequires: libtool, libattr-devel +# ntfsprogs BuildRequires +BuildRequires: libconfig-devel, libgcrypt-devel, gnutls-devel, libuuid-devel +Epoch: 2 +Provides: ntfsprogs-fuse = %{epoch}:%{version}-%{release} +Obsoletes: ntfsprogs-fuse +Provides: fuse-ntfs-3g = %{epoch}:%{version}-%{release} +Patch0: ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch +Patch1: check-mftmirr.patch +Patch2: ntfs-3g-big-sectors.patch +# Fix for ntfsclone crash. +# Discussed with upstream developer but not upstream yet, see: +# https://bugzilla.redhat.com/show_bug.cgi?id=1601146#c4 +Patch3: ntfsclone-full-clusters-bz1601146.patch +# Upstream fix for CVE-2019-9755 +# https://sourceforge.net/p/ntfs-3g/ntfs-3g/ci/85c1634a26faa572d3c558d4cf8aaaca5202d4e9/ +Patch4: ntfs-3g-CVE-2019-9755.patch + +%description +NTFS-3G is a stable, open source, GPL licensed, POSIX, read/write NTFS +driver for Linux and many other operating systems. It provides safe +handling of the Windows XP, Windows Server 2003, Windows 2000, Windows +Vista, Windows Server 2008 and Windows 7 NTFS file systems. NTFS-3G can +create, remove, rename, move files, directories, hard links, and streams; +it can read and write normal and transparently compressed files, including +streams and sparse files; it can handle special files like symbolic links, +devices, and FIFOs, ACL, extended attributes; moreover it provides full +file access right and ownership support. + +%package devel +Summary: Development files and libraries for ntfs-3g +Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} +Requires: pkgconfig +Provides: ntfsprogs-devel = %{epoch}:%{version}-%{release} +# ntfsprogs-2.0.0-17 was never built. 2.0.0-16 was the last build for that +# standalone package. +Obsoletes: ntfsprogs-devel < 2.0.0-17 + +%description devel +Headers and libraries for developing applications that use ntfs-3g +functionality. + +%package -n ntfsprogs +Summary: NTFS filesystem libraries and utilities +# We don't really provide this. This code is dead and buried now. +Provides: ntfsprogs-gnomevfs = %{epoch}:%{version}-%{release} +Obsoletes: ntfsprogs-gnomevfs +# Needed to fix multilib issue +# ntfsprogs-2.0.0-17 was never built. 2.0.0-16 was the last build for that +# standalone package. +Obsoletes: ntfsprogs < 2.0.0-17 + +%description -n ntfsprogs +The ntfsprogs package currently consists of a library and utilities such as +mkntfs, ntfscat, ntfsls, ntfsresize, and ntfsundelete (for a full list of +included utilities see man 8 ntfsprogs after installation). + +%prep +%setup -q -n %{name}_ntfsprogs-%{version}%{?subver} +%patch0 -p1 -b .unsupported +%patch1 -p0 -b .check-mftmirr +%patch2 -p0 -b .big-sectors +%patch3 -p0 -b .ntfsclone +%patch4 -p1 -b .CVE-2019-9755 + +%build +CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64" +%configure \ + --disable-static \ + --disable-ldconfig \ +%if 0%{?_with_externalfuse:1} + --with-fuse=external \ +%endif + --exec-prefix=/ \ +%if %{oldrhel} + --bindir=/bin \ + --sbindir=/sbin \ + --libdir=/%{_lib} \ +%endif + --enable-posix-acls \ + --enable-xattr-mappings \ + --enable-crypto \ + --enable-extras \ + --enable-quarantined +make %{?_smp_mflags} LIBTOOL=%{_bindir}/libtool + +%install +make LIBTOOL=%{_bindir}/libtool DESTDIR=%{buildroot} install +%if %{oldrhel} +rm -rf %{buildroot}/%{_lib}/*.la +rm -rf %{buildroot}/%{_lib}/*.a +%else +rm -rf %{buildroot}%{_libdir}/*.la +rm -rf %{buildroot}%{_libdir}/*.a +%endif + +%if %{oldrhel} +rm -rf %{buildroot}/sbin/mount.ntfs-3g +cp -a %{buildroot}/bin/ntfs-3g %{buildroot}/sbin/mount.ntfs-3g +%else +rm -rf %{buildroot}/%{_sbindir}/mount.ntfs-3g +cp -a %{buildroot}/%{_bindir}/ntfs-3g %{buildroot}/%{_sbindir}/mount.ntfs-3g +%endif + +# Actually make some symlinks for simplicity... +# ... since we're obsoleting ntfsprogs-fuse +%if %{oldrhel} +pushd %{buildroot}/bin +ln -s ntfs-3g ntfsmount +popd +pushd %{buildroot}/sbin +%else +pushd %{buildroot}/%{_bindir} +ln -s ntfs-3g ntfsmount +popd +pushd %{buildroot}/%{_sbindir} +%endif +ln -s mount.ntfs-3g mount.ntfs-fuse +# And since there is no other package in Fedora that provides an ntfs +# mount... +ln -s mount.ntfs-3g mount.ntfs +# Need this for fsck to find it +ln -s ../bin/ntfsck fsck.ntfs +popd + +%if %{oldrhel} +# Compat symlinks +mkdir -p %{buildroot}%{_bindir} +pushd %{buildroot}%{_bindir} +ln -s /bin/ntfs-3g ntfs-3g +ln -s /bin/ntfsmount ntfsmount +popd + +# Put the .pc file in the right place. +mkdir -p %{buildroot}%{_libdir}/pkgconfig/ +mv %{buildroot}/%{_lib}/pkgconfig/libntfs-3g.pc %{buildroot}%{_libdir}/pkgconfig/ +%else +mv %{buildroot}/sbin/* %{buildroot}/%{_sbindir} +rmdir %{buildroot}/sbin +%endif + +# We get this on our own, thanks. +rm -rf %{buildroot}%{_defaultdocdir}/%{name}/README + +%if %{oldrhel} +mkdir -p %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/ +cp -a %{SOURCE1} %{buildroot}%{_datadir}/hal/fdi/policy/10osvendor/ +%endif + +%ldconfig_scriptlets + +%files +%doc AUTHORS ChangeLog CREDITS NEWS README +%if %{oldrhel} +%doc COPYING +%else +%license COPYING +%endif +%if %{oldrhel} +/sbin/mount.ntfs +/sbin/mount.ntfs-3g +/sbin/mount.ntfs-fuse +/sbin/mount.lowntfs-3g +/bin/ntfs-3g +/bin/ntfsmount +#compat symlinks +%{_bindir}/ntfs-3g +%{_bindir}/ntfsmount +%else +%{_sbindir}/mount.ntfs +%{_sbindir}/mount.ntfs-3g +%{_sbindir}/mount.ntfs-fuse +%{_sbindir}/mount.lowntfs-3g +%{_bindir}/ntfs-3g +%{_bindir}/ntfsmount +%endif +%if %{oldrhel} +/bin/ntfs-3g.probe +/bin/lowntfs-3g +%else +%{_bindir}/ntfs-3g.probe +%{_bindir}/lowntfs-3g +%endif +%if %{oldrhel} +/%{_lib}/libntfs-3g.so.* +%else +%{_libdir}/libntfs-3g.so.* +%endif +%{_mandir}/man8/mount.lowntfs-3g.* +%{_mandir}/man8/mount.ntfs-3g.* +%{_mandir}/man8/ntfs-3g* +%if %{oldrhel} +%{_datadir}/hal/fdi/policy/10osvendor/20-ntfs-config-write-policy.fdi +%endif + +%files devel +%{_includedir}/ntfs-3g/ +%if %{oldrhel} +/%{_lib}/libntfs-3g.so +%else +%{_libdir}/libntfs-3g.so +%endif +%{_libdir}/pkgconfig/libntfs-3g.pc + +%files -n ntfsprogs +%doc AUTHORS CREDITS ChangeLog NEWS README +%if %{oldrhel} +%doc COPYING +/bin/ntfscat +/bin/ntfscluster +/bin/ntfscmp +/bin/ntfsfix +/bin/ntfsinfo +/bin/ntfsls +/bin/ntfssecaudit +/bin/ntfsusermap +%else +%license COPYING +%{_bindir}/ntfscat +%{_bindir}/ntfscluster +%{_bindir}/ntfscmp +%{_bindir}/ntfsfix +%{_bindir}/ntfsinfo +%{_bindir}/ntfsls +%{_bindir}/ntfssecaudit +%{_bindir}/ntfsusermap +%endif +# Extras +%if %{oldrhel} +/bin/ntfsck +/bin/ntfsdecrypt +/bin/ntfsdump_logfile +/bin/ntfsfallocate +/bin/ntfsmftalloc +/bin/ntfsmove +/bin/ntfsrecover +/bin/ntfstruncate +/bin/ntfswipe +/sbin/fsck.ntfs +/sbin/mkfs.ntfs +/sbin/mkntfs +/sbin/ntfsclone +/sbin/ntfscp +/sbin/ntfslabel +/sbin/ntfsresize +/sbin/ntfsundelete +%else +%{_bindir}/ntfsck +%{_bindir}/ntfsdecrypt +%{_bindir}/ntfsdump_logfile +%{_bindir}/ntfsfallocate +%{_bindir}/ntfsmftalloc +%{_bindir}/ntfsmove +%{_bindir}/ntfsrecover +%{_bindir}/ntfstruncate +%{_bindir}/ntfswipe +%{_sbindir}/fsck.ntfs +%{_sbindir}/mkfs.ntfs +%{_sbindir}/mkntfs +%{_sbindir}/ntfsclone +%{_sbindir}/ntfscp +%{_sbindir}/ntfslabel +%{_sbindir}/ntfsresize +%{_sbindir}/ntfsundelete +%endif +%{_mandir}/man8/mkntfs.8* +%{_mandir}/man8/mkfs.ntfs.8* +%{_mandir}/man8/ntfs[^m][^o]*.8* +%exclude %{_mandir}/man8/ntfs-3g* + +%changelog +* Fri Mar 29 2019 Tom Callaway - 2:2017.3.23-11 +- add upstream fix for CVE-2019-9755 + +* Mon Mar 11 2019 Kamil Páral - 2:2017.3.23-10 +- add Recommends: ntfs-3g-system-compression. That allows people with + Windows 10 to read system files. + +* Fri Feb 01 2019 Fedora Release Engineering - 2:2017.3.23-9 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild + +* Mon Jul 16 2018 Richard W.M. Jones - 2:2017.3.23-8 +- Fix for ntfsclone crash (RHBZ#1601146). + +* Fri Jul 13 2018 Fedora Release Engineering - 2:2017.3.23-7 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild + +* Mon May 21 2018 Tom Callaway - 2:2017.3.23-6 +- apply updated big sectors patch + +* Mon May 7 2018 Tom Callaway +- big sectors patch from Jean-Pierre André + +* Thu Feb 08 2018 Fedora Release Engineering - 2:2017.3.23-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild + +* Thu Jan 4 2018 Tom Callaway - 2:2017.3.23-4 +- use upstream tarball again (non-free file is removed) +- remove unused CVE-2015-3202 patch + +* Wed Dec 20 2017 Tom Callaway - 2:2017.3.23-3.1 +- test build with patch from Jean-Pierre André to fix the $MFT/$MFTMirr mismatch + +* Thu Aug 03 2017 Fedora Release Engineering - 2:2017.3.23-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild + +* Thu Jul 27 2017 Fedora Release Engineering - 2:2017.3.23-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild + +* Tue May 30 2017 Tom Callaway - 2:2017.3.23-1 +- update to 2017.3.23 + +* Wed Feb 8 2017 Tom Callaway - 2:2016.2.22-4 +- apply patch for CVE-2017-0358 +- NOTE: Fedora does not setuid ntfs-3g, so it should not be vulnerable + but some users might make this change so we applied the patch anyways + +* Wed Nov 2 2016 Tom Callaway - 2:2016.2.22-3 +- enable posix ACLS +- enable xattr mappings + +* Tue Aug 9 2016 Tom Callaway - 2:2016.2.22-2 +- replace non-free ntfsprogs/boot.c with boot-gpl.c (resolves bz1364710) + +* Wed Mar 23 2016 Tom Callaway - 2:2016.2.22-1 +- update to 2016.2.22 + +* Thu Feb 04 2016 Fedora Release Engineering - 2:2015.3.14-5 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild + +* Tue Jan 19 2016 Tom Callaway - 2:2015.3.14-4 +- spec file cleanups + +* Wed Jun 17 2015 Fedora Release Engineering - 2:2015.3.14-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild + +* Fri May 22 2015 Tom Callaway 2:2015.3.14-2 +- fix CVE-2015-3202 + +* Tue Apr 7 2015 Tom Callaway 2:2015.3.14-1 +- update to 2015.3.14 + +* Sat Feb 21 2015 Till Maas - 2:2014.2.15-8 +- Rebuilt for Fedora 23 Change + https://fedoraproject.org/wiki/Changes/Harden_all_packages_with_position-independent_code + +* Tue Jan 13 2015 Tom Callaway - 2:2014.2.15-7 +- add patch to ignore -s option + +* Sun Aug 17 2014 Fedora Release Engineering - 2:2014.2.15-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild + +* Tue Aug 5 2014 Richard W.M. Jones - 2:2014.2.15-5 +- Add upstream patch to fix fstrim so it works on partitions as well + as whole disks. + +* Thu Jul 31 2014 Richard W.M. Jones - 2:2014.2.15-4 +- Upstream patches which add fstrim support. + +* Sat Jun 07 2014 Fedora Release Engineering - 2:2014.2.15-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild + +* Thu Apr 24 2014 Tomáš Mráz - 2:2014.2.15-2 +- Rebuild for new libgcrypt + +* Wed Feb 26 2014 Tom Callaway 2:2014.2.15-1 +- update to 2014.2.15 + +* Sat Aug 03 2013 Fedora Release Engineering - 2:2013.1.13-6 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild + +* Tue May 28 2013 Tom Callaway - 2:2013.1.13-5 +- fix bug preventing reads on compressed files on windows 8 partitions (bz967301) + +* Mon May 6 2013 Tom Callaway - 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) + +* Thu Feb 7 2013 Tom Callaway - 2:2013.1.13-3 +- drop redundant manpages from ntfsprogs subpackage + +* Thu Jan 31 2013 Tom Callaway - 2:2013.1.13-2 +- drop hal files, since hal is very dead + +* Tue Jan 22 2013 Richard W.M. Jones - 2:2013.1.13-1 +- New upstream version 2013.1.13 (RHBZ#902729). +- Drop ntfs-3g-junction-point-fix.patch (now upstream). +- Drop Windows 8 patches x 2 (both now upstream). +- Remove obsolete patches from Fedora git repository. +- Fix .gitignore file. + +* Mon Oct 15 2012 Tom Callaway - 2:2012.1.15-5 +- Limit obsoletes to last ntfsprogs-* versions ( < 2.0.0-17 ) to + minimize yum churn (where it would obsolete itself on every upgrade) + BZ#863641 + +* Thu Oct 4 2012 Tom Callaway - 2:2012.1.15-4 +- add patches from upstream git to add a level of safety in the case where windows 8 + leaves the NTFS filesystem in an unsafe state and Linux access could result in data loss. + Basically, with these patches, Linux will refuse to mount the ntfs partition. For the details + refer to: https://bugzilla.redhat.com/show_bug.cgi?id=859373 + +* Sun Aug 19 2012 Tom Callaway - 2:2012.1.15-3 +- apply upstream fix for junction points (bz849332) + +* Fri Jul 20 2012 Fedora Release Engineering - 2:2012.1.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild + +* Fri Feb 10 2012 Tom Callaway 2:2012.1.15-1 +- update to 2012.1.15 + +* Wed Feb 1 2012 Kay Sievers 2:2011.10.9-3 +- install everything in /usr + https://fedoraproject.org/wiki/Features/UsrMove + +* Fri Jan 13 2012 Fedora Release Engineering - 2:2011.10.9-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild + +* Tue Oct 11 2011 Tom Callaway - 2:2011.10.9-1 +- 2011.10.9-RC +- patch ntfsck to return 0 instead of 1 on unsupported filesystem cases + +* Mon Sep 12 2011 Tom Callaway - 2:2011.4.12-5 +- fix ntfsck symlink (thanks to Chris Smart for catching it) + +* Wed Sep 7 2011 Tom Callaway - 2:2011.4.12-4 +- fix issue preventing some volume types from not working properly (bz735862) +- create fsck.ntfs symlink to ntfsck (bz735612). +- apply cleanups from git trunk for ntfsck (bz 706638) +- apply cleanups from git trunk for ntfsfix (bz 711662, 723562) + +* Mon May 9 2011 Tom Callaway - 2:2011.4.12-3 +- add Obsoletes to resolve multi-lib upgrade issue (bz702671) + +* Mon Apr 25 2011 Tom Callaway - 2:2011.4.12-2 +- add --enable-extras flag (and use it) to ensure proper binary installation + +* Thu Apr 14 2011 Tom Callaway - 2:2011.4.12-1 +- update to 2011.4.12 +- pickup ntfsprogs and obsolete the old separate packages + +* Tue Feb 08 2011 Fedora Release Engineering - 2:2011.1.15-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild + +* Tue Jan 25 2011 Tom Callaway - 2:2011.1.15-1 +- update to 2011.1.15 + +* Mon Oct 11 2010 Tom "spot" Callaway - 2:2010.10.2-1 +- update to 2010.10.2, all patches merged upstream + +* Thu Sep 9 2010 Tom "spot" Callaway - 2:2010.8.8-2 +- add support for context= mount option (Till Maas) (bz502946) + +* Mon Aug 9 2010 Tom "spot" Callaway - 2:2010.8.8-1 +- update to 2010.8.8 + +* Fri Jul 9 2010 Tom "spot" Callaway - 2:2010.6.31-1 +- update to 2010.6.31-RC + +* Fri Jul 9 2010 Tom "spot" Callaway - 2:2010.5.22-1 +- update to 2010.5.22 + +* Tue May 18 2010 Tom "spot" Callaway - 2:2010.5.16-1 +- update to 2010.5.16 +- fix makefile to build secaudit/usermap tools + +* Mon Mar 8 2010 Tom "spot" Callaway - 2:2010.3.6-1 +- update to 2010.3.6 + +* Mon Feb 15 2010 Tom "spot" Callaway - 2:2010.2.6-1 +- update to 2010.2.6-RC +- fix summary text + +* Wed Jan 20 2010 Tom "spot" Callaway - 2:2010.1.16-1 +- update to 2010.1.16 + +* Fri Nov 20 2009 Tom "spot" Callaway - 2:2009.11.14-2 +- missing BuildRequires: libattr-devel + +* Fri Nov 20 2009 Tom "spot" Callaway - 2:2009.11.14-1 +- update to 2009.11.14 + +* Fri Oct 30 2009 Tom "spot" Callaway - 2:2009.10.5-0.1.RC +- bump to 2009.10.5-RC + +* Thu Sep 17 2009 Peter Lemenkov - 2:2009.4.4-3 +- Rebuilt with new fuse + +* Sat Jul 25 2009 Fedora Release Engineering - 2:2009.4.4-2 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild + +* Fri Apr 3 2009 Tom "spot" Callaway - 2:2009.4.4-1 +- update to 4.4, patch for mount issue merged + +* Mon Mar 30 2009 Tom "spot" Callaway - 2:2009.3.8-2 +- Patch from upstream provided as temporary workaround for bz 486619 + +* Thu Mar 26 2009 Tom "spot" Callaway - 2:2009.3.8-1 +- update to 2009.3.8 + +* Wed Feb 25 2009 Fedora Release Engineering - 2:2009.2.1-3 +- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild + +* Mon Feb 16 2009 Tom "spot" Callaway - 2:2009.2.1-2 +- update fdi to fix nautilus mount bug + +* Thu Feb 12 2009 Tom "spot" Callaway - 2:2009.2.1-1 +- update to 2009.2.1 + +* Fri Jan 30 2009 Tom "spot" Callaway - 2:2009.1.1-1 +- new release, new versioning scheme from upstream + +* Thu Jan 8 2009 Tom "spot" Callaway - 2:1.5222-0.2.RC +- move pkgconfig Requires to -devel package where it belongs + +* Mon Dec 22 2008 Tom "spot" Callaway - 2:1.5222-0.1.RC +- 1.5222-RC + +* Tue Dec 2 2008 Tom "spot" Callaway - 2:1.5130-1 +- update to 1.5130 + +* Wed Oct 29 2008 Tom "spot" Callaway - 2:1.5012-4 +- fix hal file to properly ignore internal recovery partitions + +* Wed Oct 29 2008 Tom "spot" Callaway - 2:1.5012-3 +- fix hal file to cover all mount cases (thanks to Richard Hughes) + +* Mon Oct 20 2008 Tom "spot" Callaway - 2:1.5012-2 +- add fdi file to enable hal automounting + +* Wed Oct 15 2008 Tom "spot" Callaway - 2:1.5012-1 +- update to 1.5012 (same code as 1.2926-RC) + +* Mon Sep 22 2008 Tom "spot" Callaway - 2:1.2926-0.1.RC +- update to 1.2926-RC (rawhide, F10) + +* Fri Aug 22 2008 Tom "spot" Callaway - 2:1.2812-1 +- update to 1.2812 + +* Sat Jul 12 2008 Tom "spot" Callaway - 2:1.2712-1 +- update to 1.2712 + +* Mon May 5 2008 Tom "spot" Callaway - 2:1.2506-1 +- update to 1.2506 + +* Tue Apr 22 2008 Tom "spot" Callaway - 2:1.2412-1 +- update to 1.2412 + +* Mon Mar 10 2008 Tom "spot" Callaway - 2:1.2310-2 +- update sources + +* Mon Mar 10 2008 Tom "spot" Callaway - 2:1.2310-1 +- update to 1.2310 +- make -n a noop (bz 403291) + +* Tue Feb 26 2008 Tom "spot" Callaway - 2:1.2216-3 +- rebuild against fixed gcc (PR35264, bugzilla 433546) + +* Tue Feb 19 2008 Fedora Release Engineering - 2:1.2216-2 +- Autorebuild for GCC 4.3 + +* Mon Feb 18 2008 Tom "spot" Callaway 2:1.2216-1 +- update to 1.2216 + +* Tue Nov 20 2007 Tom "spot" Callaway 2:1.1120-1 +- bump to 1.1120 +- default to fuse-lite (internal to ntfs-3g), but enable --with externalfuse + as an option + +* Thu Nov 8 2007 Tom "spot" Callaway 2:1.1104-1 +- bump to 1.1104 + +* Mon Oct 29 2007 Tom "spot" Callaway 2:1.1030-1 +- bump to 1.1030 + +* Sat Oct 6 2007 Tom "spot" Callaway 2:1.1004-1 +- bump to 1.1004 + +* Thu Sep 20 2007 Tom "spot" Callaway 2:1.913-2 +- don't set /sbin/mount.ntfs-3g setuid + +* Mon Sep 17 2007 Tom "spot" Callaway 2:1.913-1 +- bump to 1.913 + +* Sun Aug 26 2007 Tom "spot" Callaway 2:1.826-1 +- bump to 1.826 +- glibc27 patch is upstreamed + +* Fri Aug 24 2007 Tom "spot" Callaway 2:1.810-1 +- bump to 1.810 +- fix license tag +- rebuild for ppc32 + +* Sun Jul 22 2007 Tom "spot" Callaway 2:1.710-1 +- bump to 1.710 +- add compat symlinks + +* Wed Jun 27 2007 Tom "spot" Callaway 2:1.616-1 +- bump to 1.616 + +* Tue May 15 2007 Tom "spot" Callaway 2:1.516-1 +- bump to 1.516 +- fix bugzilla 232031 + +* Sun Apr 15 2007 Tom "spot" Callaway 2:1.417-1 +- bump to 1.417 + +* Sun Apr 15 2007 Tom "spot" Callaway 2:1.416-1 +- bump to 1.416 +- drop patch0, upstreamed + +* Wed Apr 4 2007 Tom "spot" Callaway 2:1.328-2 +- allow non-root users to mount/umount ntfs volumes (Laszlo Dvornik) + +* Sat Mar 31 2007 Tom "spot" Callaway 2:1.328-1 +- bump to 1.328 +- drop patch, use --disable-ldconfig instead + +* Wed Feb 21 2007 Tom "spot" Callaway 2:1.0-1 +- 1.0 release! + +* Fri Jan 19 2007 Tom "spot" Callaway 2:0-0.9.20070118 +- symlink to mount.ntfs + +* Wed Jan 17 2007 Tom "spot" Callaway 2:0-0.8.20070118 +- bump to 20070118 + +* Wed Jan 17 2007 Tom "spot" Callaway 2:0-0.7.20070116 +- bump to latest version for all active dists + +* Wed Jan 3 2007 Tom "spot" Callaway 1:0-0.6.20070102 +- bump to latest version (note that upstream fixed their date mistake) + +* Wed Nov 1 2006 Tom "spot" Callaway 1:0-0.5.20070920 +- add an obsoletes for ntfsprogs-fuse +- make some convenience symlinks + +* Wed Oct 25 2006 Tom "spot" Callaway 1:0-0.4.20070920 +- add some extra Provides + +* Mon Oct 16 2006 Tom "spot" Callaway 1:0-0.3.20070920 +- add explicit Requires on fuse + +* Mon Oct 16 2006 Tom "spot" Callaway 1:0-0.2.20070920 +- fixed versioning (bumped epoch, since it now shows as older) +- change sbin symlink to actual copy to be safe + +* Sun Oct 15 2006 Tom "spot" Callaway 0.1.20070920-1 +- Initial package for Fedora Extras diff --git a/ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch b/ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch new file mode 100644 index 0000000..8fd39c6 --- /dev/null +++ b/ntfs-3g_ntfsprogs-2011.10.9-RC-ntfsck-unsupported-return-0.patch @@ -0,0 +1,16 @@ +diff -up ntfs-3g_ntfsprogs-2011.10.9-RC/ntfsprogs/ntfsck.c.OLD ntfs-3g_ntfsprogs-2011.10.9-RC/ntfsprogs/ntfsck.c +--- ntfs-3g_ntfsprogs-2011.10.9-RC/ntfsprogs/ntfsck.c.OLD 2011-10-11 10:24:02.381335115 -0400 ++++ ntfs-3g_ntfsprogs-2011.10.9-RC/ntfsprogs/ntfsck.c 2011-10-11 10:26:41.513559206 -0400 +@@ -877,7 +877,11 @@ int main(int argc, char **argv) + if (errors) + return 2; + if (unsupported) +- return 1; ++ ntfs_log_info("ntfsck was unable to run properly.\n"); ++ // If we return 1 here, we fail for ntfs services fscking on boot just because ++ // ntfsck isn't smart enough to handle 99% of cases. So, we just return 0. ++ // return 1; ++ return 0; + return 0; + } + diff --git a/ntfsclone-full-clusters-bz1601146.patch b/ntfsclone-full-clusters-bz1601146.patch new file mode 100644 index 0000000..1161510 --- /dev/null +++ b/ntfsclone-full-clusters-bz1601146.patch @@ -0,0 +1,81 @@ +--- ntfsprogs/ntfsclone.c 2018-05-16 18:46:47.114964000 +0200 ++++ ntfsprogs/ntfsclone.c 2018-07-16 14:03:20.273809100 +0200 +@@ -776,6 +776,10 @@ + + /* possible partial cluster holding the backup boot sector */ + backup_bootsector = (lcn + 1)*csize >= full_device_size; ++ buff = (char*)ntfs_malloc(csize); ++ if (!buff) ++ err_exit("Not enough memory"); ++ + if (backup_bootsector) { + csize = full_device_size - lcn*csize; + if (csize < 0) { +@@ -783,10 +787,6 @@ + } + } + +- buff = (char*)ntfs_malloc(csize); +- if (!buff) +- err_exit("Not enough memory"); +- + // need reading when not about to write ? + if (read_all(fd, buff, csize) == -1) { + +@@ -1507,6 +1507,7 @@ + s64 mft_no; + u32 mft_record_size; + u32 csize; ++ u32 buff_size; + u32 bytes_per_sector; + u32 records_per_set; + u32 clusters_per_set; +@@ -1524,15 +1525,18 @@ + /* + * Depending on the sizes, there may be several records + * per cluster, or several clusters per record. ++ * Anyway, full clusters are needed for rescuing bad ones. + */ + if (csize >= mft_record_size) { + records_per_set = csize/mft_record_size; + clusters_per_set = 1; ++ buff_size = csize; + } else { + clusters_per_set = mft_record_size/csize; + records_per_set = 1; ++ buff_size = mft_record_size; + } +- buff = (char*)ntfs_malloc(mft_record_size); ++ buff = (char*)ntfs_malloc(buff_size); + if (!buff) + err_exit("Not enough memory"); + +@@ -1585,6 +1589,7 @@ + void *fd; + u32 indx_record_size; + u32 csize; ++ u32 buff_size; + u32 bytes_per_sector; + u32 records_per_set; + u32 clusters_per_set; +@@ -1601,16 +1606,19 @@ + /* + * Depending on the sizes, there may be several records + * per cluster, or several clusters per record. ++ * Anyway, full clusters are needed for rescuing bad ones. + */ + indx_record_size = image->ni->vol->indx_record_size; + if (csize >= indx_record_size) { + records_per_set = csize/indx_record_size; + clusters_per_set = 1; ++ buff_size = csize; + } else { + clusters_per_set = indx_record_size/csize; + records_per_set = 1; ++ buff_size = indx_record_size; + } +- buff = (char*)ntfs_malloc(indx_record_size); ++ buff = (char*)ntfs_malloc(buff_size); + if (!buff) + err_exit("Not enough memory"); + diff --git a/sources b/sources index e69de29..4d7be77 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +SHA512 (ntfs-3g_ntfsprogs-2017.3.23.tgz) = 3a607f0d7be35204c992d8931de0404fbc52032c13b4240d2c5e6f285c318a28eb2a385d7cf5ac4cd445876aee5baa5753bb636ada0d870d84a9d3fdbce794ef