[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#676422: marked as done (mpack: allow user to specify filename replacement character)



Your message dated Fri, 29 May 2020 00:33:35 +0000
with message-id <E1jeSxr-0000OM-W0@fasolo.debian.org>
and subject line Bug#676422: fixed in mpack 1.6-12
has caused the Debian Bug report #676422,
regarding mpack: allow user to specify filename replacement character
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
676422: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=676422
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
Subject: mpack: allow user to specify filename replacement character
Package: mpack
Version: 1.6-7
Severity: wishlist
Tags: patch

*** Please type your report below this line ***

When the attachment's suggested filename has spaces or other
undesirable characters, munpack replaces them with 'X'. ThisXisXugly,
and I'd prefer to let the user specify a replacement character. Here
is a patch that adds an option [-r character] so that munpack -r-
would produce "This-is-better". The default is still 'X', so as not to
disrupt any expectations. The manual page and usage string have been
updated accordingly. Thanks.


-- System Information:
Debian Release: 6.0.5
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-0.bpo.2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages mpack depends on:
ii  libc6                         2.11.3-3   Embedded GNU C Library: Shared lib

mpack recommends no packages.

Versions of packages mpack suggests:
ii  exim4-daemon-light [mail 4.72-6+squeeze2 lightweight Exim MTA (v4) daemon
pn  inews                    <none>          (no description available)

-- no debconf information

-- Patch below
diff --git a/unixos.c b/unixos.c
index 22a1080..f1db411 100644
--- a/unixos.c
+++ b/unixos.c
@@ -50,6 +50,7 @@ extern int errno;
 
 int overwrite_files = 0;
 int didchat;
+char replacement_char = 'X';
 
 /* The name of the file we're writing */
 static char *output_fname = 0;
@@ -194,13 +195,13 @@ FILE *os_newtypedfile(char *fname, char *contentType, int flags, params contentP
     for (p=fname; *p; p++) {
 	if (*p == '/') {
 	    if (!strncmp(p, "/../", 4)) {
-		p[1] = p[2] = 'X';
+		p[1] = p[2] = replacement_char;
 	    }
 	    *p = '\0';
 	    (void) mkdir(fname, 0777);
 	    *p = '/';
 	}
-	else if (!isprint(*p) || strchr(BADCHARS, *p)) *p = 'X';
+	else if (!isprint(*p) || strchr(BADCHARS, *p)) *p = replacement_char;
     }
 
     if (!fname[0]) {
diff --git a/unixunpk.c b/unixunpk.c
index e58882d..584b4ac 100644
--- a/unixunpk.c
+++ b/unixunpk.c
@@ -31,6 +31,7 @@
 
 extern int overwrite_files;
 extern int didchat;
+extern char replacement_char;
 int quiet;
 
 void usage(void);
@@ -43,7 +44,7 @@ int main(int argc, char **argv)
     FILE *file;
     int extractText = 0;
     
-    while ((opt = getopt(argc, argv, "qftC:")) != EOF) {
+    while ((opt = getopt(argc, argv, "qftr:C:")) != EOF) {
 	switch (opt) {
 	case 'f':
 	    overwrite_files = 1;
@@ -57,6 +58,11 @@ int main(int argc, char **argv)
 	    extractText = 1;
 	    break;
 
+	case 'r':
+	    replacement_char = optarg[0];
+            printf("Replacement: '%c'\n", replacement_char);
+	    break;
+
 	case 'C':
 	    if (chdir(optarg)) {
 		perror(optarg);
@@ -102,7 +108,7 @@ int main(int argc, char **argv)
 
 void usage(void) {
     fprintf(stderr, "munpack version %s\n", MPACK_VERSION);
-    fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-C directory] [files...]\n");
+    fprintf(stderr, "usage: munpack [-f] [-q] [-t] [-r character] [-C directory] [files...]\n");
     exit(1);
 }
 
diff --git a/unixunpk.man b/unixunpk.man
index 459fc0c..16e182f 100644
--- a/unixunpk.man
+++ b/unixunpk.man
@@ -13,6 +13,10 @@ munpack \- unpack messages in MIME or split-uuencode format
 .B \-t
 ]
 [
+.B \-r
+.I character
+]
+[
 .B \-C
 .I directory
 ]
@@ -59,6 +63,11 @@ default, text parts that do not have a filename parameter do not get
 unpacked.  This option effectively disables the ".desc" file feature
 for MIME messages.
 .TP
+.BI \-r " character"
+If the suggested filename contains invalid characters, they are
+replaced with this character. The default replacement character is
+"X".
+.TP
 .BI \-C " directory"
 Change the current directory to 
 .I directory



--- End Message ---
--- Begin Message ---
Source: mpack
Source-Version: 1.6-12
Done: Fabio Augusto De Muzio Tobich <ftobich@gmail.com>

We believe that the bug you reported is fixed in the latest version of
mpack, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 676422@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Fabio Augusto De Muzio Tobich <ftobich@gmail.com> (supplier of updated mpack package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Format: 1.8
Date: Thu, 28 May 2020 14:53:55 -0300
Source: mpack
Architecture: source
Version: 1.6-12
Distribution: experimental
Urgency: medium
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Fabio Augusto De Muzio Tobich <ftobich@gmail.com>
Closes: 527555 676422 749431 845747 869259 875699
Changes:
 mpack (1.6-12) experimental; urgency=medium
 .
   * QA upload.
   * Acknowledge previous NMUs. Thanks to Holger Levsen. (Closes: #875699)
   * debian/clean: created to remove files left behind on upstream directory.
   * debian/control:
       - Changed Rules-Requires-Root from 'binary-targets' to 'no' in source
         stanza.
       - Removed 'dpkg-dev' from 'Build-Depends' field.
   * debian/copyright:
       - Migrated to 1.0 format.
       - Updated all data.
   * debian/docs: created to include README.unix.
   * debian/patches:
       - debian/patches/01_legacy.patch: changed directory to store temporary
         files to '/tmp'. (Closes: #869259)
       - debian/patches/02_fix-permissions.patch: fixed patch header.
       - debian/patches/03_specify-filename-replacement-character.patch: added
         to provide new feature. Thanks to Christopher League. (Closes: #676422)
         Thanks to Christopher League.
       - debian/patches/04_fix-return-error-code.patch: added to fix a bug where
         munpack should return 1 on error. (Closes: #527555)
       - debian/patches/05_include-bug-report-in-manpages.patch: bug report
         section, with email, was included in manpages. (Closes: #527555)
       - debian/patches/06_fix-makefile.patch: added to fix Makefile.am so the
         package can be built with debhelper.
       - debian/patches/07_fix-decode-base64-attachment.patch: added.
         Thanks to Jacques Beigbeder. (LP: #1535630)
       - Renamed older patches to keep a naming pattern.
   * debian/rules: migrated to debhelper reduced form. (Closes: #749431, #845747)
Checksums-Sha1:
 766d53e55d0b7af354c576dc2d9cc6f89956b34d 1713 mpack_1.6-12.dsc
 9ffb831f8cc3997a0bb5943b50bdb2726d0df6b6 11808 mpack_1.6-12.debian.tar.xz
 77a02cc1519c9fd003b48aa696bd5ce805c693c8 5112 mpack_1.6-12_source.buildinfo
Checksums-Sha256:
 f2d9b2830b9bdc247c64278937554d148b80c54eef1dc013462461ce7abb19ff 1713 mpack_1.6-12.dsc
 d4af204f80b854fb817f2cc943c01c7254aa9953a7db9807f018c831b8ec50f4 11808 mpack_1.6-12.debian.tar.xz
 f7a98517cbd61ce86ee4db3bf7289d955a4db762f701df3639d9ea9891018f6d 5112 mpack_1.6-12_source.buildinfo
Files:
 f91f498d44032012afc097441a0a3b32 1713 mail optional mpack_1.6-12.dsc
 8b6068ec338c57a35ccb7b074b06c9e5 11808 mail optional mpack_1.6-12.debian.tar.xz
 14244987b7d6adad177f62ac8ea2290b 5112 mail optional mpack_1.6-12_source.buildinfo

-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEENX3LDuyVoBrrofDS3mO5xwTr6e8FAl7QUb8ACgkQ3mO5xwTr
6e/rsA//U9UmNloaahjlBvTKq5cN/cYv94d0vT9KctuAW3nPHX0ZuLqr8fPQOepy
6KQ17Rmt9Hkzbo1FwzQiDzr4qOpqwwy14KhxopJqYU8nswrJMGPGl8iWem8MZktn
c8kSo40xk0yeWBF1dceXIqogder+0kZybGjf4lHBTwwTjlqpmpSayfOqVl5jONjb
SWNyDH0mj7b9+eFRc6x3CY9AfUFzWppDc9eK4isD7SErAkQfTja63u45zmQi2fdk
GGqrgYXYLhbsNBZuizebKoz23p9mIYRhI1KHEr5FhzfZyx2p7uE8c9yj5tyIOTaG
C0FQjfW+tpNJ9Dceo+sCo+Q3A8OGonwOZez+AbjQzMhN8RQ4/iDwWi9TZaY9oELW
CAad13nDwDsSzSQJuPeMBkvPBU5T7n+2loIC41X+o7nf3JkNFY4H7G1MxNRwd5ap
FmbR1HixX5Qby6QNdoThio3vTjT6NRYurEZ8TcTmSK06J6QvdJzaE4n+Z26MhjDn
WKDGsuq1qCGoLNf0tyC9eOgoXQvPM3xWlZ8TrvwN//C+0+zYzL1UGq7fvRmZIvm2
u/yttDv6uE/IJpWZX4MkMdUfn4hD41taUcLTao8p3mDVJpwvNJdEEJXls5P7oTAl
OiRntqSYI4iJ79ahjrRBHcwfUk2azMZK9cpWoU4J0K91s+QRDWI=
=lMQp
-----END PGP SIGNATURE-----

--- End Message ---

Reply to: