1 Star 0 Fork 98

Mingtai/systemd

forked from src-openEuler/systemd 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-sysusers-use-filename-if-proc-is-not-mounted.patch 1.38 KB
一键复制 编辑 原始数据 按行查看 历史
From f78a48840205339157b186b7c8e576a3c690f6d9 Mon Sep 17 00:00:00 2001
From: Yu Watanabe <watanabe.yu+github@gmail.com>
Date: Fri, 31 Dec 2021 00:11:01 +0900
Subject: [PATCH] sysusers: use filename if /proc is not mounted
During system install, /proc may not be mounted yet.
Fixes RHBZ#2036217 (https://bugzilla.redhat.com/show_bug.cgi?id=2036217).
(cherry picked from commit b78d7f246899687a1697cdcebe93d8512c5e7c4b)
(cherry picked from commit 747b4f1ff8aac3a1b800b0a7ac0edef4af34da70)
Conflict:NA
Reference:https://github.com/systemd/systemd/commit/f78a48840205339157b186b7c8e576a3c690f6d9
---
src/sysusers/sysusers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index a18634d254..669efe4a1d 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -267,7 +267,7 @@ static int make_backup(const char *target, const char *x) {
/* Copy over the access mask. Don't fail on chmod() or chown(). If it stays owned by us and/or
* unreadable by others, then it isn't too bad... */
- r = fchmod_and_chown(fileno(dst), st.st_mode & 07777, st.st_uid, st.st_gid);
+ r = fchmod_and_chown_with_fallback(fileno(dst), dst_tmp, st.st_mode & 07777, st.st_uid, st.st_gid);
if (r < 0)
log_warning_errno(r, "Failed to change access mode or ownership of %s: %m", backup);
--
2.33.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yangmingtaip/systemd.git
git@gitee.com:yangmingtaip/systemd.git
yangmingtaip
systemd
systemd
master

搜索帮助