首页 Soft PlugIn RAN乱 Dev开发 Info资料 English WAP 留言 登陆 注册
-
Posted by Yippee | 评论(3) | 引用(0) | 阅读9620次
CVSNT增加用户权限管理

CVSNT增加用户权限管理
bird 问:我使用CVSNT在代码库目录设置了访问权限,某些人只有底层几个目录的读写权限;在客户端用TortoiseCVS得要一个一个的取出,而且取出路径非常复杂,也不能一起更新;不知道你有没有碰到类似的问题,有没有方法解决??急等。。
我回答:我一般没有分配权限,因为我遵循XP开发,我查了一些资料,这个基本上没有办法。不过一般我都会分目录更新,这样提交比较明细一些。
www.shengfang.org
bird 回答:3ks,我觉得他应该向phpgacl判断角色权限一样,递归到最底层再返回结果,而不是碰到被拒绝就over了。
我回答:我也是觉得这么比较正常,下午我会实验一下,看看有没有什么办法~
www.shengfang.org
下午初步实验了一下,发现网上流传的资料好像不能生效
引用
4、  设置CVSROOT的权限
a)        cvs co CVSROOT www.shengfang.org
b)        cd CVSROOT www.shengfang.org
c)        cvs chacl default:n,缺省所有人都没有权限
d)        cvs chacl hutiejun:rwc,给管理员添加所有权限
e)         cvs chown hutiejun,所有者改成管理员

三、设置权限
cvs chacl
Usage: cvs chacl -R [-r tag] { user&line;default }:[{ [r][w][c]&line;[n] }] [directory...]
        -R     Recursively set permissions
        -r      Set permissions on specific branch
 



 如果没有进入CVS取出的目录 www.shengfang.org
c:\3> cvs chacl default:n
cvs chacl: in directory .: www.shengfang.org
cvs [chacl aborted]: there is no version here; do 'cvs checkout' first
进入后:
c:\3\4> cvs chacl default:n
cvs [server aborted]: Couldn't open RCS file /cvstest/4/default:n,v: Invalid argument

CVSNT的帮助
Set a user's permissions for a directory
cvs chacl [-R] [-r branch] [-u user] [-j branch] [-n] [-p priority] [-m essage] [-a [no]{ read&line;write&line;create&line;tag&line;control }[,...]] [-d] [file or directory. .]
Requires: repository, directories
Changes: access control within file attributes
Allows the owner of a directory to control access by other users.

最后总结了一个步骤,首先我是使用的WINDOWS用户认证,直接使用CVS,没有使用TCVS/WINCVS

c:\>set cvsroot=:pserver:administrator at 127 dot 0.0.1:/cvstest 设置CVSROOT

c:\>cvs login  www.shengfang.org  登录
Logging in to :pserver:administrator at 127 dot 0.0.1:2401:/cvstest
CVS password: **********

c:\>cvs passwd -r administrator -a admin  加一个超级用户
Adding user admin at 127 dot 0.0.1
New password: ***
Verify password: ***

修改CVSROOT目录下的: www.shengfang.org
checkoutlist文件,加入“ admin err-admin”
新建admin文件,加入admin
修改config文件:
# Set this to 'no' if pserver shouldn't check system users/passwords
#SystemAuth=yes
SystemAuth=no

然后以admin登录
c:\>set cvsroot=:pserver:admin at 127 dot 0.0.1:/cvstest

c:\>cvs login www.shengfang.org
Logging in to :pserver:admin at 127 dot 0.0.1:2401:/cvstest
CVS password: *** 改为超级用户登录

c:\>cvs passwd -a sf1  增加用户,还是必须映射一个系统用户?
Adding user sf1 at 127 dot 0.0.1
New password: ***
Verify password: ***
cvs server: *WARNING* CVS user 'sf1' will not be able to log in until they are aliased to a valid system user.

c:\>cvs passwd -r shengfang -a sf1
Adding user sf1 at 127 dot 0.0.1
New password: *** www.shengfang.org
Verify password: ***

c:\>cvs passwd -r shengfang -a sf2
Adding user sf2 at 127 dot 0.0.1
New password: ***
Verify password: ***

在cvsroot目录下创建文件fileattr.xml
如K:\cvstest\4\CVS
<?xml version="1.0" encoding="UTF-8"?>
<fileattr>
 <directory>  www.shengfang.org
  <acl user="Admin">
   <read />
   <write />
   <create />
  </acl>
  <acl>
   <read  deny="1" />
   <write deny="1" />
   <create deny="1" />
  </acl>
</directory>
</fileattr>

再在K:\cvstest\4\sf1\CVS创建
<?xml version="1.0" encoding="UTF-8"?>
<fileattr>  www.shengfang.org
 <directory>
  <acl user="Admin">
   <read />
   <write />
   <create />
  </acl>
 <acl user="sf1">
  <read />
  <write />
  <create />
 </acl>
 <acl>
  <read deny="1" />
  <write deny="1" />
  <create deny="1" />
 </acl>
</directory>
</fileattr>  www.shengfang.org

改为sf1登录 www.shengfang.org
c:\3>set cvsroot=:pserver:sf1 at 127 dot 0.0.1:/cvstest

c:\3>cvs  login
Logging in to :pserver:sf1 at 127 dot 0.0.1:2401:/cvstest
CVS password: ***

c:\3>cvs co 4
cvs server: User sf1 cannot read 4

再改为ADMIN登录
c:\3\4>set cvsroot=:pserver:admin at 127 dot 0.0.1:/cvstest

c:\3\4>cvs login
Logging in to :pserver:admin at 127 dot 0.0.1:2401:/cvstest
CVS password: ***

c:\3\4>cd ..

c:\3>cvs co 4 www.shengfang.org
cvs server: Updating 4
cvs server: Updating 4/sf1
cvs server: Updating 4/sf11
cvs server: Updating 4/sf2

看来是没有办法递归了,它好像是直接中断的,如果碰到没有权限的就退出,如果实在觉得麻烦,可能需要在WINCVS里面用TCL或者Python制作脚本、宏了

WINCVS和CVSNT的CVS.EXE文件经常会出现版本不对之类的错误 cvs [chacl aborted]: server does not support chacl

所以最好指定CVS程序为CVSNT自带的 N:\share\WinCvs\cvsnt\cvs.exe


字体:

Permanant URI永久地址 http://www.shengfang.org/blog/p/cvsntadmin.php
Trackback URI引用地址 http://www.shengfang.org/blog/tb.php?tb_id=1125472304

2005年8月31日15:11星期三  [Dev开发] 追踪此文的RSS
kkkk在 2007年8月14日17:00星期二 评论:
对不起看错了,是你自己写的。
但是广告也太烦人了。
Yippee 回复于 2007年8月14日21:21
前几年还觉得辛苦写出来被转了还当回事,呵呵,全局替换吧:)

kkkk在 2007年8月14日16:49星期二 评论:
你丫 的真够无 耻的, 拉别人的信息不够还要加上自己网站的广告
Yippee 回复于 2007年8月14日16:54
:)


shrry在 2007年3月14日10:48星期三 评论:
如何指定CVS程序为CVSNT自带的?
Yippee 回复于 2007年3月14日12:09
将    CVSNT 的路径加入系统路径中。

称呼:    登陆   注册
   不注册,但记住我的信息
邮件:
(非必须)
评论: [UBB代码帮助]
粗体 斜体 下划线 链接 水平线 引用



验证码: 请输入你看见的数字
关闭UBB      提交时自动将内容复制到剪贴板

公告
Fire and Motion!

统计信息
[Yippee]||[统计]||日志:1790
在线: 13||用户: 2562 [列表]
今日:1865||到访:2671364
Rss:838357||评论:1584

最新日志

最新评论

友情链接

日历

最新引用

搜索

归档

杂项
Get RSS Feed (Version 2.0)
Get Atom Feed (Version 0.3)
编码:  UTF-8