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

Re: [PATCH] Explicitly set PATH in the template hook scripts

From: Peter S. Housel <housel_at_acm.org>
Date: 2004-10-26 07:04:40 CEST

On Tue, 2004-10-19 at 09:55, Greg Hudson wrote:
> On Tue, 2004-10-19 at 00:30, Peter S. Housel wrote:
> > Following a discussion on #svn-dev, here is a patch to show the PATH
> > environment variable being set explicitly in the hook script templates,
> > alerting administrators to the fact that the passed-in environment can't
> > necessarily be depended on.
>
> I'm not sure if it's a good idea to assume that /bin:/usr/bin is a
> decent path setting.

I think SVN_BINARY_DIR ":/bin:/usr/bin" is as a good a default setting
as any. Since the file that's being generated is just a template, the
PATH setting can be easily changed if it's not valid for the given
installation.

> Perhaps SVN_BINARY_DIR ":$PATH" would be a better choice?

That would defeat part of the purpose of setting it in the first place;
it might allow people to circumvent tests in (arguably sloppily-written)
hook scripts by passing in a weird PATH.

> Also, if you don't "export PATH", you will get different behavior for
> different implementations of /bin/sh, as far as whether the modified
> value propagates to subprocesses. A POSIX shell will propagate the
> modified value to subprocesses, but (for example) the Solaris /bin/sh
> will propagate the old value.

You're right; I've attached a corrected patch.

-Peter-

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Received on Tue Oct 26 07:04:52 2004

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.