unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Reiner Steib <4.uce.03.r.s@nurfuerspam.de>
Cc: Jesper Harder <harder@ifa.au.dk>, Richard Stallman <rms@gnu.org>
Subject: Re: Possible problem with Gnus
Date: Wed, 12 May 2004 11:59:42 +0200	[thread overview]
Message-ID: <v9fza60xv5.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: m3sme7hqmx.fsf@multivac.cwru.edu

On Tue, May 11 2004, Paul Jarc wrote:

> Reiner Steib <4.uce.03.r.s@nurfuerspam.de> wrote:
>> E.g. xdvi is launched as "xdvi -safer %s".
>
> What if the attachment's filename contains characters that would be
> dangerous for the shell?  Does Gnus use the filename in the message,
> or generate its own?

Gnus creates a new temporary directory[1].  The filename is rewritten
using `mm-file-name-rewrite-functions'[1,2] in order to avoid
dangerous characters.

(Cc-ing Jesper Harder, who improved `mm-file-name-rewrite-functions'
recently.)  I wonder if e.g. »`« and »&« should be removed too.
Jesper, could you explain why those are not deleted in
`mm-file-name-delete-gotchas'?  Testing...  Okay, Gnus already seems
to do proper quoting:

  [2. application/postscript; dan`ls`erous.ps]
  -> »Displaying gv -safer /tmp/ste/emm.11740F6T/dan\`ls\`erous.ps...«.

Bye, Reiner.

[1] See the function `mm-display-external' in `mm-decode.el':

--8<---------------cut here---------------start------------->8---
	(let* ((dir (mm-make-temp-file
		     (expand-file-name "emm." mm-tmp-directory) 'dir))
	       (filename (or
			  (mail-content-type-get
			   (mm-handle-disposition handle) 'filename)
			  (mail-content-type-get
			   (mm-handle-type handle) 'name)))
[...]
	       file buffer)
	  ;; We create a private sub-directory where we store our files.
	  (set-file-modes dir 448)
	  (if filename
	      (setq file (expand-file-name
			  (gnus-map-function mm-file-name-rewrite-functions
					     (file-name-nondirectory filename))
			  dir))
	    (setq file (mm-make-temp-file (expand-file-name "mm." dir))))
--8<---------------cut here---------------end--------------->8---

[2]
,----[ (info "(emacs-mime)Files and Directories") ]
| `mm-file-name-rewrite-functions'
|      A list of functions used for rewriting file names of MIME parts.
|      Each function is applied successively to the file name.
|      Ready-made functions include
| 
|     `mm-file-name-delete-control'
|           Delete all control characters.
| 
|     `mm-file-name-delete-gotchas'
|           Delete characters that could have unintended consequences
|           when used with flawed shell scripts, i.e. `|', `>' and `<';
|           and `-', `.' as the first character.
`----
-- 
       ,,,
      (o o)
---ooO-(_)-Ooo--- PGP key available via WWW   http://rsteib.home.pages.de/

  reply	other threads:[~2004-05-12  9:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-09 23:07 Gnus for next release Miles Bader
2004-05-09 23:19 ` John Wiegley
2004-05-09 23:29 ` Stefan Monnier
2004-05-09 23:54   ` Miles Bader
2004-05-10  7:34     ` Frank Schmitt
2004-05-10  8:31 ` David Kastrup
2004-05-10 10:04   ` Reiner Steib
2004-05-11 12:22     ` Possible problem with Gnus Richard Stallman
2004-05-11 12:40       ` David Kastrup
2004-05-12 19:40         ` Richard Stallman
2004-05-11 13:48       ` Stefan Monnier
2004-05-11 16:07       ` Reiner Steib
2004-05-11 16:31         ` Paul Jarc
2004-05-12  9:59           ` Reiner Steib [this message]
2004-05-12 14:15             ` Paul Jarc
2004-05-12 15:48               ` Jesper Harder
2004-05-12 16:39               ` Reiner Steib
2004-05-12 15:36             ` Jesper Harder
2004-05-11 17:51         ` Stefan Monnier
2004-05-12  9:59           ` Reiner Steib
2004-05-12 10:34             ` David Kastrup
2004-05-13 15:45               ` Richard Stallman
2004-05-13 17:25                 ` David Kastrup
2004-05-13 17:59                   ` Stefan Monnier
2004-05-13 19:07                     ` David Kastrup
2004-05-14 21:01                   ` Richard Stallman
2004-05-14 21:18                     ` David Kastrup
2004-05-15 18:33                       ` Richard Stallman
2004-05-23  3:46                         ` Andy Tai
2004-05-23  3:48                         ` Andy Tai
2004-05-10 17:54 ` Gnus for next release Richard Stallman
2004-05-10 18:23   ` David Kastrup

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=v9fza60xv5.fsf@marauder.physik.uni-ulm.de \
    --to=4.uce.03.r.s@nurfuerspam.de \
    --cc=harder@ifa.au.dk \
    --cc=reiner.steib@gmx.de \
    --cc=rms@gnu.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.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).