Source: hfsprogs Source-Version: 332.25-11 Severity: wishlist Tags: patch Hi!
The attached patch switches this package from OpenSSL's libcrypto to libmd, which is a smaller library containing only digest functions. It is also available in the base system of most current Unixes. And has no obnoxious 4-clause BSD licensed code. Thanks, Guillem
diff -Naur hfsprogs-332.25/debian/control hfsprogs-332.25.new/debian/control --- hfsprogs-332.25/debian/control 2013-10-24 08:42:58.000000000 +0200 +++ hfsprogs-332.25.new/debian/control 2016-06-07 00:11:46.777328589 +0200 @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 9), libbsd-dev, - libssl-dev + libmd-dev Standards-Version: 3.9.3 Package: hfsprogs diff -Naur hfsprogs-332.25/debian/patches/0000-Use-libmd-instead-of-OpenSSL-s-libcrypto.patch hfsprogs-332.25.new/debian/patches/0000-Use-libmd-instead-of-OpenSSL-s-libcrypto.patch --- hfsprogs-332.25/debian/patches/0000-Use-libmd-instead-of-OpenSSL-s-libcrypto.patch 1970-01-01 01:00:00.000000000 +0100 +++ hfsprogs-332.25.new/debian/patches/0000-Use-libmd-instead-of-OpenSSL-s-libcrypto.patch 2016-06-07 00:12:10.805447738 +0200 @@ -0,0 +1,58 @@ +From 532b3647d7e56f7b0ae02f58b2616a37682d8b83 Mon Sep 17 00:00:00 2001 +From: Guillem Jover <guil...@debian.org> +Date: Tue, 7 Jun 2016 00:08:28 +0200 +Subject: [PATCH] Use libmd instead of OpenSSL's libcrypto + +The former is smaller, has no obnoxious 4-clause BSD license terms, +and is available on most base Unix systems now. +--- + newfs_hfs.tproj/Makefile | 2 +- + newfs_hfs.tproj/makehfs.c | 2 +- + vsdbutil.tproj/Makefile | 2 +- + vsdbutil.tproj/vsdbutil_main.c | 2 +- + 4 files changed, 4 insertions(+), 4 deletions(-) + +--- a/newfs_hfs.tproj/Makefile ++++ b/newfs_hfs.tproj/Makefile +@@ -26,7 +26,7 @@ MAKEFILE = tool.make + NEXTSTEP_INSTALLDIR = /sbin + WINDOWS_INSTALLDIR = /sbin + PDO_UNIX_INSTALLDIR = /sbin +-LIBS = -lcrypto ++LIBS = -lmd + DEBUG_LIBS = $(LIBS) + PROF_LIBS = $(LIBS) + +--- a/newfs_hfs.tproj/makehfs.c ++++ b/newfs_hfs.tproj/makehfs.c +@@ -45,7 +45,7 @@ + #include <string.h> + #include <unistd.h> + +-#include <openssl/sha.h> ++#include <sha.h> + + #include <architecture/byte_order.h> + +--- a/vsdbutil.tproj/Makefile ++++ b/vsdbutil.tproj/Makefile +@@ -24,7 +24,7 @@ MAKEFILE = tool.make + NEXTSTEP_INSTALLDIR = /usr/sbin + WINDOWS_INSTALLDIR = /Library/Executables + PDO_UNIX_INSTALLDIR = /bin +-LIBS = -lcrypto ++LIBS = -lmd + DEBUG_LIBS = $(LIBS) + PROF_LIBS = $(LIBS) + +--- a/vsdbutil.tproj/vsdbutil_main.c ++++ b/vsdbutil.tproj/vsdbutil_main.c +@@ -53,7 +53,7 @@ + + #include <sys/attr.h> + +-#include <openssl/sha.h> ++#include <sha.h> + #include <architecture/byte_order.h> + + struct FinderAttrBuf { diff -Naur hfsprogs-332.25/debian/patches/0001-Create-short-Makefiles-for-Debian.patch hfsprogs-332.25.new/debian/patches/0001-Create-short-Makefiles-for-Debian.patch --- hfsprogs-332.25/debian/patches/0001-Create-short-Makefiles-for-Debian.patch 2013-10-24 08:42:58.000000000 +0200 +++ hfsprogs-332.25.new/debian/patches/0001-Create-short-Makefiles-for-Debian.patch 2016-06-07 00:11:46.777328589 +0200 @@ -85,7 +85,7 @@ +all: newfs_hfs + +newfs_hfs: $(OFILES) -+ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) -lcrypto ++ $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $(OFILES) -lmd + +clean: + $(RM) newfs_hfs $(OFILES) diff -Naur hfsprogs-332.25/debian/patches/0002-Add-exclude-Darwin-specific-code.patch hfsprogs-332.25.new/debian/patches/0002-Add-exclude-Darwin-specific-code.patch --- hfsprogs-332.25/debian/patches/0002-Add-exclude-Darwin-specific-code.patch 2013-10-24 08:42:58.000000000 +0200 +++ hfsprogs-332.25.new/debian/patches/0002-Add-exclude-Darwin-specific-code.patch 2016-06-07 00:12:21.129498933 +0200 @@ -5,32 +5,30 @@ Modify some of the files so that they can be compiled without the Apple owned frameworks in a Debian system (and possibly others). --- - fsck_hfs.tproj/cache.c | 4 ++ - fsck_hfs.tproj/dfalib/BTree.c | 2 + - fsck_hfs.tproj/dfalib/BlockCache.c | 3 + - fsck_hfs.tproj/dfalib/SBTree.c | 2 + - fsck_hfs.tproj/dfalib/SDevice.c | 92 ++++++++++++++++++++--------- - fsck_hfs.tproj/dfalib/SKeyCompare.c | 2 + - fsck_hfs.tproj/dfalib/SRepair.c | 2 + - fsck_hfs.tproj/dfalib/SRuntime.h | 7 ++- - fsck_hfs.tproj/dfalib/SUtils.c | 5 +- - fsck_hfs.tproj/dfalib/SVerify2.c | 7 +++ - fsck_hfs.tproj/dfalib/Scavenger.h | 11 +++- - fsck_hfs.tproj/dfalib/hfs_endian.c | 4 ++ - fsck_hfs.tproj/dfalib/hfs_endian.h | 7 ++- - fsck_hfs.tproj/fsck_hfs.c | 61 +++++++++++++++---- - fsck_hfs.tproj/utilities.c | 8 ++- - include/missing.h | 115 ++++++++++++++++++++++++++++++++++++ - newfs_hfs.tproj/hfs_endian.c | 5 ++ - newfs_hfs.tproj/hfs_endian.h | 5 ++ - newfs_hfs.tproj/makehfs.c | 72 ++++++++++++++++------ - newfs_hfs.tproj/newfs_hfs.c | 74 ++++++++++++++++++++--- - newfs_hfs.tproj/newfs_hfs.h | 26 ++++---- + fsck_hfs.tproj/cache.c | 4 + + fsck_hfs.tproj/dfalib/BTree.c | 2 + fsck_hfs.tproj/dfalib/BlockCache.c | 3 + fsck_hfs.tproj/dfalib/SBTree.c | 2 + fsck_hfs.tproj/dfalib/SDevice.c | 92 ++++++++++++++++++++-------- + fsck_hfs.tproj/dfalib/SKeyCompare.c | 2 + fsck_hfs.tproj/dfalib/SRepair.c | 2 + fsck_hfs.tproj/dfalib/SRuntime.h | 7 +- + fsck_hfs.tproj/dfalib/SUtils.c | 5 - + fsck_hfs.tproj/dfalib/SVerify2.c | 7 ++ + fsck_hfs.tproj/dfalib/Scavenger.h | 11 +++ + fsck_hfs.tproj/dfalib/hfs_endian.c | 4 + + fsck_hfs.tproj/dfalib/hfs_endian.h | 7 +- + fsck_hfs.tproj/fsck_hfs.c | 61 +++++++++++++++---- + fsck_hfs.tproj/utilities.c | 8 ++ + include/missing.h | 115 ++++++++++++++++++++++++++++++++++++ + newfs_hfs.tproj/hfs_endian.c | 5 + + newfs_hfs.tproj/hfs_endian.h | 5 + + newfs_hfs.tproj/makehfs.c | 72 ++++++++++++++++------ + newfs_hfs.tproj/newfs_hfs.c | 74 ++++++++++++++++++++--- + newfs_hfs.tproj/newfs_hfs.h | 26 ++++---- 21 files changed, 429 insertions(+), 85 deletions(-) create mode 100644 include/missing.h -diff --git a/fsck_hfs.tproj/cache.c b/fsck_hfs.tproj/cache.c -index be46195..527088a 100644 --- a/fsck_hfs.tproj/cache.c +++ b/fsck_hfs.tproj/cache.c @@ -26,7 +26,11 @@ @@ -45,11 +43,9 @@ #include <sys/uio.h> #include <unistd.h> #include <string.h> -diff --git a/fsck_hfs.tproj/dfalib/BTree.c b/fsck_hfs.tproj/dfalib/BTree.c -index edd8301..7ad9fe0 100644 --- a/fsck_hfs.tproj/dfalib/BTree.c +++ b/fsck_hfs.tproj/dfalib/BTree.c -@@ -1705,7 +1705,9 @@ OSStatus BTGetInformation (SFCB *filePtr, +@@ -1705,7 +1705,9 @@ OSStatus BTGetInformation (SFCB *fil UInt16 version, BTreeInfoRec *info ) { @@ -59,8 +55,6 @@ BTreeControlBlockPtr btreePtr; -diff --git a/fsck_hfs.tproj/dfalib/BlockCache.c b/fsck_hfs.tproj/dfalib/BlockCache.c -index 1bb952f..e3a28a2 100644 --- a/fsck_hfs.tproj/dfalib/BlockCache.c +++ b/fsck_hfs.tproj/dfalib/BlockCache.c @@ -20,6 +20,9 @@ @@ -73,8 +67,6 @@ #include "SRuntime.h" #include "Scavenger.h" #include "../cache.h" -diff --git a/fsck_hfs.tproj/dfalib/SBTree.c b/fsck_hfs.tproj/dfalib/SBTree.c -index 2fbcd1d..cd81b13 100644 --- a/fsck_hfs.tproj/dfalib/SBTree.c +++ b/fsck_hfs.tproj/dfalib/SBTree.c @@ -322,7 +322,9 @@ ErrorExit: @@ -87,8 +79,6 @@ OSStatus result; UInt32 actualSectorsAdded; -diff --git a/fsck_hfs.tproj/dfalib/SDevice.c b/fsck_hfs.tproj/dfalib/SDevice.c -index bf6f61c..9a46023 100644 --- a/fsck_hfs.tproj/dfalib/SDevice.c +++ b/fsck_hfs.tproj/dfalib/SDevice.c @@ -2,7 +2,7 @@ @@ -195,7 +185,7 @@ if (devBlockSize != 512) { *numBlocks = (devBlockCount * (UInt64)devBlockSize) / 512; -@@ -70,24 +108,24 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -70,24 +108,24 @@ OSErr GetDeviceSize(int driveRefNum, UIn { /* return format list status code */ kFmtLstCode = 6, @@ -225,7 +215,7 @@ ParamBlockRec pb; FormatListRec formatListRecords[kMaxFormatListRecs]; DrvSts status; -@@ -95,22 +133,22 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -95,22 +133,22 @@ OSErr GetDeviceSize(int driveRefNum, UIn OSErr result; unsigned long blocks = 0; @@ -253,7 +243,7 @@ /* Get the current disk's size. */ for( formatListRecIndex = 0; formatListRecIndex < pb.cntrlParam.csParam[0]; -@@ -131,7 +169,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -131,7 +169,7 @@ OSErr GetDeviceSize(int driveRefNum, UIn else if ( driveQElementPtr->dQRefNum == (short)kSonyRefNum ) { /* The drive is a non-SuperDrive floppy which only supports 400K and 800K disks */ @@ -262,7 +252,7 @@ result = DriveStatus(driveQElementPtr->dQDrive, &status); if ( result == noErr ) { -@@ -140,11 +178,11 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -140,11 +178,11 @@ OSErr GetDeviceSize(int driveRefNum, UIn case kSingleSided: blocks = kSingleSidedSize; break; @@ -276,7 +266,7 @@ default: // This should never happen result = paramErr; break; -@@ -155,20 +193,20 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -155,20 +193,20 @@ OSErr GetDeviceSize(int driveRefNum, UIn { /* The drive is not a floppy and it doesn't support ReturnFormatList */ /* so use the dQDrvSz field(s) */ @@ -301,7 +291,7 @@ default: // This should never happen result = paramErr; break; -@@ -177,7 +215,7 @@ OSErr GetDeviceSize(int driveRefNum, UInt64 *numBlocks, UInt32 *blockSize) +@@ -177,7 +215,7 @@ OSErr GetDeviceSize(int driveRefNum, UIn *numBlocks = blocks; *blockSize = 512; @@ -310,7 +300,7 @@ return( result ); #endif } -@@ -188,7 +226,7 @@ OSErr DeviceRead(int device, int drive, void* buffer, SInt64 offset, UInt32 reqB +@@ -188,7 +226,7 @@ OSErr DeviceRead(int device, int drive, #if BSD off_t seek_off; ssize_t nbytes; @@ -319,11 +309,9 @@ *actBytes = 0; seek_off = lseek(device, offset, SEEK_SET); -diff --git a/fsck_hfs.tproj/dfalib/SKeyCompare.c b/fsck_hfs.tproj/dfalib/SKeyCompare.c -index 46e145f..18d99c5 100644 --- a/fsck_hfs.tproj/dfalib/SKeyCompare.c +++ b/fsck_hfs.tproj/dfalib/SKeyCompare.c -@@ -454,7 +454,9 @@ SInt32 CompareExtentKeysPlus( const HFSPlusExtentKey *searchKey, const HFSPlusEx +@@ -454,7 +454,9 @@ SInt32 CompareExtentKeysPlus( const HFSP * The name portion of the key is compared using a 16-bit binary comparison. * This is called from the b-tree code. */ @@ -333,8 +321,6 @@ SInt32 CompareAttributeKeys(const AttributeKey *searchKey, const AttributeKey *trialKey) { -diff --git a/fsck_hfs.tproj/dfalib/SRepair.c b/fsck_hfs.tproj/dfalib/SRepair.c -index 01c1a10..8eb759c 100644 --- a/fsck_hfs.tproj/dfalib/SRepair.c +++ b/fsck_hfs.tproj/dfalib/SRepair.c @@ -1617,7 +1617,9 @@ Output: @@ -347,8 +333,6 @@ OSErr err; HFSMasterDirectoryBlock *mdb; -diff --git a/fsck_hfs.tproj/dfalib/SRuntime.h b/fsck_hfs.tproj/dfalib/SRuntime.h -index 646917b..770e3ef 100644 --- a/fsck_hfs.tproj/dfalib/SRuntime.h +++ b/fsck_hfs.tproj/dfalib/SRuntime.h @@ -27,8 +27,11 @@ @@ -364,7 +348,7 @@ #include <stdlib.h> #include <string.h> #include <stdio.h> -@@ -91,10 +94,12 @@ typedef const unsigned char * ConstStr255Param; +@@ -91,10 +94,12 @@ typedef const unsigned char * ConstStr25 typedef u_int32_t HFSCatalogNodeID; @@ -377,11 +361,9 @@ /* OS error codes */ enum { -diff --git a/fsck_hfs.tproj/dfalib/SUtils.c b/fsck_hfs.tproj/dfalib/SUtils.c -index 72035f0..6e9253e 100644 --- a/fsck_hfs.tproj/dfalib/SUtils.c +++ b/fsck_hfs.tproj/dfalib/SUtils.c -@@ -380,7 +380,8 @@ void InvalidateCalculatedVolumeBitMap( SGlobPtr GPtr ) +@@ -380,7 +380,8 @@ void InvalidateCalculatedVolumeBitMap( S // GPtr->realVCB Real in-memory vcb //------------------------------------------------------------------------------ @@ -400,8 +382,6 @@ /*------------------------------------------------------------------------------- -diff --git a/fsck_hfs.tproj/dfalib/SVerify2.c b/fsck_hfs.tproj/dfalib/SVerify2.c -index 6a47935..c68f3d8 100644 --- a/fsck_hfs.tproj/dfalib/SVerify2.c +++ b/fsck_hfs.tproj/dfalib/SVerify2.c @@ -32,7 +32,9 @@ @@ -414,7 +394,7 @@ #include "BTree.h" #include "BTreePrivate.h" -@@ -1354,8 +1356,13 @@ OSErr CompareVolumeHeader( SGlobPtr GPtr, HFSPlusVolumeHeader *volumeHeader ) +@@ -1354,8 +1356,13 @@ OSErr CompareVolumeHeader( SGlobPtr GPtr * clump size for read-only media is irrelevant we skip the clump size * check to avoid non useful warnings. */ @@ -428,8 +408,6 @@ if ( isWriteable != 0 && volumeHeader->catalogFile.clumpSize != vcb->vcbCatalogFile->fcbClumpSize ) { PrintError(GPtr, E_InvalidClumpSize, 0); -diff --git a/fsck_hfs.tproj/dfalib/Scavenger.h b/fsck_hfs.tproj/dfalib/Scavenger.h -index cf53970..edb3a80 100644 --- a/fsck_hfs.tproj/dfalib/Scavenger.h +++ b/fsck_hfs.tproj/dfalib/Scavenger.h @@ -37,11 +37,16 @@ @@ -450,7 +428,7 @@ #ifdef __cplusplus extern "C" { -@@ -1465,4 +1470,8 @@ extern int AllocateContigBitmapBits (SVCB *vcb, UInt32 numBlocks, UInt32 *actua +@@ -1465,4 +1470,8 @@ extern int AllocateContigBitmapBits (SV }; #endif @@ -459,8 +437,6 @@ +#endif */ + #endif /* __SCAVENGER__ */ -diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.c b/fsck_hfs.tproj/dfalib/hfs_endian.c -index 7fa5385..69500c1 100755 --- a/fsck_hfs.tproj/dfalib/hfs_endian.c +++ b/fsck_hfs.tproj/dfalib/hfs_endian.c @@ -31,7 +31,11 @@ @@ -475,8 +451,6 @@ #include <hfs/hfs_format.h> #include "Scavenger.h" -diff --git a/fsck_hfs.tproj/dfalib/hfs_endian.h b/fsck_hfs.tproj/dfalib/hfs_endian.h -index 52d0c3a..0763d9d 100755 --- a/fsck_hfs.tproj/dfalib/hfs_endian.h +++ b/fsck_hfs.tproj/dfalib/hfs_endian.h @@ -27,9 +27,14 @@ @@ -495,8 +469,6 @@ #include "SRuntime.h" /*********************/ -diff --git a/fsck_hfs.tproj/fsck_hfs.c b/fsck_hfs.tproj/fsck_hfs.c -index 90532fd..f1a18bd 100644 --- a/fsck_hfs.tproj/fsck_hfs.c +++ b/fsck_hfs.tproj/fsck_hfs.c @@ -24,10 +24,14 @@ @@ -644,7 +616,7 @@ ExitThisRoutine: if (lflag) { fcntl(fs_fd, F_THAW_FS, NULL); -@@ -401,16 +423,18 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr ) +@@ -401,16 +423,18 @@ setup( char *dev, int *blockDevice_fdPtr fswritefd = -1; *blockDevice_fdPtr = -1; *canWritePtr = 0; @@ -664,7 +636,7 @@ if ((fsreadfd = open(dev, O_RDONLY)) < 0) { printf("Can't open %s: %s\n", dev, strerror(errno)); return (0); -@@ -419,7 +443,7 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr ) +@@ -419,7 +443,7 @@ setup( char *dev, int *blockDevice_fdPtr /* attempt to get write access to the block device and if not check if volume is */ /* mounted read-only. */ getWriteAccess( dev, blockDevice_fdPtr, canWritePtr ); @@ -673,7 +645,7 @@ if (preen == 0 && !guiControl) printf("** %s", dev); if (nflag || (fswritefd = open(dev, O_WRONLY)) < 0) { -@@ -433,10 +457,14 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr ) +@@ -433,10 +457,14 @@ setup( char *dev, int *blockDevice_fdPtr printf("\n"); /* Get device block size to initialize cache */ @@ -688,7 +660,7 @@ /* calculate the cache block size and total blocks */ if (CalculateCacheSize(userCacheSize, &cacheBlockSize, &cacheTotalBlocks, debug) != 0) { -@@ -463,11 +491,15 @@ setup( char *dev, int *blockDevice_fdPtr, int *canWritePtr ) +@@ -463,11 +491,15 @@ setup( char *dev, int *blockDevice_fdPtr static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr ) { @@ -704,7 +676,7 @@ void * myNamePtr; myPtr = NULL; -@@ -490,6 +522,9 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr +@@ -490,6 +522,9 @@ static void getWriteAccess( char *dev, i } // get count of mounts then get the info for each @@ -714,7 +686,7 @@ myMountsCount = getfsstat( NULL, 0, MNT_NOWAIT ); if ( myMountsCount < 0 ) goto ExitThisRoutine; -@@ -513,8 +548,8 @@ static void getWriteAccess( char *dev, int *blockDevice_fdPtr, int *canWritePtr +@@ -513,8 +548,8 @@ static void getWriteAccess( char *dev, i } myBufPtr++; } @@ -725,8 +697,6 @@ ExitThisRoutine: if ( myPtr != NULL ) free( myPtr ); -diff --git a/fsck_hfs.tproj/utilities.c b/fsck_hfs.tproj/utilities.c -index ee41bef..8e1cd77 100644 --- a/fsck_hfs.tproj/utilities.c +++ b/fsck_hfs.tproj/utilities.c @@ -183,12 +183,14 @@ retry: @@ -757,9 +727,6 @@ (void)strcat(rawbuf, &dp[1]); return (rawbuf); -diff --git a/include/missing.h b/include/missing.h -new file mode 100644 -index 0000000..0a859c4 --- /dev/null +++ b/include/missing.h @@ -0,0 +1,115 @@ @@ -878,8 +845,6 @@ +#define KAUTH_FILESEC_XATTR "com.apple.system.Security" + +#endif -diff --git a/newfs_hfs.tproj/hfs_endian.c b/newfs_hfs.tproj/hfs_endian.c -index 117b7f8..fdf7353 100644 --- a/newfs_hfs.tproj/hfs_endian.c +++ b/newfs_hfs.tproj/hfs_endian.c @@ -30,7 +30,12 @@ @@ -895,8 +860,6 @@ #include <hfs/hfs_format.h> #include "hfs_endian.h" -diff --git a/newfs_hfs.tproj/hfs_endian.h b/newfs_hfs.tproj/hfs_endian.h -index 8d9d01d..5c7ff57 100644 --- a/newfs_hfs.tproj/hfs_endian.h +++ b/newfs_hfs.tproj/hfs_endian.h @@ -29,7 +29,12 @@ @@ -912,8 +875,6 @@ /*********************/ /* BIG ENDIAN Macros */ -diff --git a/newfs_hfs.tproj/makehfs.c b/newfs_hfs.tproj/makehfs.c -index 085222f..7609779 100644 --- a/newfs_hfs.tproj/makehfs.c +++ b/newfs_hfs.tproj/makehfs.c @@ -31,10 +31,16 @@ @@ -935,7 +896,7 @@ #include <errno.h> @@ -47,13 +53,14 @@ - #include <openssl/sha.h> + #include <sha.h> +#if !LINUX #include <architecture/byte_order.h> @@ -949,7 +910,7 @@ #include <hfs/hfs_format.h> #include <hfs/hfs_mount.h> -@@ -129,7 +136,9 @@ static UInt32 Largest __P((UInt32 a, UInt32 b, UInt32 c, UInt32 d )); +@@ -129,7 +136,9 @@ static UInt32 Largest __P((UInt32 a, UIn static void MarkBitInAllocationBuffer __P((HFSPlusVolumeHeader *header, UInt32 allocationBlock, void* sectorBuffer, UInt32 *sector)); @@ -959,7 +920,7 @@ static UInt32 UTCToLocal __P((UInt32 utcTime)); -@@ -158,11 +167,14 @@ void SETOFFSET (void *buffer, UInt16 btNodeSize, SInt16 recOffset, SInt16 vecOff +@@ -158,11 +167,14 @@ void SETOFFSET (void *buffer, UInt16 btN #define ROUNDUP(x, u) (((x) % (u) == 0) ? (x) : ((x)/(u) + 1) * (u)) @@ -976,7 +937,7 @@ /* * make_hfs * -@@ -528,6 +540,7 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp) +@@ -528,6 +540,7 @@ InitMDB(hfsparams_t *defaults, UInt32 dr * Map UTF-8 input into a Mac encoding. * On conversion errors "untitled" is used as a fallback. */ @@ -984,7 +945,7 @@ { UniChar unibuf[kHFSMaxVolumeNameChars]; CFStringRef cfstr; -@@ -553,7 +566,11 @@ InitMDB(hfsparams_t *defaults, UInt32 driveBlocks, HFS_MDB *mdbp) +@@ -553,7 +566,11 @@ InitMDB(hfsparams_t *defaults, UInt32 dr bcopy(&mdbp->drVN[1], defaults->volumeName, mdbp->drVN[0]); defaults->volumeName[mdbp->drVN[0]] = '\0'; } @@ -996,7 +957,7 @@ mdbp->drFndrInfo[4] = SET_HFS_TEXT_ENCODING(defaults->encodingHint); mdbp->drWrCnt = kWriteSeqNum; -@@ -1100,9 +1117,11 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header +@@ -1100,9 +1117,11 @@ InitCatalogRoot_HFSPlus(const hfsparams_ UInt16 nodeSize; SInt16 offset; UInt32 unicodeBytes; @@ -1008,7 +969,7 @@ int index = 0; nodeSize = dp->catalogNodeSize; -@@ -1122,7 +1141,9 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header +@@ -1122,7 +1141,9 @@ InitCatalogRoot_HFSPlus(const hfsparams_ * First record is always the root directory... */ ckp = (HFSPlusCatalogKey *)((UInt8 *)buffer + offset); @@ -1019,7 +980,7 @@ /* Use CFString functions to get a HFSPlus Canonical name */ cfstr = CFStringCreateWithCString(kCFAllocatorDefault, (char *)dp->volumeName, kCFStringEncodingUTF8); cfOK = _CFStringGetFileSystemRepresentation(cfstr, canonicalName, sizeof(canonicalName)); -@@ -1139,6 +1160,7 @@ InitCatalogRoot_HFSPlus(const hfsparams_t *dp, const HFSPlusVolumeHeader *header +@@ -1139,6 +1160,7 @@ InitCatalogRoot_HFSPlus(const hfsparams_ dp->volumeName, kDefaultVolumeNameStr); } CFRelease(cfstr); @@ -1027,7 +988,7 @@ ckp->nodeName.length = SWAP_BE16 (ckp->nodeName.length); unicodeBytes = sizeof(UniChar) * SWAP_BE16 (ckp->nodeName.length); -@@ -1821,15 +1843,15 @@ WriteBuffer(const DriveInfo *driveInfo, UInt64 startingSector, UInt32 byteCount, +@@ -1821,15 +1843,15 @@ WriteBuffer(const DriveInfo *driveInfo, off_t sector; if ((byteCount % driveInfo->sectorSize) != 0) @@ -1046,7 +1007,7 @@ } -@@ -1913,7 +1935,7 @@ DivideAndRoundUp(UInt32 numerator, UInt32 denominator) +@@ -1913,7 +1935,7 @@ DivideAndRoundUp(UInt32 numerator, UInt3 return quotient; } @@ -1064,7 +1025,7 @@ static int ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf, -@@ -2006,6 +2028,9 @@ ConvertUTF8toUnicode(const UInt8* source, UInt32 bufsize, UniChar* unibuf, +@@ -2006,6 +2028,9 @@ ConvertUTF8toUnicode(const UInt8* source static int getencodinghint(unsigned char *name) { @@ -1084,7 +1045,7 @@ } -@@ -2034,12 +2060,14 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) { +@@ -2034,12 +2060,14 @@ void GenerateVolumeUUID(VolumeUUID *newV unsigned char digest[20]; time_t now; clock_t uptime; @@ -1102,7 +1063,7 @@ do { /* Initialize the SHA-1 context for processing: */ -@@ -2052,52 +2080,58 @@ void GenerateVolumeUUID(VolumeUUID *newVolumeID) { +@@ -2052,52 +2080,58 @@ void GenerateVolumeUUID(VolumeUUID *newV SHA1_Update(&context, &uptime, sizeof(uptime)); /* The kernel's boot time: */ @@ -1167,8 +1128,6 @@ /* The current GMT (26 ASCII characters): */ time(&now); strncpy(randomInputBuffer, asctime(gmtime(&now)), 26); /* "Mon Mar 27 13:46:26 2000" */ -diff --git a/newfs_hfs.tproj/newfs_hfs.c b/newfs_hfs.tproj/newfs_hfs.c -index c4176a9..bf2ed21 100644 --- a/newfs_hfs.tproj/newfs_hfs.c +++ b/newfs_hfs.tproj/newfs_hfs.c @@ -38,8 +38,13 @@ @@ -1274,7 +1233,7 @@ } exit(0); -@@ -506,7 +527,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw) +@@ -506,7 +527,9 @@ hfs_newfs(char *device, int forceHFS, in int fso = 0; int retval = 0; hfsparams_t defaults = {0}; @@ -1284,7 +1243,7 @@ if (gPartitionSize) { dip.sectorSize = kBytesPerSector; -@@ -526,6 +549,34 @@ hfs_newfs(char *device, int forceHFS, int isRaw) +@@ -526,6 +549,34 @@ hfs_newfs(char *device, int forceHFS, in if (fstat( fso, &stbuf) < 0) fatal("%s: %s", device, strerror(errno)); @@ -1319,7 +1278,7 @@ if (ioctl(fso, DKIOCGETBLOCKCOUNT, &dip.totalSectors) < 0) fatal("%s: %s", device, strerror(errno)); -@@ -537,11 +588,14 @@ hfs_newfs(char *device, int forceHFS, int isRaw) +@@ -537,11 +588,14 @@ hfs_newfs(char *device, int forceHFS, in dip.sectorsPerIO = (128 * 1024) / dip.sectorSize; /* use 128K as default */ else dip.sectorsPerIO = MIN(maxSectorsPerIO, (1024 * 1024) / dip.sectorSize); @@ -1334,7 +1293,7 @@ if (dip.sectorSize != kBytesPerSector) { if (isRaw) { close(fso); -@@ -556,7 +610,9 @@ hfs_newfs(char *device, int forceHFS, int isRaw) +@@ -556,7 +610,9 @@ hfs_newfs(char *device, int forceHFS, in dip.sectorSize = kBytesPerSector; } } @@ -1344,8 +1303,6 @@ dip.sectorOffset = 0; time(&createtime); -diff --git a/newfs_hfs.tproj/newfs_hfs.h b/newfs_hfs.tproj/newfs_hfs.h -index 968ff10..5680a34 100644 --- a/newfs_hfs.tproj/newfs_hfs.h +++ b/newfs_hfs.tproj/newfs_hfs.h @@ -19,8 +19,12 @@ diff -Naur hfsprogs-332.25/debian/patches/series hfsprogs-332.25.new/debian/patches/series --- hfsprogs-332.25/debian/patches/series 2013-10-24 08:42:58.000000000 +0200 +++ hfsprogs-332.25.new/debian/patches/series 2016-06-07 00:12:03.425411143 +0200 @@ -1,3 +1,4 @@ +0000-Use-libmd-instead-of-OpenSSL-s-libcrypto.patch 0001-Create-short-Makefiles-for-Debian.patch 0002-Add-exclude-Darwin-specific-code.patch 0003-Add-helper-include-files-absent-from-the-upstream-pa.patch