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
-9
View File
@@ -1327,15 +1327,6 @@ int warn_file_is_world_accessible(const char *filename, struct stat *st, const c
return 0;
}
int sync_rights(int from, int to) {
struct stat st;
if (fstat(from, &st) < 0)
return -errno;
return fchmod_and_chown(to, st.st_mode & 07777, st.st_uid, st.st_gid);
}
int rename_and_apply_smack_floor_label(const char *from, const char *to) {
int r = 0;
if (rename(from, to) < 0)