Return-Path: X-Original-To: apmail-subversion-commits-archive@minotaur.apache.org Delivered-To: apmail-subversion-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 390009F9B for ; Fri, 30 Mar 2012 13:45:37 +0000 (UTC) Received: (qmail 34935 invoked by uid 500); 30 Mar 2012 13:45:37 -0000 Delivered-To: apmail-subversion-commits-archive@subversion.apache.org Received: (qmail 34593 invoked by uid 500); 30 Mar 2012 13:45:36 -0000 Mailing-List: contact commits-help@subversion.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@subversion.apache.org Delivered-To: mailing list commits@subversion.apache.org Received: (qmail 34412 invoked by uid 99); 30 Mar 2012 13:45:35 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 13:45:35 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=5.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [78.47.87.163] (HELO mx0.elegosoft.com) (78.47.87.163) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 30 Mar 2012 13:45:28 +0000 Received: from localhost (localhost [127.0.0.1]) by mx0.elegosoft.com (Postfix) with ESMTP id 40C26DE8CE; Fri, 30 Mar 2012 15:45:06 +0200 (CEST) Received: from mx0.elegosoft.com ([127.0.0.1]) by localhost (mx0.elegosoft.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 22AgTPPYQDR5; Fri, 30 Mar 2012 15:45:06 +0200 (CEST) Received: from daniel3.local (bzq-79-180-206-85.red.bezeqint.net [79.180.206.85]) by mx0.elegosoft.com (Postfix) with ESMTPSA id 7DFAEDE8CD; Fri, 30 Mar 2012 15:45:05 +0200 (CEST) Date: Fri, 30 Mar 2012 16:44:54 +0300 From: Daniel Shahaf To: dev@subversion.apache.org Cc: commits@subversion.apache.org Subject: Re: svn commit: r1292246 - /subversion/trunk/subversion/libsvn_repos/hooks.c Message-ID: <20120330134453.GA17730@daniel3.local> References: <20120222114335.596A523889B3@eris.apache.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20120222114335.596A523889B3@eris.apache.org> User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Checked: Checked by ClamAV on apache.org Bert, rhuijben@apache.org wrote on Wed, Feb 22, 2012 at 11:43:35 -0000: > Author: rhuijben > Date: Wed Feb 22 11:43:34 2012 > New Revision: 1292246 > > URL: http://svn.apache.org/viewvc?rev=1292246&view=rev > Log: > Revert r1240999. This patch causes an unexpected behavior change on Windows, > where before this patch the %PATH% variable was still available for hooks. > > This unbreaks the svnlook tests on the Windows-RA buildbot. > Does the patch below result in pre-r1240999 behaviour on Windows? (The mod_dav_svn part is needed anyway to make INHERIT_VALUE(hooks_env) be able to return either the parent's or the child's hooks_env.) [[[ Index: subversion/mod_dav_svn/mod_dav_svn.c =================================================================== --- subversion/mod_dav_svn/mod_dav_svn.c (revision 1307158) +++ subversion/mod_dav_svn/mod_dav_svn.c (working copy) @@ -195,7 +195,7 @@ create_dir_config(apr_pool_t *p, char *dir) conf->root_dir = svn_urlpath__canonicalize(dir, p); conf->bulk_updates = CONF_FLAG_ON; conf->v2_protocol = CONF_FLAG_ON; - conf->hooks_env = apr_hash_make(p); + conf->hooks_env = NULL; return conf; } @@ -543,6 +543,9 @@ SVNHooksEnv_cmd(cmd_parms *cmd, void *config, cons dir_conf_t *conf = config; const char *name; const char *val; + + if (! conf->hooks_env) + conf->hooks_env = apr_hash_make(cmd->pool); name = apr_pstrdup(apr_hash_pool_get(conf->hooks_env), APR_ARRAY_IDX(var, 0, const char *)); Index: subversion/libsvn_repos/hooks.c =================================================================== --- subversion/libsvn_repos/hooks.c (revision 1307158) +++ subversion/libsvn_repos/hooks.c (working copy) @@ -172,7 +172,7 @@ env_from_env_hash(apr_hash_t *env_hash, const char **env; const char **envp; - if (!env_hash || apr_hash_count(env_hash) == 0) + if (!env_hash) return NULL; env = apr_palloc(result_pool, ]]] > After this patch Apr cleans the entire environment and svnlook.exe is unable > to find shared libraries like libapr-1.dll. > > I think apr should be fixed to behave the same way on Windows as on unix > and we -as subversion project- should check if removing %PATH% on Windows > is a breaking change. > > * subversion/libsvn_repos/hooks.c > (env_from_env_hash): Revert to returning NULL for a NULL hash. > > Modified: > subversion/trunk/subversion/libsvn_repos/hooks.c > > Modified: subversion/trunk/subversion/libsvn_repos/hooks.c > URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/libsvn_repos/hooks.c?rev=1292246&r1=1292245&r2=1292246&view=diff > ============================================================================== > --- subversion/trunk/subversion/libsvn_repos/hooks.c (original) > +++ subversion/trunk/subversion/libsvn_repos/hooks.c Wed Feb 22 11:43:34 2012 > @@ -172,7 +172,7 @@ env_from_env_hash(apr_hash_t *env_hash, > const char **env; > const char **envp; > > - if (!env_hash) > + if (!env_hash || apr_hash_count(env_hash) == 0) > return NULL; > > env = apr_palloc(result_pool, > >