如何控制CVS存储库中的文件权限?

发布于 2024-10-14 10:46:48 字数 149 浏览 4 评论 0原文

目前,一些用户的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

几度春秋 2024-10-21 10:46:48

Cvs 命令选项 watch 也会阻止恢复文件权限。如果观看,则检出文件时它将是只读的。来自 cvs 手册页:

$ cvs watch --help_options

Usage: cvs watch {on|off|add|remove} [-lR] [-a <action>]... [<path>]...

on/off: turn on/off read-only checkouts of files

因此,使用 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:

$ cvs watch --help_options

Usage: cvs watch {on|off|add|remove} [-lR] [-a <action>]... [<path>]...

on/off: turn on/off read-only checkouts of files

So, use cvs watch off filename to remove checkout from repository making it read only every time.

初吻给了烟 2024-10-21 10:46:48

我不确定这是否是最好的解决方案,但我可能会使用 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文