From aa1a3e0cf6389f5ee629c4246e78ca1a40f9676f Mon Sep 17 00:00:00 2001 From: Russ Magee Date: Sun, 22 Oct 2017 00:21:01 -0700 Subject: [PATCH] Fix for -z option being ignored in openpgp mode and incorrect filenames --- src/gaaout.c | 4 ++-- src/mcrypt.c | 8 ++++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/gaaout.c b/src/gaaout.c index f9c03d3..cc8798b 100644 --- a/src/gaaout.c +++ b/src/gaaout.c @@ -138,8 +138,8 @@ void gaa_help(void) __gaa_helpsingle('k', "key", _("KEY1 KEY2...KEYN "), _("Specify the key(s)")); __gaa_helpsingle(0, "noiv", "", _("Do not use an IV.")); __gaa_helpsingle('b', "bare", "", _("Do not keep algorithm information in the encrypted file.")); - __gaa_helpsingle('z', "gzip", "", _("Use gzip to compress files before encryption.")); - __gaa_helpsingle('p', "bzip2", "", _("Use bzip2 to compress files before encryption.")); + __gaa_helpsingle('z', "gzip", "", _("Use gzip to compress/decompress files before/after encryption/decryption. NOTE: cannot be used if openpgp mode is active.")); + __gaa_helpsingle('p', "bzip2", "", _("Use bzip2 to compress/decompress files before/after encryption/decryption. NOTE: cannot be used if openpgp mode is active.")); __gaa_helpsingle(0, "flush", "", _("Immediately flush the output")); __gaa_helpsingle('l', "doublecheck", "", _("Double check passwords.")); __gaa_helpsingle('u', "unlink", "", _("Unlink the input file after encryption or decryption.")); diff --git a/src/mcrypt.c b/src/mcrypt.c index f3af1ba..2a5fa46 100644 --- a/src/mcrypt.c +++ b/src/mcrypt.c @@ -552,11 +552,15 @@ int main(int argc, char **argv) continue; } #ifdef ZIP + if ((openpgp != 0) && ( gzipflag == TRUE || bzipflag == TRUE )) { + err_quit(_("Error: Cannot use -z with openpgp mode (does not call gzip or bzip)\n")); + } + if (stream_flag == FALSE) { if (gzipflag == TRUE) - strcat(outfile, ".gz"); + if (openpgp == 0) strcat(outfile, ".gz"); if (bzipflag == TRUE) - strcat(outfile, ".bz2"); + if (openpgp == 0) strcat(outfile, ".bz2"); } #endif strcat(outfile, ".nc");