[Fri Mar 31 21:16:30 2006] [error] [client 192.168.1.103] Access
denied: 'hehao' CHECKOUT
testsvn:/\xe5\xa4\xa7\xe5\xae\xb6\xe5\xa5\xbd\xe6\x89\x8d\xe6\x98\xaf\xe7\x9c\x9f\xe7\x9a\x84\xe5\xa
5\xbd
this error post by mod_authz_svn.c:
Line 454
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
"Access denied: '%s' %s %s",
r->user, r->method, repos_path);
and I think the reason is apache encode uri to UTF-8 and here did not
decode to ucs string.use python,we can clearly see:
>>> import codecs
>>> a='testsvn:/\xe5\xa4\xa7\xe5\xae\xb6\xe5\xa5\xbd\xe6\x89\x8d\xe6\x98\xaf\xe7
\x9c\x9f\xe7\x9a\x84\xe5\xa5\xbd'
>>> codecs.utf_8_decode(a)[0]
u'testsvn:/\u5927\u5bb6\u597d\u624d\u662f\u771f\u7684\u597d'
I fixed this bug by change a little code. and now
svn+apache+mod_authz_svn can support chinese repository name and
chinese directory name.
here is my change:
[mod_authz_svn.c]
//add declare
//++
extern
svn_error_t *
svn_utf_cstring_from_utf8 (const char **dest,
const char *src,
apr_pool_t *pool);
//in function req_check_access
//add declare
//++
char* curi;
svn_error_t* convert_error;
//add before any call
//++
convert_error=svn_utf_cstring_from_utf8(&curi,r->uri,r->pool);
if (convert_error)
{
curi = apr_pstrdup(r->pool, r->uri);
}
//change r->uri to curi
dav_err = dav_svn_split_uri(r,
curi,//r->uri,
conf->base_path,
&cleaned_uri,
&trailing_slash,
&repos_name,
&relative_path,
&repos_path);
//here is my test-case:
//acc.conf
[/]
*=r
[大家好:/]
*=r
[大家好:/大家好才是真的好]
*=rw
//console svn commit:
D:\apache2\Apache2\logs\a\大家好才是真的好>svn commit
--force-log --file cc.txt
认证领域:<http://192.168.1.103:8999> test Sources
"Administrator"的密码:
认证领域:<http://192.168.1.103:8999> test Sources
用户登录名:hehao
"hehao"的密码:******
新增 大家好才是真的好\cc.txt
传输文件数据.
提交后的修订版为 20。