如何控制CVS存储库中的文件权限?
目前,一些用户的 umask 设置方式导致对常规文件执行权限,我希望避免这种情况。
有没有办法强制所有签入的文件只能被读取,但有一些例外?
在 CVS 中处理此问题的推荐方法是什么?
Currently some users have their umask set in ways which result in execute permission on regular files, which I'd like to avoid.
Is there a way to force all files checked in to only be read with some exceptions?
What is the recommended way to handle this in CVS?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Cvs 命令选项 watch 也会阻止恢复文件权限。如果观看,则检出文件时它将是只读的。来自 cvs 手册页:
因此,使用
cvs watch off filename
从存储库中删除签出,使其每次都只读。Cvs command option watch is also preventing file permissions to be restored. If watched, when file is checked out it will be read-only. From cvs man pages:
So, use
cvs watch off filename
to remove checkout from repository making it read only every time.我不确定这是否是最好的解决方案,但我可能会使用 commitinfo、commitcheck 和 commit_prep.pl 对存储库的 CVSROOT 目录中的 cvswrappers 文件执行某些操作。如果您没有 commit_prep.pl,则可以使用类似以下内容的内容:
http://opensource.apple.com/source/cvs/cvs-29/cvs/contrib/commit_prep.pl
网上有很多示例,所以只需搜索那些如果您的存储库中还没有这些文件,请提交* 文件。
请注意,正如这篇文章所暗示的,权限仅在文件的第一次提交期间真正设置,之后,您需要“手动”修改存储库本身的权限。
在签入 CVS 中的文件后,如何为其添加执行权限?
在 commit_prep.pl 中,您可以在第一次提交文件之前使用 chmod ugo-x 清除执行权限。
此解决方案假设您使用的是 Linux。
I am not sure if this is the best solution, but I would probably do something with the cvswrappers file in CVSROOT directory of the repo, using commitinfo, commitcheck and commit_prep.pl. If you don't have commit_prep.pl, you can use something like this one:
http://opensource.apple.com/source/cvs/cvs-29/cvs/contrib/commit_prep.pl
There are quite a few examples on the web, so just search for those commit* files if you don't already have those in your repo.
Note that, as this post suggests, the permission is really set only during the first commit of a file, after that, you'd need to "manually" modify the permission on the repository itself.
How do I add execute permission to a file in CVS after it's already been checked in?
In commit_prep.pl, you can clear the exec permission using chmod ugo-x , before the file is committed for the first time.
This solution assumes you are using linux.