[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: [PATCH] Quote filename passed to $EDITOR

From: Andrew Finkenstadt <andyf_at_simutronics.com>
Date: 2002-07-23 18:32:52 CEST

Why not use a replacement for system that doesn't run through a shell in the
first place, fork()/execve().

Andy

-----Original Message-----
From: Ulrich Drepper [mailto:drepper@redhat.com]
Sent: Tuesday, July 23, 2002 11:30 AM
To: Sander Striker
Cc: dev@subversion.tigris.org
Subject: Re: [PATCH] Quote filename passed to $EDITOR

On Tue, 2002-07-23 at 01:08, Sander Striker wrote:
> No time to commit right now.

> /* Now, run the editor command line. */
> - cmd = apr_psprintf (pool, "%s %s", editor, tmpfile_native);
> + cmd = apr_psprintf (pool, "%s \"%s\"", editor, tmpfile_native);
> sys_err = system (cmd);
> if (sys_err != 0)

Why not use single quotes? The above just opens a hole for environment
variable expansion (unintentional or malicious).

--
---------------.                          ,-.   1325 Chesapeake Terrace
Ulrich Drepper  \    ,-------------------'   \  Sunnyvale, CA 94089 USA
Red Hat          `--' drepper at redhat.com   `------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 23 18:33:35 2002

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.