diff options
author | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-05-26 20:00:45 +0200 |
---|---|---|
committer | Daan De Meyer <daan.j.demeyer@gmail.com> | 2020-05-27 18:54:25 +0200 |
commit | 90c81688fffde5b1d7bf9fa972db145096fae010 (patch) | |
tree | a26a0c328499012a995827e82556b82437a714d9 /src/sysusers/sysusers.c | |
parent | sysusers: Move sync_rights and rename_and_apply_smack to basic (diff) | |
download | systemd-90c81688fffde5b1d7bf9fa972db145096fae010.tar.xz systemd-90c81688fffde5b1d7bf9fa972db145096fae010.zip |
fileio: Refactor sync_rights to take fds as arguments
Diffstat (limited to 'src/sysusers/sysusers.c')
-rw-r--r-- | src/sysusers/sysusers.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 3d68dc2e0f..2cb8172103 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -367,7 +367,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char original = fopen(passwd_path, "re"); if (original) { - r = sync_rights(original, passwd_tmp); + r = sync_rights(fileno(original), fileno(passwd)); if (r < 0) return r; @@ -469,7 +469,7 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char original = fopen(shadow_path, "re"); if (original) { - r = sync_rights(original, shadow_tmp); + r = sync_rights(fileno(original), fileno(shadow)); if (r < 0) return r; @@ -566,7 +566,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char ** original = fopen(group_path, "re"); if (original) { - r = sync_rights(original, group_tmp); + r = sync_rights(fileno(original), fileno(group)); if (r < 0) return r; @@ -665,7 +665,7 @@ static int write_temporary_gshadow(const char * gshadow_path, FILE **tmpfile, ch if (original) { struct sgrp *sg; - r = sync_rights(original, gshadow_tmp); + r = sync_rights(fileno(original), fileno(gshadow)); if (r < 0) return r; |