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

[PATCH] Explicitly set PATH in the template hook scripts

From: Peter S. Housel <housel_at_acm.org>
Date: 2004-10-19 06:30:23 CEST

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.

-Peter-

Include an explicit assignment to the PATH environment variable in
the hook templates.

* subversion/libsvn_repos/repos.c
  (create_hooks): In each of the hook templates, include an explicit
  assignment of the PATH environment variable to SVN_BINARY_DIR, /bin,
  and /usr/bin directories.

Index: subversion/libsvn_repos/repos.c
===================================================================
--- subversion/libsvn_repos/repos.c (revision 11479)
+++ subversion/libsvn_repos/repos.c (working copy)
@@ -306,6 +306,9 @@
       "# Here is an example hook script, for a Unix /bin/sh interpreter:"
       APR_EOL_STR
       APR_EOL_STR
+ "PATH=" SVN_BINARY_DIR ":/bin:/usr/bin"
+ APR_EOL_STR
+ APR_EOL_STR
       "REPOS=\"$1\""
       APR_EOL_STR
       "USER=\"$2\""
@@ -426,6 +429,9 @@
       "# Here is an example hook script, for a Unix /bin/sh interpreter:"
       APR_EOL_STR
       APR_EOL_STR
+ "PATH=" SVN_BINARY_DIR ":/bin:/usr/bin"
+ APR_EOL_STR
+ APR_EOL_STR
       "REPOS=\"$1\""
       APR_EOL_STR
       "TXN=\"$2\""
@@ -555,6 +561,9 @@
       "# Here is an example hook script, for a Unix /bin/sh interpreter:"
       APR_EOL_STR
       APR_EOL_STR
+ "PATH=" SVN_BINARY_DIR ":/bin:/usr/bin"
+ APR_EOL_STR
+ APR_EOL_STR
       "REPOS=\"$1\""
       APR_EOL_STR
       "REV=\"$2\""
@@ -658,6 +667,9 @@
       "# Here is an example hook script, for a Unix /bin/sh interpreter:"
       APR_EOL_STR
       APR_EOL_STR
+ "PATH=" SVN_BINARY_DIR ":/bin:/usr/bin"
+ APR_EOL_STR
+ APR_EOL_STR
       "REPOS=\"$1\""
       APR_EOL_STR
       "REV=\"$2\""
@@ -754,6 +766,9 @@
       "# Here is an example hook script, for a Unix /bin/sh interpreter:"
       APR_EOL_STR
       APR_EOL_STR
+ "PATH=" SVN_BINARY_DIR ":/bin:/usr/bin"
+ APR_EOL_STR
+ APR_EOL_STR
       "REPOS=\"$1\""
       APR_EOL_STR
       "REV=\"$2\""

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Oct 19 06:30:42 2004

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