Gnus development mailing list
 help / color / mirror / Atom feed
From: Kevin Ryde <user42@zip.com.au>
To: ding@gnus.org
Subject: mml attached filename with double-quote
Date: Wed, 17 Mar 2010 11:42:34 +1100	[thread overview]
Message-ID: <87sk7zu6bp.fsf@blah.blah> (raw)

[-- Attachment #1: Type: text/plain, Size: 555 bytes --]

I attached a filename /tmp/" (a double-quote) and on sending it went out
with file /tmp/\" (backslash and double-quote) attached instead.

This was very bad as I had private information in that \" file!
:-)

I think mml-read-tag should apply a `read'.  I don't suppose anyone
sends bizarrely named files, but it doesn't look hard to make it work.

2010-03-17  Kevin Ryde  <user42@zip.com.au>

	* mml.el (mml-read-tag): Unquote values with `read' to reverse
	prin1 in mml-insert-tag (just stripping the quotes gave wrong
	value if any backslash escapes).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mml.el.read-tag.diff --]
[-- Type: text/x-diff, Size: 558 bytes --]

--- mml.el.~7.80.~	2010-03-17 08:42:21.000000000 +1100
+++ mml.el	2010-03-17 11:35:42.000000000 +1100
@@ -392,8 +392,8 @@
       (skip-chars-forward "= \t\n")
       (setq val (buffer-substring-no-properties
 		 (point) (progn (forward-sexp 1) (point))))
-      (when (string-match "^\"\\(.*\\)\"$" val)
-	(setq val (match-string 1 val)))
+      (when (string-match "\\`\"" val)
+	(setq val (read val))) ;; inverse of prin1 in mml-insert-tag
       (push (cons (intern elem) val) contents)
       (skip-chars-forward " \t\n"))
     (goto-char (match-end 0))

             reply	other threads:[~2010-03-17  0:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-17  0:42 Kevin Ryde [this message]
2010-03-17  2:56 ` Katsumi Yamaoka

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sk7zu6bp.fsf@blah.blah \
    --to=user42@zip.com.au \
    --cc=ding@gnus.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).