summaryrefslogtreecommitdiffstats
path: root/src/sysusers/sysusers.c
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-12-30 16:11:01 +0100
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-12-30 19:11:43 +0100
commitb78d7f246899687a1697cdcebe93d8512c5e7c4b (patch)
tree9032992cf3e8125c0890888f19c005863801eb2a /src/sysusers/sysusers.c
parentnetwork: complete example for xfrm setup (diff)
downloadsystemd-b78d7f246899687a1697cdcebe93d8512c5e7c4b.tar.xz
systemd-b78d7f246899687a1697cdcebe93d8512c5e7c4b.zip
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).
Diffstat (limited to 'src/sysusers/sysusers.c')
-rw-r--r--src/sysusers/sysusers.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index 015e3a9ae4..07a65a2ebc 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -284,7 +284,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);