我想在我的Subversion Edge“版本库访问规则”中使用LDAP组。
例如,如果LDAP用户smokris是LDAP组dev的成员,我希望能够授予dev组访问test-repository权限,而无需将组dev每个成员显式添加到资源库访问规则中。
这是什么语法?
我试过了:
[test-repository:/] dev=rw [/] *=
…但用户smokris被拒绝访问。
下载https://bitbucket.org/whitlockjc/jw-tools 。
创build一个如下所示的可执行脚本(替代您的目录和LDAPconfiguration):
#!/bin/bash CSVN_DIR=/home/csvn JW_TOOLS_DIR=/home/csvn/jw-tools # truncate the access file after the generated-content tag perl -0777 -pe 's/\n\n\n### Start generated content.*//s' \ < $CSVN_DIR/data/conf/svn_access_file \ > $CSVN_DIR/data/conf/svn_access_file.tmp # append the latest LDAP group configuration $JW_TOOLS_DIR/sync_ldap_groups_to_svn_authz/sync_ldap_groups_to_svn_authz.py \ --url="..." \ --bind-dn="..." --bind-password="..." \ --base-dn="..." \ --group-query="objectClass=posixGroup" \ --group-member-attribute="memberUid" \ --user-query="objectClass=posixAccount" \ --userid_attribute="uid" \ --quiet \ | grep -v '^\[groups\]' \ >> $CSVN_DIR/data/conf/svn_access_file.tmp mv -f $CSVN_DIR/data/conf/svn_access_file.tmp $CSVN_DIR/data/conf/svn_access_file
从cron定期运行脚本:
0 * * * * ~/update-ldap-groups