The branch, master has been updated via 67126ed s3-waf: Reduce dependencies of winbindd. via c85e60b s3-waf: Reduce dependencies of smbd_base. via 6d06a31 s3-waf: Fix cups dependency in PRINTING. via 0dcc51e s3-waf: Add missing dependency to LIBNET. via a5b4a47 s3-waf: Add missing dependency to RPC_WINREG. via c4b05ec s3-waf: Reduce libsmbclient dependencies. via 1a4e4f0 s3-waf: Reduce libnetapi dependencies. via 63c7118 s3-waf: Link vlp only against needed subsystems. via 2fa6c5e s3-waf: Link split_tokens only against needed subsystems. via 5b8a22e s3-waf: Link dbwrap_torture only against needed subsystems. via 9f917c0 s3-waf: Link dbwrap_tool only against needed subsystems. via de1836f s3-waf: Link test_lp_load only against needed subsystems. via b295da2 s3-waf: Link rpc_open_tcp only against needed subsystems. via 2763013 s3-waf: Link ntlm_auth only against needed subsystems. via 1ffc082 s3-waf: Link versiontest only against needed subsystems. via dc4924b s3-waf: Link smbfilter only against needed subsystems. via e0da5c9 s3-waf: Link locktest2 only against needed subsystems. via 2734017 s3-waf: Link vfstest only against needed subsystems. via 9eaeb6c s3-waf: Link pdbtest only against needed subsystems. via 8438fba s3-waf: Link locktest only against needed subsystems. via bbb9131 s3-waf: Link sharesec only against needed subsystems. via 89c514a s3-waf: Link eventlogadm only against needed subsystems. via ab51d66 s3-waf: Link smbcquotas only against needed subsystems. via 07cc5ab s3-waf: Link smbcacls only against needed subsystems. via 61c53eb s3-waf: Link msgtest only against needed subsystems. via 7d10eb7 s3-waf: Link maketest only against needed subsystems. via 1fb2ef7 s3-waf: Link smbconftort only against needed subsystems. via 74d24fa s3-waf: Link nmblookup only against needed subsystems. via e9b64f0 s3-waf: Link nmblookup only against needed subsystems. via 1fa80f0 s3-waf: Link smbget only against needed subsystems. via 6f6fb03 s3-waf: Link pdbedit only against needed subsystems. via dd1b548 s3-waf: Link smbpasswd only against needed subsystems. via ff8a1f7 s3-waf: Link smbtree only against needed subsystems. via a07b711 s3-waf: Link smbstatus only against needed subsystems. via 05864b0 s3-waf: Link smbstatus only against needed subsystems. via 47da01a s3-waf: Link smbta-util only against needed subsystems. via cd03543 s3-waf: Link testparm only against needed subsystems. via 3e4e84a s3-waf: Link smbspool only against needed subsystems. via 0871a1b s3-waf: Link profiles only against needed subsystems. via 1d6841d s3-waf: Link net only against needed subsystems. via 84e2a6e s3-waf: Link smbclient only against needed subsystems. via 2d0d2b5 s3-rpcclient: Remove debug_dsdcinfo_flags() call. via 2d667ba s3-waf: Link rpcclient only against needed subsystems. via 1700013 s3-waf: Link swat only against needed subsystems. via dd91f0b s3-waf: Add missing dependencies to PASSCHANGE. via feab59e s3-waf: Add missing dependencies to LOCKING. via 2edf42a s3-waf: Link winbindd only against needed subsystems. via 005d370 s3-waf: Link nmbd only against needed subsystems. via 9b71a80 s3-waf: Link libcli_lsa3 only against needed subsystems. via f83efa7 s3-waf: Link errors3 only against needed subsystems. via 7b9716d s3-waf: Link tdb-wrap3 only against needed subsystems. via 3ee8b7a s3-waf: Link trusts_util only against needed subsystems. via abc0f11 s3-waf: Remove dead subsystem LIBNBT. via 9321db0 s3-waf: Link LIBNET_DSSYNC only against needed subsystems. via 0f4031e s3-waf: Link LIBNET only against needed subsystems. via 72e3252 s3-waf: Link smbd_base only against needed subsystems. via 2efb390 s3-waf: Link libsmb only against needed subsystems. via b1d5dc9 s3-waf: Link LIBNTLMSSP only against needed subsystems. via a445051 s3-waf: Remove LIBSMB_ERR completely. via 00aa8ef s3-waf: Link samba3core against needed subsystems. via f6c3eab s3-waf: Don't link param_service against USER_UTIL twice. via 6822baa s3-waf: Link param only against needed subsystems. via f77680d s3-waf: Add missing depcendencies to smbconf. via b111375 s3-waf: Remove unneeded PARAM_UTIL dependency. via 823d32d s3-waf: Replace LIBMSRPC_GEN just with ndr-standard. via 8b72c6b s3-waf: Link nss_wins only against needed subsystems. via 37e8286 s3-waf: Link smbclient only against needed subsystems. via 7945deb s3-waf: Link netapi only against needed subsystems. via 390734a lib: Remove dead mszip code. from e9d6699 Introduce dump_data_file
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master - Log ----------------------------------------------------------------- commit 67126ed08cc0e9226f4a0c099c8f03293929cc9a Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 19:03:12 2012 +0100 s3-waf: Reduce dependencies of winbindd. Autobuild-User: Andreas Schneider <a...@cryptomilk.org> Autobuild-Date: Wed Jan 25 13:31:19 CET 2012 on sn-devel-104 commit c85e60bd6a18cf2aa2985c57c19ea15f1216c398 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 18:14:57 2012 +0100 s3-waf: Reduce dependencies of smbd_base. commit 6d06a310f3fbccc2a57e224b02a7c1774a660b14 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 18:25:18 2012 +0100 s3-waf: Fix cups dependency in PRINTING. commit 0dcc51ef801d4b3e24973895217f36f1a88ad4eb Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 18:14:42 2012 +0100 s3-waf: Add missing dependency to LIBNET. commit a5b4a47b7cc8ba1b741929a5400ae51653d049fd Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 18:13:57 2012 +0100 s3-waf: Add missing dependency to RPC_WINREG. commit c4b05ec6e722176b0c72037e5ac5ab3bd8c6f14d Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 17:48:02 2012 +0100 s3-waf: Reduce libsmbclient dependencies. commit 1a4e4f0871f1185d66fb578727d6dfef76c26c6f Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 17:44:32 2012 +0100 s3-waf: Reduce libnetapi dependencies. commit 63c7118ae097c4145ab0eebf35093463a02dd1e5 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 17:01:08 2012 +0100 s3-waf: Link vlp only against needed subsystems. commit 2fa6c5e038a58f3feeec2d2ae498e662cf00dc34 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:58:03 2012 +0100 s3-waf: Link split_tokens only against needed subsystems. commit 5b8a22ec95955f0b8d4807b06fa460746a4b38d8 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:54:02 2012 +0100 s3-waf: Link dbwrap_torture only against needed subsystems. commit 9f917c08e50202fec4e81c99c37cd66edebb33da Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:51:39 2012 +0100 s3-waf: Link dbwrap_tool only against needed subsystems. commit de1836f586ccace771523e2389838909b4547d28 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:49:17 2012 +0100 s3-waf: Link test_lp_load only against needed subsystems. commit b295da29b139085e98b48bed721442320f02e91f Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:46:55 2012 +0100 s3-waf: Link rpc_open_tcp only against needed subsystems. commit 27630134ac02b1ad6a981789d9bf5930a7d53452 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:39:01 2012 +0100 s3-waf: Link ntlm_auth only against needed subsystems. commit 1ffc082100ffc78592a0a4b22bec335d25fd7bef Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:30:51 2012 +0100 s3-waf: Link versiontest only against needed subsystems. commit dc4924b0a090d1ea27a32d9bfadccd55c441de36 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:29:34 2012 +0100 s3-waf: Link smbfilter only against needed subsystems. commit e0da5c955f9a620463ccf173af1c71332d2c5f72 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:26:23 2012 +0100 s3-waf: Link locktest2 only against needed subsystems. commit 273401733a881ddfb6790e20ffc6cf4ee5dfe227 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:23:11 2012 +0100 s3-waf: Link vfstest only against needed subsystems. commit 9eaeb6ceed602ff00dd297c052a68c472b619b67 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:15:32 2012 +0100 s3-waf: Link pdbtest only against needed subsystems. commit 8438fba08ab9d13157cdb6a0976828d238f5048c Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:12:23 2012 +0100 s3-waf: Link locktest only against needed subsystems. commit bbb91314a2773364612330bd95b23185a89340dc Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:08:59 2012 +0100 s3-waf: Link sharesec only against needed subsystems. commit 89c514ab37635ce383bf44b0b687a3d9e6b5187b Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:06:01 2012 +0100 s3-waf: Link eventlogadm only against needed subsystems. commit ab51d6660e2a6014c0a49081a5e95c3e252cc9ed Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 16:03:02 2012 +0100 s3-waf: Link smbcquotas only against needed subsystems. commit 07cc5abb01b00c58bbc72830d3fb780791367c2e Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:57:15 2012 +0100 s3-waf: Link smbcacls only against needed subsystems. commit 61c53ebbc1837cbba98b63bef95cd7c772f85ab5 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:55:05 2012 +0100 s3-waf: Link msgtest only against needed subsystems. commit 7d10eb7430fa6f9630c2846a362e49bfd9f1ddba Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:49:32 2012 +0100 s3-waf: Link maketest only against needed subsystems. commit 1fb2ef78c426367479993b5aec4af7cf1c635fde Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:41:07 2012 +0100 s3-waf: Link smbconftort only against needed subsystems. commit 74d24fa08f5d483a42e69549c282e2dfebab6687 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:39:11 2012 +0100 s3-waf: Link nmblookup only against needed subsystems. commit e9b64f0ac0bf63c6640f94edaf9636d8bb7f4969 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 15:38:56 2012 +0100 s3-waf: Link nmblookup only against needed subsystems. commit 1fa80f0f29544bbdac8f5c714a3730e4afe8e2c0 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 14:28:48 2012 +0100 s3-waf: Link smbget only against needed subsystems. commit 6f6fb0318053fe487a947576a1ad372fc4dca73a Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 14:26:38 2012 +0100 s3-waf: Link pdbedit only against needed subsystems. commit dd1b54815213a5099215c3534c7d81ce67a0fe0e Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 14:20:03 2012 +0100 s3-waf: Link smbpasswd only against needed subsystems. commit ff8a1f7384791c3f9698ba09ad02118227a0250c Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 13:46:22 2012 +0100 s3-waf: Link smbtree only against needed subsystems. commit a07b711bc568ee664500d5308cfca68de01c944d Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 13:46:11 2012 +0100 s3-waf: Link smbstatus only against needed subsystems. commit 05864b08cc1ff7a2b7d1cfb44c3cb5b566bbd792 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 13:16:55 2012 +0100 s3-waf: Link smbstatus only against needed subsystems. commit 47da01a4878cac878486c7788ef114a01b24ccce Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 13:01:12 2012 +0100 s3-waf: Link smbta-util only against needed subsystems. commit cd035436df80daddbc0befc10ce54f58974c6030 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 12:54:28 2012 +0100 s3-waf: Link testparm only against needed subsystems. commit 3e4e84a8ff43ccca5ebdc477e41252a90beedd42 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 12:51:31 2012 +0100 s3-waf: Link smbspool only against needed subsystems. commit 0871a1b2123814340e17d2cc7ce6b43da6131b2c Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 12:35:58 2012 +0100 s3-waf: Link profiles only against needed subsystems. commit 1d6841decd8dc3cf3346ab813b5be40bde72a38f Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 11:52:20 2012 +0100 s3-waf: Link net only against needed subsystems. commit 84e2a6e632e76772b3d2e4b7f3837a74f7c8994b Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 24 11:28:28 2012 +0100 s3-waf: Link smbclient only against needed subsystems. commit 2d0d2b570faaea9ec84cb6a195d901cb3ff54e50 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 18:59:23 2012 +0100 s3-rpcclient: Remove debug_dsdcinfo_flags() call. This gets rid of the DCUTIL dependency. commit 2d667bac3ffd80b3cdc4ae0e514c1cc7cf009f99 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 18:56:04 2012 +0100 s3-waf: Link rpcclient only against needed subsystems. commit 17000133f81c731aa28f493b5623294b0685bb0c Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 15:30:23 2012 +0100 s3-waf: Link swat only against needed subsystems. commit dd91f0be888b05191c43cf435674a3c115710e47 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 18:42:18 2012 +0100 s3-waf: Add missing dependencies to PASSCHANGE. commit feab59eb1aa4ada4c3709c9c3ca0e8a548003784 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 18:41:35 2012 +0100 s3-waf: Add missing dependencies to LOCKING. commit 2edf42a8db22b19d756f5574c5aec2122c4babf9 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 15:14:20 2012 +0100 s3-waf: Link winbindd only against needed subsystems. commit 005d370a8ac040b733df8ca087a84ad1fa187a45 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 14:46:45 2012 +0100 s3-waf: Link nmbd only against needed subsystems. commit 9b71a803162ec78fd49375d6a1e9137ffd4c25b0 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 14:46:31 2012 +0100 s3-waf: Link libcli_lsa3 only against needed subsystems. commit f83efa73aacd60b037d139f9c22bc46d51085e48 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 12:13:55 2012 +0100 s3-waf: Link errors3 only against needed subsystems. commit 7b9716d20d7fa595d9f26ca1de9b3614ef42b45a Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 11:13:17 2012 +0100 s3-waf: Link tdb-wrap3 only against needed subsystems. commit 3ee8b7ac5402c455ace9432e6bd0b685218d3cd6 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 10:41:01 2012 +0100 s3-waf: Link trusts_util only against needed subsystems. commit abc0f11350ac0df676e4b6b8c79d58a1e9676ec0 Author: Andreas Schneider <a...@samba.org> Date: Mon Jan 23 10:14:50 2012 +0100 s3-waf: Remove dead subsystem LIBNBT. commit 9321db0c7409af084778fe8754f0f80c6079d831 Author: Andreas Schneider <a...@samba.org> Date: Fri Jan 20 17:58:46 2012 +0100 s3-waf: Link LIBNET_DSSYNC only against needed subsystems. commit 0f4031e52fbb983ae4c09230382a65e5b363ec41 Author: Andreas Schneider <a...@samba.org> Date: Fri Jan 20 15:53:00 2012 +0100 s3-waf: Link LIBNET only against needed subsystems. commit 72e3252902024a85f6bfc6d7ab4595f8691c6dc3 Author: Andreas Schneider <a...@samba.org> Date: Fri Jan 20 11:48:19 2012 +0100 s3-waf: Link smbd_base only against needed subsystems. commit 2efb390ab1c7d9e059e4566856c26184387d99e9 Author: Andreas Schneider <a...@samba.org> Date: Thu Jan 19 10:12:18 2012 +0100 s3-waf: Link libsmb only against needed subsystems. commit b1d5dc91959858b1f3e822752e4026ab745d97df Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 14:57:07 2012 +0100 s3-waf: Link LIBNTLMSSP only against needed subsystems. commit a445051449f5d6f18b1d0aac031086139279cf30 Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 14:41:08 2012 +0100 s3-waf: Remove LIBSMB_ERR completely. commit 00aa8ef7ffccd7dab0892e12c5d45084ad877ead Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 14:17:40 2012 +0100 s3-waf: Link samba3core against needed subsystems. commit f6c3eab2a6756351f48fd03ccb16eac7f7a4d5d5 Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 12:19:15 2012 +0100 s3-waf: Don't link param_service against USER_UTIL twice. commit 6822baa2920f30374ec84363497d97e24f359fab Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 12:00:39 2012 +0100 s3-waf: Link param only against needed subsystems. commit f77680de22c3c9ac399a78c95be39bfa79e07b8f Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 14:24:31 2012 +0100 s3-waf: Add missing depcendencies to smbconf. commit b111375b4c1f8421a37364c343c31614915e4f64 Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 11:57:49 2012 +0100 s3-waf: Remove unneeded PARAM_UTIL dependency. commit 823d32dabd1dc4d216c44f217fe856bfc76e9d9b Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 11:38:22 2012 +0100 s3-waf: Replace LIBMSRPC_GEN just with ndr-standard. There is no need to link against dssetup and spoolss. commit 8b72c6bfaa80ac9cd65fa61dbf2401b7032ddd03 Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 11:17:16 2012 +0100 s3-waf: Link nss_wins only against needed subsystems. commit 37e8286a8b17991589330160adf75d62e93ad1cc Author: Andreas Schneider <a...@samba.org> Date: Wed Jan 18 11:08:59 2012 +0100 s3-waf: Link smbclient only against needed subsystems. commit 7945deb238e9f113439417fc635d8469ccdb33b5 Author: Andreas Schneider <a...@samba.org> Date: Tue Jan 17 17:06:24 2012 +0100 s3-waf: Link netapi only against needed subsystems. commit 390734acca04590722fbe63dcb1e87d0dac362e3 Author: Andreas Schneider <a...@samba.org> Date: Thu Jan 19 11:11:11 2012 +0100 lib: Remove dead mszip code. RIP, long live zlib. ----------------------------------------------------------------------- Summary of changes: lib/compression/mszip.c | 676 -------------------------------------- lib/compression/mszip.h | 33 -- lib/compression/testsuite.c | 1 - source3/Makefile.in | 5 +- source3/rpc_server/wscript_build | 4 +- source3/rpcclient/cmd_netlogon.c | 6 - source3/wscript_build | 520 ++++++++++++++++++++--------- 7 files changed, 363 insertions(+), 882 deletions(-) delete mode 100644 lib/compression/mszip.c delete mode 100644 lib/compression/mszip.h Changeset truncated at 500 lines: diff --git a/lib/compression/mszip.c b/lib/compression/mszip.c deleted file mode 100644 index 9aa1772..0000000 --- a/lib/compression/mszip.c +++ /dev/null @@ -1,676 +0,0 @@ -/* mszip decompression - based on cabextract.c code from - * Stuart Caie - * - * adapted for Samba by Andrew Tridgell and Stefan Metzmacher 2005 - * - * (C) 2000-2001 Stuart Caie <ky...@4u.net> - * reaktivate-specifics by Malte Starostik <ma...@kde.org> - * - * 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 <http://www.gnu.org/licenses/>. - */ - -#include "includes.h" -#include "../compression/mszip.h" - -/*--------------------------------------------------------------------------*/ -/* our archiver information / state */ - -/* MSZIP stuff */ -#define ZIPWSIZE 0x8000 /* window size */ -#define ZIPLBITS 9 /* bits in base literal/length lookup table */ -#define ZIPDBITS 6 /* bits in base distance lookup table */ -#define ZIPBMAX 16 /* maximum bit length of any code */ -#define ZIPN_MAX 288 /* maximum number of codes in any set */ - -struct Ziphuft { - uint8_t e; /* number of extra bits or operation */ - uint8_t b; /* number of bits in this code or subcode */ - union { - uint16_t n; /* literal, length base, or distance base */ - struct Ziphuft *t; /* pointer to next level of table */ - } v; -}; - -struct ZIPstate { - uint32_t window_posn; /* current offset within the window */ - uint32_t bb; /* bit buffer */ - uint32_t bk; /* bits in bit buffer */ - uint32_t ll[288+32]; /* literal/length and distance code lengths */ - uint32_t c[ZIPBMAX+1]; /* bit length count table */ - int32_t lx[ZIPBMAX+1]; /* memory for l[-1..ZIPBMAX-1] */ - struct Ziphuft *u[ZIPBMAX]; /* table stack */ - uint32_t v[ZIPN_MAX]; /* values in order of bit length */ - uint32_t x[ZIPBMAX+1]; /* bit offsets, then code stack */ - uint8_t *inpos; -}; - -/* generic stuff */ -#define CAB(x) (decomp_state->x) -#define ZIP(x) (decomp_state->methods.zip.x) - -/* CAB data blocks are <= 32768 bytes in uncompressed form. Uncompressed - * blocks have zero growth. MSZIP guarantees that it won't grow above - * uncompressed size by more than 12 bytes. LZX guarantees it won't grow - * more than 6144 bytes. - */ -#define CAB_BLOCKMAX (32768) -#define CAB_INPUTMAX (CAB_BLOCKMAX+6144) - -struct decomp_state { - struct folder *current; /* current folder we're extracting from */ - uint32_t offset; /* uncompressed offset within folder */ - uint8_t *outpos; /* (high level) start of data to use up */ - uint16_t outlen; /* (high level) amount of data to use up */ - uint16_t split; /* at which split in current folder? */ - int (*decompress)(int, int); /* the chosen compression func */ - uint8_t inbuf[CAB_INPUTMAX+2]; /* +2 for lzx bitbuffer overflows! */ - uint8_t outbuf[CAB_BLOCKMAX]; - union { - struct ZIPstate zip; - } methods; -}; - - -/* MSZIP decruncher */ - -/* Dirk Stoecker wrote the ZIP decoder, based on the InfoZip deflate code */ - -/* Tables for deflate from PKZIP's appnote.txt. */ -static const uint8_t Zipborder[] = /* Order of the bit length code lengths */ -{ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15}; -static const uint16_t Zipcplens[] = /* Copy lengths for literal codes 257..285 */ -{ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, - 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0}; -static const uint16_t Zipcplext[] = /* Extra bits for literal codes 257..285 */ -{ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, - 4, 5, 5, 5, 5, 0, 99, 99}; /* 99==invalid */ -static const uint16_t Zipcpdist[] = /* Copy offsets for distance codes 0..29 */ -{ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, -513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577}; -static const uint16_t Zipcpdext[] = /* Extra bits for distance codes */ -{ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, -10, 11, 11, 12, 12, 13, 13}; - -/* And'ing with Zipmask[n] masks the lower n bits */ -static const uint16_t Zipmask[17] = { - 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, - 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff -}; - -#define ZIPNEEDBITS(n) {while(k<(n)){int32_t c=*(ZIP(inpos)++);\ - b|=((uint32_t)c)<<k;k+=8;}} -#define ZIPDUMPBITS(n) {b>>=(n);k-=(n);} - -static void Ziphuft_free(struct Ziphuft *t) -{ - register struct Ziphuft *p, *q; - - /* Go through linked list, freeing from the allocated (t[-1]) address. */ - p = t; - while (p != (struct Ziphuft *)NULL) - { - q = (--p)->v.t; - free(p); - p = q; - } -} - -static int32_t Ziphuft_build(struct decomp_state *decomp_state, - uint32_t *b, uint32_t n, uint32_t s, const uint16_t *d, const uint16_t *e, - struct Ziphuft **t, int32_t *m) -{ - uint32_t a; /* counter for codes of length k */ - uint32_t el; /* length of EOB code (value 256) */ - uint32_t f; /* i repeats in table every f entries */ - int32_t g; /* maximum code length */ - int32_t h; /* table level */ - register uint32_t i; /* counter, current code */ - register uint32_t j; /* counter */ - register int32_t k; /* number of bits in current code */ - int32_t *l; /* stack of bits per table */ - register uint32_t *p; /* pointer into ZIP(c)[],ZIP(b)[],ZIP(v)[] */ - register struct Ziphuft *q; /* points to current table */ - struct Ziphuft r; /* table entry for structure assignment */ - register int32_t w; /* bits before this table == (l * h) */ - uint32_t *xp; /* pointer into x */ - int32_t y; /* number of dummy codes added */ - uint32_t z; /* number of entries in current table */ - - l = ZIP(lx)+1; - - /* Generate counts for each bit length */ - el = n > 256 ? b[256] : ZIPBMAX; /* set length of EOB code, if any */ - - for(i = 0; i < ZIPBMAX+1; ++i) - ZIP(c)[i] = 0; - p = b; i = n; - do - { - ZIP(c)[*p]++; p++; /* assume all entries <= ZIPBMAX */ - } while (--i); - if (ZIP(c)[0] == n) /* null input--all zero length codes */ - { - *t = (struct Ziphuft *)NULL; - *m = 0; - return 0; - } - - /* Find minimum and maximum length, bound *m by those */ - for (j = 1; j <= ZIPBMAX; j++) - if (ZIP(c)[j]) - break; - k = j; /* minimum code length */ - if ((uint32_t)*m < j) - *m = j; - for (i = ZIPBMAX; i; i--) - if (ZIP(c)[i]) - break; - g = i; /* maximum code length */ - if ((uint32_t)*m > i) - *m = i; - - /* Adjust last length count to fill out codes, if needed */ - for (y = 1 << j; j < i; j++, y <<= 1) - if ((y -= ZIP(c)[j]) < 0) - return 2; /* bad input: more codes than bits */ - if ((y -= ZIP(c)[i]) < 0) - return 2; - ZIP(c)[i] += y; - - /* Generate starting offsets int32_to the value table for each length */ - ZIP(x)[1] = j = 0; - p = ZIP(c) + 1; xp = ZIP(x) + 2; - while (--i) - { /* note that i == g from above */ - *xp++ = (j += *p++); - } - - /* Make a table of values in order of bit lengths */ - p = b; i = 0; - do{ - if ((j = *p++) != 0) - ZIP(v)[ZIP(x)[j]++] = i; - } while (++i < n); - - - /* Generate the Huffman codes and for each, make the table entries */ - ZIP(x)[0] = i = 0; /* first Huffman code is zero */ - p = ZIP(v); /* grab values in bit order */ - h = -1; /* no tables yet--level -1 */ - w = l[-1] = 0; /* no bits decoded yet */ - ZIP(u)[0] = (struct Ziphuft *)NULL; /* just to keep compilers happy */ - q = (struct Ziphuft *)NULL; /* ditto */ - z = 0; /* ditto */ - - /* go through the bit lengths (k already is bits in shortest code) */ - for (; k <= g; k++) - { - a = ZIP(c)[k]; - while (a--) - { - /* here i is the Huffman code of length k bits for value *p */ - /* make tables up to required level */ - while (k > w + l[h]) - { - w += l[h++]; /* add bits already decoded */ - - /* compute minimum size table less than or equal to *m bits */ - z = (z = g - w) > (uint32_t)*m ? *m : z; /* upper limit */ - if ((f = 1 << (j = k - w)) > a + 1) /* try a k-w bit table */ - { /* too few codes for k-w bit table */ - f -= a + 1; /* deduct codes from patterns left */ - xp = ZIP(c) + k; - while (++j < z) /* try smaller tables up to z bits */ - { - if ((f <<= 1) <= *++xp) - break; /* enough codes to use up j bits */ - f -= *xp; /* else deduct codes from patterns */ - } - } - if ((uint32_t)w + j > el && (uint32_t)w < el) - j = el - w; /* make EOB code end at table */ - z = 1 << j; /* table entries for j-bit table */ - l[h] = j; /* set table size in stack */ - - /* allocate and link in new table */ - if (!(q = (struct Ziphuft *)SMB_MALLOC((z + 1)*sizeof(struct Ziphuft)))) - { - if(h) - Ziphuft_free(ZIP(u)[0]); - return 3; /* not enough memory */ - } - *t = q + 1; /* link to list for Ziphuft_free() */ - *(t = &(q->v.t)) = (struct Ziphuft *)NULL; - ZIP(u)[h] = ++q; /* table starts after link */ - - /* connect to last table, if there is one */ - if (h) - { - ZIP(x)[h] = i; /* save pattern for backing up */ - r.b = (uint8_t)l[h-1]; /* bits to dump before this table */ - r.e = (uint8_t)(16 + j); /* bits in this table */ - r.v.t = q; /* pointer to this table */ - j = (i & ((1 << w) - 1)) >> (w - l[h-1]); - ZIP(u)[h-1][j] = r; /* connect to last table */ - } - } - - /* set up table entry in r */ - r.b = (uint8_t)(k - w); - if (p >= ZIP(v) + n) - r.e = 99; /* out of values--invalid code */ - else if (*p < s) - { - r.e = (uint8_t)(*p < 256 ? 16 : 15); /* 256 is end-of-block code */ - r.v.n = *p++; /* simple code is just the value */ - } - else - { - r.e = (uint8_t)e[*p - s]; /* non-simple--look up in lists */ - r.v.n = d[*p++ - s]; - } - - /* fill code-like entries with r */ - f = 1 << (k - w); - for (j = i >> w; j < z; j += f) - q[j] = r; - - /* backwards increment the k-bit code i */ - for (j = 1 << (k - 1); i & j; j >>= 1) - i ^= j; - i ^= j; - - /* backup over finished tables */ - while ((i & ((1 << w) - 1)) != ZIP(x)[h]) - w -= l[--h]; /* don't need to update q */ - } - } - - /* return actual size of base table */ - *m = l[0]; - - /* Return true (1) if we were given an incomplete table */ - return y != 0 && g != 1; -} - -static int32_t Zipinflate_codes(struct decomp_state *decomp_state, - struct Ziphuft *tl, struct Ziphuft *td, - int32_t bl, int32_t bd) -{ - register uint32_t e; /* table entry flag/number of extra bits */ - uint32_t n, d; /* length and index for copy */ - uint32_t w; /* current window position */ - struct Ziphuft *t; /* pointer to table entry */ - uint32_t ml, md; /* masks for bl and bd bits */ - register uint32_t b; /* bit buffer */ - register uint32_t k; /* number of bits in bit buffer */ - - DEBUG(10,("Zipinflate_codes\n")); - - /* make local copies of globals */ - b = ZIP(bb); /* initialize bit buffer */ - k = ZIP(bk); - w = ZIP(window_posn); /* initialize window position */ - - /* inflate the coded data */ - ml = Zipmask[bl]; /* precompute masks for speed */ - md = Zipmask[bd]; - - for(;;) - { - ZIPNEEDBITS((uint32_t)bl) - if((e = (t = tl + ((uint32_t)b & ml))->e) > 16) - do - { - if (e == 99) - return 1; - ZIPDUMPBITS(t->b) - e -= 16; - ZIPNEEDBITS(e) - } while ((e = (t = t->v.t + ((uint32_t)b & Zipmask[e]))->e) > 16); - ZIPDUMPBITS(t->b) - if (w >= CAB_BLOCKMAX) break; - if (e == 16) /* then it's a literal */ - CAB(outbuf)[w++] = (uint8_t)t->v.n; - else /* it's an EOB or a length */ - { - /* exit if end of block */ - if(e == 15) - break; - - /* get length of block to copy */ - ZIPNEEDBITS(e) - n = t->v.n + ((uint32_t)b & Zipmask[e]); - ZIPDUMPBITS(e); - - /* decode distance of block to copy */ - ZIPNEEDBITS((uint32_t)bd) - if ((e = (t = td + ((uint32_t)b & md))->e) > 16) - do { - if (e == 99) - return 1; - ZIPDUMPBITS(t->b) - e -= 16; - ZIPNEEDBITS(e) - } while ((e = (t = t->v.t + ((uint32_t)b & Zipmask[e]))->e) > 16); - ZIPDUMPBITS(t->b) - ZIPNEEDBITS(e) - d = w - t->v.n - ((uint32_t)b & Zipmask[e]); - ZIPDUMPBITS(e) - do - { - n -= (e = (e = ZIPWSIZE - ((d &= ZIPWSIZE-1) > w ? d : w)) > n ?n:e); - do - { - CAB(outbuf)[w++] = CAB(outbuf)[d++]; - } while (--e); - } while (n); - } - } - - /* restore the globals from the locals */ - ZIP(window_posn) = w; /* restore global window pointer */ - ZIP(bb) = b; /* restore global bit buffer */ - ZIP(bk) = k; - - /* done */ - return 0; -} - -/* "decompress" an inflated type 0 (stored) block. */ -static int32_t Zipinflate_stored(struct decomp_state *decomp_state) -{ - uint32_t n; /* number of bytes in block */ - uint32_t w; /* current window position */ - register uint32_t b; /* bit buffer */ - register uint32_t k; /* number of bits in bit buffer */ - - /* make local copies of globals */ - b = ZIP(bb); /* initialize bit buffer */ - k = ZIP(bk); - w = ZIP(window_posn); /* initialize window position */ - - /* go to byte boundary */ - n = k & 7; - ZIPDUMPBITS(n); - - /* get the length and its complement */ - ZIPNEEDBITS(16) - n = ((uint32_t)b & 0xffff); - ZIPDUMPBITS(16) - ZIPNEEDBITS(16) - if (n != (uint32_t)((~b) & 0xffff)) - return 1; /* error in compressed data */ - ZIPDUMPBITS(16) - - /* read and output the compressed data */ - while(n--) - { - ZIPNEEDBITS(8) - CAB(outbuf)[w++] = (uint8_t)b; - ZIPDUMPBITS(8) - } - - /* restore the globals from the locals */ - ZIP(window_posn) = w; /* restore global window pointer */ - ZIP(bb) = b; /* restore global bit buffer */ - ZIP(bk) = k; - return 0; -} - -static int32_t Zipinflate_fixed(struct decomp_state *decomp_state) -{ - struct Ziphuft *fixed_tl; - struct Ziphuft *fixed_td; - int32_t fixed_bl, fixed_bd; - int32_t i; /* temporary variable */ - uint32_t *l; - - l = ZIP(ll); - - /* literal table */ - for(i = 0; i < 144; i++) - l[i] = 8; - for(; i < 256; i++) - l[i] = 9; - for(; i < 280; i++) - l[i] = 7; - for(; i < 288; i++) /* make a complete, but wrong code set */ - l[i] = 8; - fixed_bl = 7; - if((i = Ziphuft_build(decomp_state, l, 288, 257, Zipcplens, Zipcplext, &fixed_tl, &fixed_bl))) - return i; - - /* distance table */ - for(i = 0; i < 30; i++) /* make an incomplete code set */ - l[i] = 5; - fixed_bd = 5; - if((i = Ziphuft_build(decomp_state, l, 30, 0, Zipcpdist, Zipcpdext, &fixed_td, &fixed_bd)) > 1) - { - Ziphuft_free(fixed_tl); - return i; - } - - /* decompress until an end-of-block code */ - i = Zipinflate_codes(decomp_state, fixed_tl, fixed_td, fixed_bl, fixed_bd); - - Ziphuft_free(fixed_td); - Ziphuft_free(fixed_tl); - return i; -} - -/* decompress an inflated type 2 (dynamic Huffman codes) block. */ -static int32_t Zipinflate_dynamic(struct decomp_state *decomp_state) -{ - int32_t i; /* temporary variables */ - uint32_t j; - uint32_t *ll; - uint32_t l; /* last length */ - uint32_t m; /* mask for bit lengths table */ - uint32_t n; /* number of lengths to get */ - struct Ziphuft *tl; /* literal/length code table */ - struct Ziphuft *td; /* distance code table */ - int32_t bl; /* lookup bits for tl */ - int32_t bd; /* lookup bits for td */ - uint32_t nb; /* number of bit length codes */ - uint32_t nl; /* number of literal/length codes */ - uint32_t nd; /* number of distance codes */ - register uint32_t b; /* bit buffer */ - register uint32_t k; /* number of bits in bit buffer */ - - /* make local bit buffer */ - b = ZIP(bb); - k = ZIP(bk); -- Samba Shared Repository