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

Re: [PATCH] fixes svn's chdir before invoking $EDITOR for commit log message

From: Karl Fogel <kfogel_at_newton.ch.collab.net>
Date: 2002-08-27 08:03:11 CEST

Zack Weinberg <zack@codesourcery.com> writes:
> you've missed the point. The chdir to the WC base has nothing to do
> with possible OS-level access problems. It's done because we have no
> other portable way to ensure that the file name passed to the external
> editor is not misinterpreted by the user's shell. Consider
> svnadmin create repos
> svn co file://`pwd`/repos "My Documents"
> touch "My Documents/2002 Proposal.doc"
> svn add "My Documents/2002 Proposal.doc"
> svn commit "My Documents"
> A space character is actually one of the easiest cases to deal with;
> the nasty ones are !`'"\ etc. SVN must assume that any single byte
> could appear in a file path, except 0x00.
> Not invoking the shell is also not an option, people expect to be able
> to embed shell constructs in EDITOR.

Are you sure about this, Zack?

Although I don't remember everything about that discussion of long
ago, my understanding was that we simply decided to punt on this
problem. If people commit files with funny names, they should use -F
or -m to pass the log message.

In any case, I don't see how our current behavior (before Alexis's
patch) would help solve this problem. The editor is still invoked on
possibly dangerous file names. Okay, I guess at least intermediate
directory names are not involved, so there's a slight gain, but that
hardly seems sufficient to have been our motivation for cd'ing to the
anchor directory.

If we really think this is a problem, we could write a function
svn_path_dangerous_p() that simply returns true if a path is "funny"
in the client environment (perhaps it should be apr_path_dangerous_p,
but whatever). When any such path is involved in the commit, we'd
refuse to pop up an editor, and insist that -F or -m be used instead.

But all that seems independent of Alexis's patch... (?)

Perhaps I'm missing some crucial scenario here; please educate me if
so, thanks... I didn't understand how your example above would be
handled well either before or after Alexis' patch.


To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Aug 27 08:24:05 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.