Gnus development mailing list
 help / color / mirror / Atom feed
* mml attached filename with double-quote
@ 2010-03-17  0:42 Kevin Ryde
  2010-03-17  2:56 ` Katsumi Yamaoka
  0 siblings, 1 reply; 2+ messages in thread
From: Kevin Ryde @ 2010-03-17  0:42 UTC (permalink / raw)
  To: ding

[-- 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))

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: mml attached filename with double-quote
  2010-03-17  0:42 mml attached filename with double-quote Kevin Ryde
@ 2010-03-17  2:56 ` Katsumi Yamaoka
  0 siblings, 0 replies; 2+ messages in thread
From: Katsumi Yamaoka @ 2010-03-17  2:56 UTC (permalink / raw)
  To: ding

>>>>> Kevin Ryde wrote:
> 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.

It looks worth improving.  I've applied the patch to Gnus trunk
and Emacs trunk.  Thanks.



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-17  2:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17  0:42 mml attached filename with double-quote Kevin Ryde
2010-03-17  2:56 ` Katsumi Yamaoka

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).