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

Re: Previous transaction name in pre-commit script?

From: Ryan Schmidt <subversion-2007b_at_ryandesign.com>
Date: 2007-11-22 02:33:22 CET

On Nov 21, 2007, at 03:00, Sas Janusz wrote:

>> I would think you'd also need the full path to svnlook, since
>> hooks are supposed to run with an empty environment, hence
>> they shouldn't be able to find svnlook or any other
>> executable on their own.
>
> Well, the doucmentation
> (http://svnbook.red-bean.com/en/1.4/
> svn.reposadmin.create.html#svn.repos
> admin.create.hooks) claims the same: "For security reasons, the
> Subversion repository executes hook programs with an empty
> environment-that is, no environment variables are set at all, not even
> $PATH (or %PATH%, under Windows). "
> Strange! The command shouldn't work at all. Since it does, I have
> added
> 1 line to my test pre-commit script, and now it looks this way:
>
> SET REPOS=%1
> SET TXN=%2
> FOR /F "tokens=1,2 delims= " %%i IN ('svnlook changed %REPOS% -t %
> TXN%')
> DO (
> ECHO %%j %TXN%> E:\check-file.txt
> )
> ECHO PATH:%PATH%>> E:\check-file.txt
> EXIT 0
>
> After committing some changes, the file E:\check-file.txt contained
> the
> full list of directories to search in, including 'C:\Program
> Files\Subversion\bin'. The environment doesn't look empty at all.
> Probably there is another obvious fact that I miss. However, I am
> going
> to add full paths to avoid any potential problems.

Several others have reported before that on Windows, the PATH is not
in fact empty in the hook scripts, though it is documented to be. I
believe it's a bug in Subversion that the PATH is not empty in these
cases, so using the full path in your hook scripts is a good idea,
for the time when this bug is fixed.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Thu Nov 22 02:34:26 2007

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

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