<<< Date Index >>>     <<< Thread Index >>>

Re: Sanitizing attachment file names : too much



On 2006-04-18 15:42:39 +0200, Thomas Parmelan wrote:

> I think (but didn't have the time to verify) that this is a side-effect
> of this recent entry in the changelog :

>     2006-03-28 01:08:28  Paul Walker  <paul@xxxxxxxxxxxxxxxxxxxxx>  (brendan)
> 
>           * recvattach.c: Sanitize attachment file names
>           (seatbelt for inattentive recipients).

> I don't know how to solve this but it is clearly a regression.

That change was indeed bad.

I'm committing this:

diff -u -r3.21 recvattach.c
--- recvattach.c        28 Mar 2006 01:08:28 -0000      3.21
+++ recvattach.c        18 Apr 2006 15:28:08 -0000
@@ -408,9 +408,6 @@
   else
     buf[0] = 0;
 
-  /* Remove any paths or bad characters */
-  mutt_sanitize_filename (buf, 1);
-
   prompt = _("Save to file: ");
   while (prompt)
   {
@@ -487,10 +484,7 @@
        {
          int append = 0;
 
-         strfcpy (buf, NONULL (top->filename), sizeof (buf));
-
-         /* Remove any paths or bad characters */
-         mutt_sanitize_filename (buf, 1);
+         strfcpy (buf, mutt_basename (NONULL (top->filename)), sizeof (buf));
 
          if (mutt_get_field (_("Save to file: "), buf, sizeof (buf),
                                    M_FILE | M_CLEAR) != 0 || !buf[0])


-- 
Thomas Roessler · Personal soap box at <http://log.does-not-exist.org/>.