我是 SVN 的新手,正在尝试为 SVN 上的多个项目配置访问控制.我想使用单个密码文件和单个身份验证文件对所有项目进行访问控制.但是,它不起作用.下面是我的配置.我的目录结构:
I am new to SVN and trying to configure access control for multiple projects on SVN. I want to use a single password file and a single authentication file for access control for all the projects. But, it isn't working. Below is my configurations. My directory structure:
/srv |--svn |--repos |-- conf |-- passwd |-- authz |-- projectX |-- projectY |-- projectZprojectX/conf/svnserve.conf 项目 X 的条目:
projectX/conf/svnserve.conf entries for projectX:
[general] anon-access = none auth-access = write password-db = /srv/svn/repos/conf/passwd authz-db = /srv/svn/repos/conf/authz realm = Project RepositoryprojectY 和 projectZ 使用相同的配置./srv/svn/repos/conf/passwd 的条目:
Same configuration is used for projectY and projectZ. Entries for /srv/svn/repos/conf/passwd:
[users] user1 = password user2 = password user3 = password/srv/svn/repos/conf/authz 的条目:
Entries for /srv/svn/repos/conf/authz:
[/] * = user1 = rw [projectX:/] user2 = rw user3 = r [projectY:/] user3 = rw user2 = r [projectZ:/] user2 = r user3 = r因此,user2 应该对 projectX 具有读写访问权限,user3 应该对 projectX 具有只读访问权限.但是,只有 user1 可以访问所有这些存储库.user2 和 user3 永远不能访问任何存储库.每次它都给出错误消息:提交失败(授权失败!)任何人都可以帮我找到我的错误吗?我在服务器上使用 Subversion 1.6.5 版,在客户端上使用 1.6.4 版.
So, user2 should have read-write access to projectX and user3 should have read-only access to projectX. But, only user1 can access all these repositories. user2 and user3 can never access any of the repositories. Every time it gives the error message: Commit failed (Authorization failed!) Can anyone please help me finding my error? I am using version 1.6.5 of Subversion on the server and 1.6.4 on the client.
推荐答案我已经在 Subversion 1.4 中成功地使用了这个结构:
I've successfully used this structure with Subversion 1.4:
Subversion |-- Config |-- a-users |-- b-users |--Repositories |-- x-repos |-- conf |-- svnserve.conf |-- y-repos |-- conf |-- svnserve.conf... 其中 svnserve.conf 文件包含这样一行:
... where the svnserve.conf files contained a line like this:
password-db = ../../../Config/a-users这样我可以为任意数量的存储库使用一个 password-db 文件,或者我可以为每个存储库使用一个单独的 password-db 文件.
This way I can use one password-db file for any number of repositories or I can have a separate password-db file for each repository.
如果您使用的是 Subversion > 1.4,则需要查看新版本中的配置发生了哪些变化.一点是,至少在 1.4 中,相对路径确实有效.希望这会有所帮助.
If you are using Subversion > 1.4, you'll need to to take a look at how configuration has changed in newer versions. One point is that, at least in 1.4, relative paths do work. Hope this helps.
更新:我使用的是 unix (Mac OS X).
Update: I'm on unix (Mac OS X).
更多推荐
使用SVN对多个项目进行访问控制
发布评论