git-cvsserver pserver 用户名传播

发布于 2024-10-22 19:23:25 字数 859 浏览 5 评论 0 原文

对于我公司的一些特定工作流程问题,我需要允许一些用户工作 使用 CVS,而主存储库位于 git 下。

我选择 git-cvsserver 作为此任务的实现。

我设置了 git 存储库,为 gitcvs 启用它并在上设置了 pserver 模拟 西尼特。一切正常,我可以从 cvs 客户端使用这个存储库, 针对我通过 pserver 模拟创建的 passwd 文件进行身份验证。

我的问题是我通过 CVS 所做的提交显示在运行的用户下 xinetd,不在用户下,我根据 passwd 进行身份验证。

即我以用户“foo”的身份提交到 CVS,我通过 pserver 成功进行了身份验证, 但是当我查看此存储库的 git 提交历史记录时,我发现该提交已 由用户“root”创建。

我查看了 git-cvsserver 的源代码 (http://git.kernel.org/?p=git​​/git.git;a=blob;f=git-cvsserver.perl)并且似乎使用了CVS登录 仅用于身份验证,不用于实际提交。 SQLite 数据库中的记录也包含“root”用户名,而不是“foo”

您知道如何将 CVS 登录传播到 git 用户名吗?

git 邮件列表中的外部引用: http://thread.gmane.org/gmane .comp.version-control.git/169182

For some specific workflow issues at my company, I need to allow some users work
with CVS, while main repository is under git.

I've chosen git-cvsserver as implementation for this task.

I set up git repository, enabled it for gitcvs and setup a pserver simulation on
xinetd. Everything works fine, I can work with this repository from cvs client,
authenticating against passwd file I created through pserver emulation.

My problem is that commits that I make through CVS are shown under user who runs
xinetd, not under user I authenticate against passwd.

i.e. I commit to CVS as user 'foo', I successfully authenticate through pserver,
but when I look at git history of commits for this repo, i see that commit has
been made by user 'root'.

I looked through source of git-cvsserver (http://git.kernel.org/?p=git/git.git;a=blob;f=git-cvsserver.perl) and it seems that CVS login is used
only for authentication, not for actual committing.
Records in SQLite database contain 'root' username too, not 'foo'

Do you have any ideas how I can propagate CVS login to git username?

xref at git mailing list: http://thread.gmane.org/gmane.comp.version-control.git/169182

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

眼角的笑意。 2024-10-29 19:23:25

我对此没有具体的经验,但 git-cvsserver 几乎肯定会调用 git-commit 来完成实际工作。您可以通过设置环境变量(例如 GIT_COMMITTER_EMAILGIT_AUTHOR_EMAIL)(也是 ..._NAME..._DATE..._IDENT)。如果您有可用的身份验证信息,您只需在实际提交之前将其设置在 $ENV 中即可。如果 git-cvsserver 没有清理其环境,您实际上可以在调用它之前从包装器中的身份验证信息中设置这些环境(只是以防任何提交)。

I have no specific experience with it, but git-cvsserver almost certainly invokes git-commit to do the actual work. You can get git-commit to use anything you want for the author and committer by setting environment variables like GIT_COMMITTER_EMAIL and GIT_AUTHOR_EMAIL (also ..._NAME and ..._DATE and ..._IDENT). If you have the authentication information available you could simply set it in $ENV before the actual commit. If git-cvsserver doesn't clean its environment you could actually set those from the authentication information in a wrapper before invoking it (just in case of any commit).

断肠人 2024-10-29 19:23:25

在传播登录之前,如 Ben Jacksonanswer,使用 GIT_COMMITTER_NAME/EMAIL 环境变量,确保身份验证步骤正确运行。

在 Git 2.34(2021 年第 4 季度)之前,“git cvsserver (man) 其身份验证代码中存在一个长期存在的错误,该错误最终已得到纠正(目前尚不清楚,但如果有人认真使用它,则是一个单独的问题)。

请参阅 提交 4b81f69提交 bffcb4d, Carlo Marcelo Arenas Belón (carenas).
(由 Junio C Hamano -- gitster -- 合并于 提交 1030dae,2021 年 10 月 3 日)

git-cvsserver:正确使用 crypt比较密码哈希

签字人:卡洛·马塞洛·阿里纳斯·贝隆

c057bad ("git-cvsserver: 使用密码文件 cvsserver pserver", 2010-05-15, Git v1.7.2-rc0 -- 合并)为 git cvsserver 添加了一种方法(man)提供经过身份验证的 pserver 帐户,无需明文密码,但使用用户名而不是密码来调用 crypt(3)

更正该问题,并确保文档正确指示如何获取可用于填充此配置的散列密码,以及更正用于测试的散列。

此更改将要求此功能的任何用户更新其配置中的哈希值,但具有使用比 cvs 使用的更相似格式的优点,可能还可以简化任何迁移。

git cvsserver 现在包含在其 手册页

文件,但只能使用-d选项(或-B,如果您的系统支持)。

git cvsserver 现在包含在其 手册页

最好使用管理密码哈希的系统特定实用程序
在您的平台中创建(例如 Linux 中的 mkpasswd、OpenBSD 中的 encrypt
pwhash(NetBSD 中))并将其粘贴到正确的位置。


2023年:警告,不再使用crypt(3),Git 2.44(2024年第一季度)对其进行了适配。

请参阅 提交 0856f13提交 5d70afa, 提交7d05974(2023 年 11 月 10 日),作者:Patrick Steinhardt (pks-t)< /a>.
(由
Junio C Hamano -- gitster -- 合并于 提交 0946acf,2023 年 12 月 9 日)

t/lib-httpd:停止使用用于身份验证的旧版crypt(3)

签字人:Patrick Steinhardt

为我们的测试设置 httpd 时,我们还安装了包含测试用户凭据的 passwd 和 proxy-passwd 文件。
这些凭据当前使用 crypt(3) 作为密码加密架构。

现在可以认为该架构已弃用,因为它不再安全。
引用 Apache httpd 的文档

<块引用>

仅限 Unix。
使用传统的 Unix crypt(3) 函数
随机生成的 32 位盐(仅使用 12 位)和前 8 位
密码的字符。不安全。

这开始在现代 Linux 发行版中引起问题。

glibc 已弃用其用于提供 crypt(3) 的 libcrypt 库,转而使用 libxcrypt
这个较新的替换提供了一个编译时开关来禁用不安全的密码加密模式,这会导致 crypt(3) 始终返回 EINVAL
最终结果是,在使用 libxcrypt 且没有这些不安全加密模式的发行版上,执行身份验证的 httpd 测试将​​失败。

重新生成 passwd 文件以改为使用默认密码加密架构,即 md5。
虽然基于 MD5 的加密模式应该比其他任何模式都更安全,这感觉有点有趣,但它是当前的默认设置并且受到所有平台的支持。
此外,考虑到这些文件仅用于测试目的,这实际上并不重要。

Before propagating the login, as shown in Ben Jackson's answer, with GIT_COMMITTER_NAME/EMAIL environment variables, make sure the authentication step did run properly.

Before Git 2.34 (Q4 2021), "git cvsserver"(man) had a long-standing bug in its authentication code, which has finally been corrected (it is unclear and is a separate question if anybody is seriously using it, though).

See commit 4b81f69, commit bffcb4d, commit a7775c7 (15 Sep 2021) by Carlo Marcelo Arenas Belón (carenas).
(Merged by Junio C Hamano -- gitster -- in commit 1030dae, 03 Oct 2021)

git-cvsserver: use crypt correctly to compare password hashes

Signed-off-by: Carlo Marcelo Arenas Belón

c057bad ("git-cvsserver: use a password file cvsserver pserver", 2010-05-15, Git v1.7.2-rc0 -- merge) adds a way for git cvsserver(man) to provide authenticated pserver accounts without having clear text passwords, but uses the username instead of the password to the call for crypt(3).

Correct that, and make sure the documentation correctly indicates how to obtain hashed passwords that could be used to populate this configuration, as well as correcting the hash that was used for the tests.

This change will require that any user of this feature updates the hashes in their configuration, but has the advantage of using a more similar format than cvs uses, probably also easing any migration.

git cvsserver now includes in its man page:

files, but only with the -d option (or -B if your system supports it).

git cvsserver now includes in its man page:

Preferably use the system specific utility that manages password hash
creation in your platform (e.g. mkpasswd in Linux, encrypt in OpenBSD or
pwhash in NetBSD) and paste it in the right location.


2023: Warning, crypt(3) is no longer used, and Git 2.44 (Q1 2024) adapts to it.

See commit 0856f13, commit 5d70afa, commit 7d05974 (10 Nov 2023) by Patrick Steinhardt (pks-t).
(Merged by Junio C Hamano -- gitster -- in commit 0946acf, 09 Dec 2023)

t/lib-httpd: stop using legacy crypt(3) for authentication

Signed-off-by: Patrick Steinhardt

When setting up httpd for our tests, we also install a passwd and proxy-passwd file that contain the test user's credentials.
These credentials currently use crypt(3) as the password encryption schema.

This schema can be considered deprecated nowadays as it is not safe anymore.
Quoting Apache httpd's documentation:

Unix only.
Uses the traditional Unix crypt(3) function with a
randomly-generated 32-bit salt (only 12 bits used) and the first 8
characters of the password. Insecure.

This is starting to cause issues in modern Linux distributions.

glibc has deprecated its libcrypt library that used to provide crypt(3) in favor of the libxcrypt library.
This newer replacement provides a compile time switch to disable insecure password encryption schemata, which causes crypt(3) to always return EINVAL.
The end result is that httpd tests that exercise authentication will fail on distros that use libxcrypt without these insecure encryption schematas.

Regenerate the passwd files to instead use the default password encryption schema, which is md5.
While it feels kind of funny that an MD5-based encryption schema should be more secure than anything else, it is the current default and supported by all platforms.
Furthermore, it really doesn't matter all that much given that these files are only used for testing purposes anyway.

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