copy: move sync_rights() to copy.c and rename copy_rights()

It's so similar to copy_access(), hence let's move it over and rename it
in similar style to the rest of the functions.

No change in behaviour, just moving things over.
This commit is contained in:
Lennart Poettering
2021-03-04 22:35:52 +00:00
committed by Luca Boccassi
parent e1aec57dd1
commit bb72c43485
6 changed files with 23 additions and 17 deletions
+4 -4
View File
@@ -393,7 +393,7 @@ static int write_temporary_passwd(const char *passwd_path, FILE **tmpfile, char
original = fopen(passwd_path, "re");
if (original) {
r = sync_rights(fileno(original), fileno(passwd));
r = copy_rights(fileno(original), fileno(passwd));
if (r < 0)
return r;
@@ -494,7 +494,7 @@ static int write_temporary_shadow(const char *shadow_path, FILE **tmpfile, char
original = fopen(shadow_path, "re");
if (original) {
r = sync_rights(fileno(original), fileno(shadow));
r = copy_rights(fileno(original), fileno(shadow));
if (r < 0)
return r;
@@ -590,7 +590,7 @@ static int write_temporary_group(const char *group_path, FILE **tmpfile, char **
original = fopen(group_path, "re");
if (original) {
r = sync_rights(fileno(original), fileno(group));
r = copy_rights(fileno(original), fileno(group));
if (r < 0)
return r;
@@ -688,7 +688,7 @@ static int write_temporary_gshadow(const char * gshadow_path, FILE **tmpfile, ch
if (original) {
struct sgrp *sg;
r = sync_rights(fileno(original), fileno(gshadow));
r = copy_rights(fileno(original), fileno(gshadow));
if (r < 0)
return r;