svn+apache 每个目录访问控制:奇怪的权限问题(403 禁止错误)
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1154885/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
svn+apache per directory access control: weird permissions issue (403 Forbidden error)
提问by user10
I had a perfectly working svn+apache install where I was using per directory access control to restrict access to various parts of the repository. In particular, no one had access to the top level in the repository [/]. People had access to folders like [/www] etc. I was specifying these permissions in a file (svn-access-file).
我有一个完美运行的 svn+apache 安装,我在其中使用每个目录访问控制来限制对存储库各个部分的访问。特别是,没有人可以访问存储库中的顶层 [/]。人们可以访问 [/www] 等文件夹。我在文件 (svn-access-file) 中指定了这些权限。
I had to move to a new machine. So I installed subversion-1.6.3 and httpd-2.2.11 on it, and modified the conf file to mimic the conf file on the old machine (and I copied the svn-access-file and the svn-auth-file). Then I took an svn dump and did a load to put stuff back in the new repository. Now I can check stuff out, modify stuff, and commit. However, as soon as I try to do an 'svn up' on an already checked out copy of some sub-folder [/www/people], I get the following error:
我不得不搬到一台新机器上。所以我在上面安装了 subversion-1.6.3 和 httpd-2.2.11,并修改了 conf 文件以模仿旧机器上的 conf 文件(我复制了 svn-access-file 和 svn-auth-file)。然后我进行了 svn dump 并加载了一些东西到新的存储库中。现在我可以检查内容、修改内容和提交。但是,一旦我尝试在某个子文件夹 [/www/people] 的已检出副本上执行“svn up”,我会收到以下错误:
svn: Server sent unexpected return value (403 Forbidden) in response to OPTIONS request for 'https://[servername]/svn'
It seems the problem is that it is trying to access the top level directory [/] even though really it should only be trying to access [/www]. If I temporarily give the user access to [/], it works.
似乎问题在于它试图访问顶级目录 [/],即使它实际上应该只尝试访问 [/www]。如果我暂时授予用户对 [/] 的访问权限,它会起作用。
Can someone please tell me how to fix this? Everything worked on the old machine.
有人可以告诉我如何解决这个问题吗?一切都在旧机器上工作。
Thanks! Gaurav
谢谢!高拉夫
采纳答案by user10
Turns out this is a long standing bug in the subversion client. Here's the bug report:
事实证明,这是 subversion 客户端中长期存在的错误。这是错误报告:
http://subversion.tigris.org/issues/show_bug.cgi?id=3242
http://subversion.tigris.org/issues/show_bug.cgi?id=3242
It will probably get fixed in the next major release - 1.7 In the meantime, here's a hack workaround:
它可能会在下一个主要版本中得到修复 - 1.7 同时,这里有一个 hack 解决方法:
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2357123
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=2357123
I copied the 'if' statement into the source code for mod_authz_svn.c and rebuilt svn and it works now :)
我将“if”语句复制到 mod_authz_svn.c 的源代码中并重建了 svn,它现在可以工作了:)
回答by Sergey Stolyarov
Here is also workaround I've found in the bug discussion. If you have problems with updating local copy try to switch local copy to the same URL.
这也是我在错误讨论中找到的解决方法。如果您在更新本地副本时遇到问题,请尝试将本地副本切换到相同的 URL。

