view release on metacpan or search on metacpan
unzip-6.0/History.600 view on Meta::CPAN
the /ODS2 and /DOT_VERSION options [Christian Spieler]
- Merged in all additions and fixes of the UnZip 5.5x code tree from
UnZip 5.50i up to UnZip 5.52 release. Removed History.5?? files.
Removed all History.600 entries that have been covered by fixes from
the UnZip 5.5x code.
For detailed ChangeLog see History.550, History.551, and History.552,
as found in unzip552.zip source distribution and the UnZipHist.zip
ChangeLog archive. [Christian Spieler]
- crypt.[ch]: updated to 2.10 (synchronized with zip 2.31) [Christian Spieler]
- envargs.c: do not declare getenv() for "modern" compilers [Cosmin Truta]
- extract.c: better echo message for CR or LF at overwrite prompt [Cosmin?]
- fileio.c: added specific message for SIGILL in handler() [Chr. Spieler]
- process.c: fixed code of optional USE_STRM_INPUT variant [Chr. Spieler]
- VMS, vms.c: requires "-vv" instead of only "-v" to enable VMS diagnostic
output (enable DIAG_FLAG for vflag >= 3, only; DIAG output is not available
for the unzip modi "extract to disk" and "zipinfo") [Christian Spieler]
- VMS cli interface: added (undocumented) option modified /FULL=DIAGNOSTICS to
control "-vv" diagnostic messages [Steven M Schweda, Christian Spieler]
- WIN32/MSDOS (maybe others): fixed abort exception handling for CTRL-BREAK
[Christian Spieler]
- revised ecrec64 search logic: ecrec64 need not be present when one of
unzip-6.0/History.600 view on Meta::CPAN
6.00e05 (09 Sep 08):
- unix/unix.c - version(): added OS info support for Mac OS X (including a
note for the recognized CPU architecture). [Steven M. Schweda]
- unix/configure: check for Mac OS X special linker options is only executed
on systems that have been identified as Mac OS X. [Steven M. Schweda]
- unix/Makefile: moved "solaris" targets into new "autoconfig generic" group
of machine target aliases. [Steven M. Schweda, Chr. Spieler]
- extract.c, fileio.c: use "sizeof(G.answerbuf)" as length argument in fgets()
calls, for better robustness and "in-code" documentation. [Chr. Spieler]
- extract.c - extract_or_test_entrylist(): fixed handling of \n in response
to "overwrite (y/n/r)" prompt. [Steven M. Schweda, Chr. Spieler]
- extract.c, special version of "replace file" prompt for VMS to take into
account that VMS normally created a new version instead of overwriting
an existing file. [Steven M. Schweda]
- unzpriv.h: for VMS, undefine the PATH_MAX definition provided by <limits.h>,
because it does not take into account long name support of ODS-5 volumes.
[Steven M. Schweda]
- VMS: added zlib.h and infback9.h jacket headers for support of using zlib
as inflate decompression code; revised build procedures for zlib support
(build_unzip.com, descrip.mms, descrip_src.mms). [Steven M. Schweda]
- inflate.c: corrected condition when to include "infback9.h" for Deflate64
support with zlib 1.2.x. [Chr. Spieler]
unzip-6.0/ToDo view on Meta::CPAN
devices, or system extensions that look like a characters device driver)
at runtime; with the goal of emitting "meaningful" error messages and/or
rename queries.
(Currently, these reserved names are catched as "non-deletable files".
On MSDOS and WIN32, when the RTL stat() function allows to identify
character devices, the "reserved" names are automatically prefixed with
an underscore.)
o redesign "file exists -- is newer/older -- overwrite/skip/rename"
logic in extract.c and the corresponding system specific mapname()
services; to prevent superfluous decryption key prompts for entry
that will be skipped, later.
o rewrite to use fread/fseek/etc. [eventually: test
write(bytes) vs. fwrite(words), especially on Crays/Alphas]
soon (probably in conjunction with multi-part handling)
o incorporate new backfill version of inflate()
wait for zlib version
unzip-6.0/acorn/ReadMe view on Meta::CPAN
Where truncation occurs, you must be REALLY careful about extracting files
from archives. The files
dummy_source.c and dummy_source.h
will both be extracted as
dummy_sour
UnZip will prompt you for confirmation of the over-writing of these files,
but you must be really careful unless you wish to lose files! Also, because
UnZip is a unix-ported program, the filenames are CASE SENSITIVE.
*unzip new/zip newfile
will extract 'newfile', but not 'NewFile', 'NEWFILE' or any other
combinations. However, you can use the -C option to force operations to
disregard the case of filenames.
The Acorn UnZip port has an additional feature to cope with the extraction of
unzip-6.0/acorn/acorn.c view on Meta::CPAN
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/amiga/amiga.c view on Meta::CPAN
if ((G.build_end-G.buildpath) >= FILNAMSIZ) {
*--G.build_end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(G.buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/amiga/filedate.c view on Meta::CPAN
* redefines SetFileDate() depending upon AMIGADOS2 definition.
* 11 Oct 92, John Bush, Eliminated AMIGADOS2 switch by determining
* revision via OpenLibrary() call. Now only one version of
* the program runs on both platforms (1.3.x vs. 2.x)
* 11 Oct 92, John Bush, Merged with Zip version and changed arg passing
* to take time_t input instead of struct DateStamp.
* Arg passing made to conform with utime().
* 22 Nov 92, Paul Kienitz, fixed includes for Aztec and cleaned up some
* lint-ish errors; simplified test for AmigaDOS version.
* 11 Nov 95, Paul Kienitz, added Agetch() for crypt password input and
* UnZip's "More" prompt -- simplifies crypt.h and avoids
* use of library code redundant with sendpkt(). Made it
* available to fUnZip, which does not use FileDate().
* 22 Nov 95, Paul Kienitz, created a new tzset() that gets the current
* timezone from the Locale preferences. These exist only under
* AmigaDOS 2.1 and up, but it is probably correctly set on more
* Amigas than the TZ environment variable is. We check that
* only if TZ is not validly set. We do not parse daylight
* savings syntax except to check for presence vs. absence of a
* DST part; United States rules are assumed. This is better
* than the tzset()s in the Amiga compilers' libraries do.
unzip-6.0/aosvs/aosvs.c view on Meta::CPAN
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 1, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/aosvs/make_unz.cli view on Meta::CPAN
push
prompt pop
searchlist :c_4.10 :c_4.10:lang_rt [!searchlist]
cc/link/NOUNX/NOSEA SYSV/DEFINE TERMIO/DEFINE AOS_VS/DEFINE=1 PROTO/DEFINE S_IFLNK/DEFINE=0120000 TIME.H/INCLUDE <unzip crc32 crypt envargs explode extract fileio globals inflate list match process ttyio ubz2err unreduce unshrink zipinfo aosvs>.c
pop
unzip-6.0/atari/atari.c view on Meta::CPAN
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/atheos/atheos.c view on Meta::CPAN
if ((G.end-G.buildpath) >= FILNAMSIZ) {
*--G.end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(G.buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/beos/beos.c view on Meta::CPAN
if ((G.end-G.buildpath) >= FILNAMSIZ) {
*--G.end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(G.buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(G.buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/crypt.c view on Meta::CPAN
GLOBAL(pInfo->encrypted) = TRUE;
if (GLOBAL(newzip)) { /* this is first encrypted member in this zipfile */
GLOBAL(newzip) = FALSE;
if (passwrd != (char *)NULL) { /* user gave password on command line */
if (!GLOBAL(key)) {
if ((GLOBAL(key) = (char *)malloc(strlen(passwrd)+1)) ==
(char *)NULL)
return PK_MEM2;
strcpy(GLOBAL(key), passwrd);
GLOBAL(nopwd) = TRUE; /* inhibit password prompting! */
}
} else if (GLOBAL(key)) { /* get rid of previous zipfile's key */
free(GLOBAL(key));
GLOBAL(key) = (char *)NULL;
}
}
/* if have key already, test it; else allocate memory for it */
if (GLOBAL(key)) {
if (!testp(__G__ h))
return PK_COOL; /* existing password OK (else prompt for new) */
else if (GLOBAL(nopwd))
return PK_WARN; /* user indicated no more prompting */
} else if ((GLOBAL(key) = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL)
return PK_MEM2;
/* try a few keys */
n = 0;
do {
r = (*G.decr_passwd)((zvoid *)&G, &n, GLOBAL(key), IZ_PWLEN+1,
GLOBAL(zipfn), GLOBAL(filename));
if (r == IZ_PW_ERROR) { /* internal error in fetch of PW */
free (GLOBAL(key));
GLOBAL(key) = NULL;
return PK_MEM2;
}
if (r != IZ_PW_ENTERED) { /* user replied "skip" or "skip all" */
*GLOBAL(key) = '\0'; /* We try the NIL password, ... */
n = 0; /* and cancel fetch for this item. */
}
if (!testp(__G__ h))
return PK_COOL;
if (r == IZ_PW_CANCELALL) /* User replied "Skip all" */
GLOBAL(nopwd) = TRUE; /* inhibit any further PW prompt! */
} while (n > 0);
return PK_WARN;
} /* end function decrypt() */
/***********************************************************************
* Test the password. Return -1 if bad, 0 if OK.
unzip-6.0/extract.c view on Meta::CPAN
break;
case IDM_REPLACE_NONE:
G.overwrite_mode = OVERWRT_NEVER;
/* FALL THROUGH, skip */
case IDM_REPLACE_NO:
skip_entry = SKIP_Y_EXISTING;
break;
}
#else /* !WINDLL */
extent fnlen;
reprompt:
Info(slide, 0x81, ((char *)slide,
LoadFarString(ReplaceQuery),
FnFilter1(G.filename)));
if (fgets(G.answerbuf, sizeof(G.answerbuf), stdin)
== (char *)NULL) {
Info(slide, 1, ((char *)slide,
LoadFarString(AssumeNone)));
*G.answerbuf = 'N';
if (!error_in_archive)
error_in_archive = 1; /* not extracted: warning */
unzip-6.0/extract.c view on Meta::CPAN
/* fall through ... */
default:
/* usually get \n here: remove it for nice display
(fnlen can be re-used here, we are outside the
"enter new filename" loop) */
fnlen = strlen(G.answerbuf);
if (lastchar(G.answerbuf, fnlen) == '\n')
G.answerbuf[--fnlen] = '\0';
Info(slide, 1, ((char *)slide,
LoadFarString(InvalidResponse), G.answerbuf));
goto reprompt; /* yet another goto? */
} /* end switch (*answerbuf) */
#endif /* ?WINDLL */
} /* end if (query) */
if (skip_entry != SKIP_NO) {
#ifdef WINDLL
if (skip_entry == SKIP_Y_EXISTING) {
/* report skipping of an existing entry */
Info(slide, 0, ((char *)slide,
((IS_OVERWRT_NONE || !uO.uflag || renamed) ?
"Target file exists. Skipping %s\n" :
unzip-6.0/fileio.c view on Meta::CPAN
!((Uz_Globs *)pG)->redirect_text)
return 0;
#endif
if (MSG_STDERR(flag) && !((Uz_Globs *)pG)->UzO.tflag)
outfp = (FILE *)stderr;
else
outfp = (FILE *)stdout;
#ifdef QUERY_TRNEWLN
/* some systems require termination of query prompts with '\n' to force
* immediate display */
if (MSG_MNEWLN(flag)) { /* assumes writable buffer (e.g., slide[]) */
*endbuf++ = '\n'; /* with room for one more char at end of buf */
++size; /* (safe assumption: only used for four */
} /* short queries in extract.c and fileio.c) */
#endif
if (MSG_TNEWLN(flag)) { /* again assumes writable buffer: fragile... */
if ((!size && !((Uz_Globs *)pG)->sol) ||
(size && (endbuf[-1] != '\n')))
unzip-6.0/fileio.c view on Meta::CPAN
#if (!defined(WINDLL) && !defined(MACOS))
/***************************/
/* Function UzpMorePause() */
/***************************/
void UZ_EXP UzpMorePause(pG, prompt, flag)
zvoid *pG; /* globals struct: always passed */
ZCONST char *prompt; /* "--More--" prompt */
int flag; /* 0 = any char OK; 1 = accept only '\n', ' ', q */
{
uch c;
/*---------------------------------------------------------------------------
Print a prompt and wait for the user to press a key, then erase prompt
if possible.
---------------------------------------------------------------------------*/
if (!((Uz_Globs *)pG)->sol)
fprintf(stderr, "\n");
/* numlines may or may not be used: */
fprintf(stderr, prompt, ((Uz_Globs *)pG)->numlines);
fflush(stderr);
if (flag & 1) {
do {
c = (uch)FGETCH(0);
} while (
#ifdef THEOS
c != 17 && /* standard QUIT key */
#endif
c != '\r' && c != '\n' && c != ' ' && c != 'q' && c != 'Q');
} else
c = (uch)FGETCH(0);
/* newline was not echoed, so cover up prompt line */
fprintf(stderr, LoadFarString(HidePrompt));
fflush(stderr);
if (
#ifdef THEOS
(c == 17) || /* standard QUIT key */
#endif
(ToLower(c) == 'q')) {
DESTROYGLOBALS();
EXIT(PK_COOL);
unzip-6.0/fileio.c view on Meta::CPAN
zvoid *pG; /* pointer to UnZip's internal global vars */
int *rcnt; /* retry counter */
char *pwbuf; /* buffer for password */
int size; /* size of password buffer */
ZCONST char *zfn; /* name of zip archive */
ZCONST char *efn; /* name of archive entry being processed */
{
#if CRYPT
int r = IZ_PW_ENTERED;
char *m;
char *prompt;
#ifndef REENTRANT
/* tell picky compilers to shut up about "unused variable" warnings */
pG = pG;
#endif
if (*rcnt == 0) { /* First call for current entry */
*rcnt = 2;
if ((prompt = (char *)malloc(2*FILNAMSIZ + 15)) != (char *)NULL) {
sprintf(prompt, LoadFarString(PasswPrompt),
FnFilter1(zfn), FnFilter2(efn));
m = prompt;
} else
m = (char *)LoadFarString(PasswPrompt2);
} else { /* Retry call, previous password was wrong */
(*rcnt)--;
prompt = NULL;
m = (char *)LoadFarString(PasswRetry);
}
m = getp(__G__ m, pwbuf, size);
if (prompt != (char *)NULL) {
free(prompt);
}
if (m == (char *)NULL) {
r = IZ_PW_ERROR;
}
else if (*pwbuf == '\0') {
r = IZ_PW_CANCELALL;
}
return r;
#else /* !CRYPT */
unzip-6.0/flexos/flexos.c view on Meta::CPAN
while ((*end = *pathcomp++) != '\0') {
++end;
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 1, ((char *)slide, LoadFarString(PathTooLongTrunc),
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/funzip.c view on Meta::CPAN
1.4 27 Aug 92 G. Roelofs added exit(0).
1.5 1 Sep 92 K. U. Rommel changed read/write modes for OS/2.
1.6 6 Sep 92 G. Roelofs modified to use dummy crypt.c and
crypt.h instead of -DCRYPT.
1.7 23 Sep 92 G. Roelofs changed to use DOS_OS2; included
crypt.c under MS-DOS.
1.8 9 Oct 92 M. Adler improved inflation error msgs.
1.9 17 Oct 92 G. Roelofs changed ULONG/UWORD/byte to ulg/ush/uch;
renamed inflate_entry() to inflate();
adapted to use new, in-place zdecode.
2.0 22 Oct 92 M. Adler allow filename argument, prompt for
passwords and don't echo, still allow
command-line password entry, but as an
option.
2.1 23 Oct 92 J-l. Gailly fixed crypt/store bug,
G. Roelofs removed crypt.c under MS-DOS, fixed
decryption check to compare single byte.
2.2 28 Oct 92 G. Roelofs removed declaration of key.
2.3 14 Dec 92 M. Adler replaced fseek (fails on stdin for SCO
Unix V.3.2.4). added quietflg for
inflate.c.
unzip-6.0/funzip.c view on Meta::CPAN
/* if entry encrypted, decrypt and validate encryption header */
if (encrypted)
#if CRYPT
{
ush i, e;
if (p == (char *)NULL) {
if ((p = (char *)malloc(IZ_PWLEN+1)) == (char *)NULL)
err(1, "out of memory");
else if ((p = getp("Enter password: ", p, IZ_PWLEN+1)) == (char *)NULL)
err(1, "no tty to prompt for password");
}
/* initialize crc_32_tab pointer for decryption */
CRC_32_TAB = get_crc_table();
/* prepare the decryption keys for extraction and check the password */
init_keys(p);
for (i = 0; i < RAND_HEAD_LEN; i++)
e = NEXTBYTE;
if (e != (ush)(h[LOCFLG] & EXTFLG ? h[LOCTIM + 1] : h[LOCCRC + 3]))
err(3, "incorrect password for first entry");
}
unzip-6.0/funzip.txt view on Meta::CPAN
a stream of (binary) compressed data and shows a short help text,
instead. If there is a file argument, then input is read from the
specified file instead of from stdin.
A password for encrypted zip files can be specified on the command line
(preceding the file name, if any) by prefixing the password with a
dash. Note that this constitutes a security risk on many systems; cur-
rently running processes are often visible via simple commands (e.g.,
ps(1) under Unix), and command-line histories can be read. If the
first entry of the zip file is encrypted and no password is specified
on the command line, then the user is prompted for a password and the
password is not echoed on the console.
Given the limitation on single-member extraction, funzip is most useful
in conjunction with a secondary archiver program such as tar(1). The
following section includes an example illustrating this usage in the
case of disk backups to tape.
EXAMPLES
To use funzip to extract the first member file of the archive test.zip
and to pipe it into more(1):
unzip-6.0/funzip.txt view on Meta::CPAN
To use zip and funzip in place of compress(1) and zcat(1) (or gzip(1L)
and gzcat(1L)) for tape backups:
tar cf - . | zip -7 | dd of=/dev/nrst0 obs=8k
dd if=/dev/nrst0 ibs=8k | funzip | tar xf -
(where, for example, nrst0 is a SCSI tape drive).
BUGS
When piping an encrypted file into more and allowing funzip to prompt
for password, the terminal may sometimes be reset to a non-echo mode.
This is apparently due to a race condition between the two programs;
funzip changes the terminal mode to non-echo before more reads its
state, and more then ``restores'' the terminal to this mode before
exiting. To recover, run funzip on the same file but redirect to
/dev/null rather than piping into more; after prompting again for the
password, funzip will reset the terminal properly.
There is presently no way to extract any member but the first from a
ZIP archive. This would be useful in the case where a ZIP archive is
included within another archive. In the case where the first member is
a directory, funzip simply creates the directory and exits.
The functionality of funzip should be incorporated into unzip itself
(future release).
unzip-6.0/human68k/human68k.c view on Meta::CPAN
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 1, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/macos/source/macos.c view on Meta::CPAN
#endif
if ((end-buildpath) >= NAME_MAX) {
*--end = '\0';
Info(slide, 0x201, ((char *)slide,
LoadFarString(PathTooLongTrunc),
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/macos/source/macunzip.c view on Meta::CPAN
#define lowercaseItem 2
#define convertMenu 135
#define autoItem 1
#define binaryItem 2
#define textItem 3
#define overwriteMenu 136
#define alwaysItem 1
#define neverItem 2
#define promptItem 3
#define infoMenu 137
#define prtCommentItem 2
#define prtHeaderItem 3
#define prtTotalsItem 4
#define formatMenu 138
#define filenameItem 1
#define longItem 2
#define mediumItem 3
unzip-6.0/macos/source/macunzip.c view on Meta::CPAN
default:
break;
}
break;
case overwriteMenu:
switch (theitem) {
case alwaysItem:
CheckItem(overwriteHandle, alwaysItem, true);
CheckItem(overwriteHandle, neverItem, false);
CheckItem(overwriteHandle, promptItem, false);
modifiers &= (allFlags ^ neverFlag);
modifiers |= overwriteFlag;
break;
case neverItem:
CheckItem(overwriteHandle, alwaysItem, false);
CheckItem(overwriteHandle, neverItem, true);
CheckItem(overwriteHandle, promptItem, false);
modifiers &= (allFlags ^ overwriteFlag);
modifiers |= neverFlag;
break;
case promptItem:
CheckItem(overwriteHandle, alwaysItem, false);
CheckItem(overwriteHandle, neverItem, false);
CheckItem(overwriteHandle, promptItem, true);
modifiers &= (allFlags ^ (neverFlag | overwriteFlag));
break;
default:
break;
}
break;
case infoMenu:
switch (theitem) {
case prtCommentItem:
unzip-6.0/macos/source/macunzip.c view on Meta::CPAN
CheckItem(convertHandle, binaryItem, true);
GetItemMark(overwriteHandle, alwaysItem, &markChar);
if (markChar) modifiers ^= overwriteFlag;
GetItemMark(overwriteHandle, neverItem, &markChar);
if (markChar) modifiers ^= neverFlag;
if ((modifiers & (neverFlag | overwriteFlag)) == (neverFlag | overwriteFlag)) {
CheckItem(overwriteHandle, alwaysItem, false);
CheckItem(overwriteHandle, neverItem, false);
CheckItem(overwriteHandle, promptItem, true);
modifiers &= (allFlags ^ (neverFlag | overwriteFlag));
} else if (modifiers & (neverFlag | overwriteFlag))
CheckItem(overwriteHandle, promptItem, false);
else
CheckItem(overwriteHandle, promptItem, true);
GetItemMark(infoHandle, prtCommentItem, &markChar);
if (markChar) modifiers ^= prtCommentFlag;
GetItemMark(infoHandle, prtHeaderItem, &markChar);
if (markChar) modifiers ^= prtHeaderFlag;
GetItemMark(infoHandle, prtTotalsItem, &markChar);
if (markChar) modifiers ^= prtTotalsFlag;
GetItemMark(formatHandle, filenameItem, &markChar);
if (markChar) modifiers ^= filenameFlag;
unzip-6.0/man/funzip.1 view on Meta::CPAN
shows a short help text, instead.
If there is a file argument, then input is read from the specified file
instead of from stdin.
.PP
A password for encrypted zip files can be specified
on the command line (preceding the file name, if any) by prefixing the
password with a dash. Note that this constitutes a security risk on many
systems; currently running processes are often visible via simple commands
(e.g., \fIps\fP(1) under Unix), and command-line histories can be read.
If the first entry of the zip file is encrypted and
no password is specified on the command line, then the user is prompted for
a password and the password is not echoed on the console.
.PP
Given the limitation on single-member extraction, \fIfunzip\fP is most
useful in conjunction with a secondary archiver program such as \fItar\fP(1).
The following section includes an example illustrating this usage in the
case of disk backups to tape.
.PD
.\" =========================================================================
.SH EXAMPLES
To use \fIfunzip\fP to extract the first member file of the archive test.zip
unzip-6.0/man/funzip.1 view on Meta::CPAN
.EX
tar cf \- . | zip \-7 | dd of=/dev/nrst0 obs=8k
dd if=/dev/nrst0 ibs=8k | funzip | tar xf \-
.EE
.PP
(where, for example, nrst0 is a SCSI tape drive).
.PD
.\" =========================================================================
.SH BUGS
When piping an encrypted file into \fImore\fP and allowing \fIfunzip\fP
to prompt for password, the terminal may sometimes be reset to a non-echo
mode. This is apparently due to a race condition between the two programs;
\fIfunzip\fP changes the terminal mode to non-echo before \fImore\fP reads
its state, and \fImore\fP then ``restores'' the terminal to this mode before
exiting. To recover, run \fIfunzip\fP on the same file but redirect to
/dev/null rather than piping into more; after prompting again for the
password, \fIfunzip\fP will reset the terminal properly.
.PP
There is presently no way to extract any member but the first from a ZIP
archive. This would be useful in the case where a ZIP archive is included
within another archive. In the case where the first member is a directory,
\fIfunzip\fP simply creates the directory and exits.
.PP
The functionality of \fIfunzip\fP should be incorporated into \fIunzip\fP
itself (future release).
.PD
unzip-6.0/man/unzip.1 view on Meta::CPAN
file system such as OS/2 HPFS or a case-sensitive one such as under
Unix. By default \fIunzip\fP lists and extracts such filenames exactly as
they're stored (excepting truncation, conversion of unsupported characters,
etc.); this option causes the names of all files from certain systems to be
converted to lowercase. The \fB\-LL\fP option forces conversion of every
filename to lowercase, regardless of the originating file system.
.TP
.B \-M
pipe all output through an internal pager similar to the Unix \fImore\fP(1)
command. At the end of a screenful of output, \fIunzip\fP pauses with a
``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing the
Enter (Return) key or the space bar. \fIunzip\fP can be terminated by
pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike
Unix \fImore\fP(1), there is no forward-searching or editing capability.
Also, \fIunzip\fP doesn't notice if long lines wrap at the edge of the screen,
effectively resulting in the printing of two or more lines and the likelihood
that some text will scroll off the top of the screen before being viewed.
On some systems the number of available lines on the screen is not detected,
in which case \fIunzip\fP assumes the height is 24 lines.
.TP
.B \-n
never overwrite existing files. If a file already exists, skip the extraction
of that file without prompting. By default \fIunzip\fP queries before
extracting any file that already exists; the user may choose to overwrite
only the current file, overwrite all files, skip extraction of the current
file, skip extraction of all existing files, or rename the current file.
.TP
.B \-N
[Amiga] extract file comments as Amiga filenotes. File comments are created
with the \-c option of \fIzip\fP(1L), or with the \-N option of the Amiga port
of \fIzip\fP(1L), which stores filenotes as comments.
.TP
.B \-o
overwrite existing files without prompting. This is a dangerous option, so
use it with care. (It is often used with \fB\-f\fP, however, and is the only
way to overwrite directory EAs under OS/2.)
.IP \fB\-P\fP\ \fIpassword\fP
use \fIpassword\fP to decrypt encrypted zipfile entries (if any). \fBTHIS IS
INSECURE!\fP Many multi-user operating systems provide ways for any user to
see the current command line of any other user; even on stand-alone systems
there is always the threat of over-the-shoulder peeking. Storing the plaintext
password as part of a command line in an automated script is even worse.
Whenever possible, use the non-echoing, interactive prompt to enter passwords.
(And where security is truly important, use strong encryption such as Pretty
Good Privacy instead of the relatively weak encryption provided by standard
zipfile utilities.)
.TP
.B \-q
perform operations quietly (\fB\-qq\fP = even quieter). Ordinarily \fIunzip\fP
prints the names of the files it's extracting or testing, the extraction
methods, any file or zipfile comments that may be stored in the archive,
and possibly a summary when finished with each archive. The \fB\-q\fP[\fBq\fP]
options suppress the printing of some or all of these messages.
unzip-6.0/man/unzip.1 view on Meta::CPAN
.PP
Some compiled versions of \fIunzip\fP may not support decryption.
To check a version for crypt support, either attempt to test or extract
an encrypted archive, or else check \fIunzip\fP's diagnostic
screen (see the \fB\-v\fP option above) for ``\fC[decryption]\fR'' as one
of the special compilation options.
.PP
As noted above, the \fB\-P\fP option may be used to supply a password on
the command line, but at a cost in security. The preferred decryption
method is simply to extract normally; if a zipfile member is encrypted,
\fIunzip\fP will prompt for the password without echoing what is typed.
\fIunzip\fP continues to use the same password as long as it appears to be
valid, by testing a 12-byte header on each file. The correct password will
always check out against the header, but there is a 1-in-256 chance that an
incorrect password will as well. (This is a security feature of the PKWARE
zipfile format; it helps prevent brute-force attacks that might otherwise
gain a large speed advantage by testing only the header.) In the case that
an incorrect password is given but it passes the header test anyway, either
an incorrect CRC will be generated for the extracted data or else \fIunzip\fP
will fail during the extraction because the ``decrypted'' bytes do not
constitute a valid compressed data stream.
.PP
If the first password fails the header check on some file, \fIunzip\fP will
prompt for another password, and so on until all files are extracted. If
a password is not known, entering a null password (that is, just a carriage
return or ``Enter'') is taken as a signal to skip all further prompting.
Only unencrypted files in the archive(s) will thereafter be extracted. (In
fact, that's not quite true; older versions of \fIzip\fP(1L) and
\fIzipcloak\fP(1L) allowed null passwords, so \fIunzip\fP checks each encrypted
file to see if the null password works. This may result in ``false positives''
and extraction errors, as noted above.)
.PP
Archives encrypted with 8-bit passwords (for example, passwords with accented
European characters) may not be portable across systems and/or other
archivers. This problem stems from the use of multiple encoding methods for
such characters, including Latin-1 (ISO 8859-1) and OEM code page 850.
unzip-6.0/man/unzipsfx.1 view on Meta::CPAN
option (\fB\-t\fP) may be used as a ``poor man's'' listing. Alternatively,
those creating self-extracting archives may wish to include a short listing
in the zipfile comment.
.PP
See \fIunzip\fP(1L) for a more complete description of these options.
.PD
.\" =========================================================================
.SH MODIFIERS
\fIunzipsfx\fP currently supports all \fIunzip\fP(1L) modifiers: \fB\-a\fP
(convert text files), \fB\-n\fP (never overwrite), \fB\-o\fP (overwrite
without prompting), \fB\-q\fP (operate quietly), \fB\-C\fP (match names
case-insensitively), \fB\-L\fP (convert uppercase-OS names to lowercase),
\fB\-j\fP (junk paths) and \fB\-V\fP (retain version numbers); plus the
following operating-system specific options: \fB\-X\fP (restore VMS
owner/protection info), \fB\-s\fP (convert spaces in filenames to underscores
[DOS, OS/2, NT]) and \fB\-$\fP (restore volume label [DOS, OS/2, NT, Amiga]).
.PP
(Support for regular ASCII text-conversion may be removed in future versions,
since it is simple enough for the archive's creator to ensure that text
files have the appropriate format for the local OS. EBCDIC conversion will
of course continue to be supported since the zipfile format implies ASCII
unzip-6.0/man/unzipsfx.1 view on Meta::CPAN
.PD
.\" =========================================================================
.SH "ENVIRONMENT OPTIONS"
\fIunzipsfx\fP uses the same environment variables as \fIunzip\fP(1L) does,
although this is likely to be an issue only for the person creating and
testing the self-extracting archive. See \fIunzip\fP(1L) for details.
.PD
.\" =========================================================================
.SH DECRYPTION
Decryption is supported exactly as in \fIunzip\fP(1L); that is, interactively
with a non-echoing prompt for the password(s). See \fIunzip\fP(1L) for
details. Once again, note that if the archive has no encrypted files there
is no reason to use a version of \fIunzipsfx\fP with decryption support;
that only adds to the size of the archive.
.PD
.\" =========================================================================
.SH AUTORUN COMMAND
When \fIunzipsfx\fP was compiled with CHEAP_SFX_AUTORUN defined, a simple
``command autorun'' feature is supported. You may enter a command into the
Zip archive comment, using the following format:
.PP
.EX
$AUTORUN$>[command line string]
.EE
.PP
When \fIunzipsfx\fP recognizes the ``$AUTORUN$>'' token at the beginning
of the Zip archive comment, the remainder of the first line of the comment
(until the first newline character) is passed as a shell command to the
operating system using the C rtl ``system'' function. Before executing
the command, \fIunzipsfx\fP displays the command on the console and prompts
the user for confirmation. When the user has switched off prompting by
specifying the \fB-q\fP option, autorun commands are never executed.
.PP
In case the archive comment contains additional lines of text, the remainder
of the archive comment following the first line is displayed normally, unless
quiet operation was requested by supplying a \fB-q\fP option.
.PD
.\" =========================================================================
.SH EXAMPLES
To create a self-extracting archive \fIletters\fP from a regular zipfile
\fIletters.zip\fP and change the new archive's permissions to be
unzip-6.0/man/zipinfo.1 view on Meta::CPAN
.B \-v
list zipfile information in verbose, multi-page format.
.TP
.B \-h
list header line. The archive name, actual size (in bytes) and total number
of files is printed.
.TP
.B \-M
pipe all output through an internal pager similar to the Unix \fImore\fP(1)
command. At the end of a screenful of output, \fIzipinfo\fP pauses with a
``\-\-More\-\-'' prompt; the next screenful may be viewed by pressing the
Enter (Return) key or the space bar. \fIzipinfo\fP can be terminated by
pressing the ``q'' key and, on some systems, the Enter/Return key. Unlike
Unix \fImore\fP(1), there is no forward-searching or editing capability.
Also, \fIzipinfo\fP doesn't notice if long lines wrap at the edge of the
screen, effectively resulting in the printing of two or more lines and the
likelihood that some text will scroll off the top of the screen before being
viewed. On some systems the number of available lines on the screen is not
detected, in which case \fIzipinfo\fP assumes the height is 24 lines.
.TP
.B \-t
unzip-6.0/msdos/msdos.c view on Meta::CPAN
while ((*end = *pathcomp++) != '\0') {
++end;
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 1, ((char *)slide, LoadFarString(PathTooLongTrunc),
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/netware/netware.c view on Meta::CPAN
if ((end-buildpath) >= FILNAMSIZ) {
*--end = '\0';
Info(slide, 0x201, ((char *)slide,
"checkdir warning: path too long; truncating\n\
%s\n -> %s\n",
FnFilter1(G.filename), FnFilter2(buildpath)));
return MPN_INF_TRUNC; /* filename truncated */
}
}
Trace((stderr, "buildpath now = [%s]\n", FnFilter1(buildpath)));
/* could check for existence here, prompt for new name... */
return MPN_OK;
}
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
/* GRR: for VMS and TOPS-20, add up to 13 to strlen */
unzip-6.0/new-cmdparser/unz6-newcmdparser-diffs.txt view on Meta::CPAN
+#endif
+#ifdef MORE
+# ifdef CMS_MVS
+ {UZO, "m", "", o_NO_VALUE, o_NEGATABLE,
+ 'm', "pipe output through more"},
+# endif
+ {UZO, "M", "", o_NO_VALUE, o_NEGATABLE,
+ 'M', "pipe output through more"},
+#endif /* MORE */
+ {UZO, "n", "", o_NO_VALUE, o_NEGATABLE,
+ 'n', "never overwrite files (no prompting)"},
+#ifdef AMIGA
+ {UZO, "N", "", o_NO_VALUE, o_NEGATABLE,
+ 'N', "restore comments as filenotes"},
+#endif
+ {UZO, "o", "", o_NO_VALUE, o_NEGATABLE,
+ 'o', "overwrite files without prompting"},
+ {UZO, "p", "", o_NO_VALUE, o_NEGATABLE,
+ 'p', "pipe extraction to stdout, no messages"},
+#if CRYPT
+ {UZO, "P", "", o_REQUIRED_VALUE, o_NEGATABLE,
+ 'P', "password"},
+#endif
+ {UZO, "q", "", o_NO_VALUE, o_NEGATABLE,
+ 'q', "quiet"},
+#ifdef QDOS
+ {UZO, "Q", "", o_NO_VALUE, o_NEGATABLE,
unzip-6.0/new-cmdparser/unz6-newcmdparser-diffs.txt view on Meta::CPAN
- else
- uO.N_flag = TRUE;
- break;
+ case ('N'): /* restore comments as filenotes */
+ if (negative)
+ uO.N_flag = FALSE, negative = 0;
+ else
+ uO.N_flag = TRUE;
+ break;
#endif /* AMIGA */
- case ('o'): /* OK to overwrite files without prompting */
- if (negative) {
- uO.overwrite_all = MAX(uO.overwrite_all-negative,0);
- negative = 0;
- } else
- ++uO.overwrite_all;
- break;
- case ('p'): /* pipes: extract to stdout, no messages */
- if (negative) {
- uO.cflag = FALSE;
- uO.qflag = MAX(uO.qflag-999,0);
- negative = 0;
- } else {
- uO.cflag = TRUE;
- uO.qflag += 999;
- }
- break;
+ case ('o'): /* OK to overwrite files without prompting */
+ if (negative) {
+ uO.overwrite_all = MAX(uO.overwrite_all-negative,0);
+ negative = 0;
+ } else
+ ++uO.overwrite_all;
+ break;
+ case ('p'): /* pipes: extract to stdout, no messages */
+ if (negative) {
+ uO.cflag = FALSE;
+ uO.qflag = MAX(uO.qflag-999,0);
unzip-6.0/os2/os2.c view on Meta::CPAN
* Note that truncation can only happen when the HPFS path (which is
* never shorter than the FAT path) has been already truncated.
* So, emission of the warning message and setting the error code
* has already happened.
*/
if ((G.os2.endFAT-G.os2.buildpathFAT) >= FILNAMSIZ)
G.os2.buildpathFAT[FILNAMSIZ-1] = '\0';
Trace((stderr, "buildpathHPFS: %s\nbuildpathFAT: %s\n",
FnFilter1(G.os2.buildpathHPFS), FnFilter2(G.os2.buildpathFAT)));
return error; /* could check for existence, prompt for new name... */
} /* end if (FUNCTION == APPEND_NAME) */
/*---------------------------------------------------------------------------
INIT: allocate and initialize buffer space for the file currently being
extracted. If file was renamed with an absolute path, don't prepend the
extract-to path.
---------------------------------------------------------------------------*/
if (FUNCTION == INIT) {
unzip-6.0/process.c view on Meta::CPAN
if (error) {
if (error == IZ_DIR)
error_in_archive = PK_NOZIP;
else
error_in_archive = error;
if (error == PK_NOZIP)
Info(slide, 1, ((char *)slide, LoadFarString(CannotFindMyself),
G.zipfn));
}
#ifdef CHEAP_SFX_AUTORUN
if (G.autorun_command[0] && !uO.qflag) { /* NO autorun without prompt! */
Info(slide, 0x81, ((char *)slide, LoadFarString(AutorunPrompt),
FnFilter1(G.autorun_command)));
if (fgets(G.answerbuf, 9, stdin) != (char *)NULL
&& toupper(*G.answerbuf) == 'Y')
system(G.autorun_command);
else
Info(slide, 1, ((char *)slide, LoadFarString(NotAutoRunning)));
}
#endif /* CHEAP_SFX_AUTORUN */
unzip-6.0/qdos/IZREADME.SMS view on Meta::CPAN
over the nX_ type network device.
Config Options
--------------
A limited number of SMS/QDOS specific functions can be set using the
QJump Config program.
For Zip:
Timeout for interactive 'Press any key' prompt
65535 Wait forever (aka -1)
0 No wait
n (1-32767) Wait for 'n' clocks (1/50 sec)
Other values are unsupported. Note Config works on 'unsigned'
integer values (at least according to my manual).
Directory file type key.