【发布时间】:2022-06-13 06:53:37
【问题描述】:
我发现来自 Apache 2 的错误日志是致命的:
不安全的存储库('/home/repon' 归其他人所有)
发生这种情况是因为我在 PHP 代码中有 git rev-parse --symbolic-full-name --abbrev-ref HEAD',看起来 new Git safety change 不再允许 www-data 运行此 Git 命令。
git config --global --add safe.directory /homerepon 不起作用。有没有办法解决这个问题?
Git 版本:2.35.3
PHP 版本:7.4
Apache 2 版本:2.4.41
【问题讨论】:
-
另外,为了做出明智的决定,请阅读您在问题中引用的 URL,并研究它引用的部分的 git 文档。由于最近引入了不容易陷入安全问题的限制,您只是遇到了配置问题。
-
相关(更面向 Windows):I cannot add the parent directory to safe.directory in Git
标签: git cve-2022-24765