copy: fix wrong argument passed to S_ISREG() in copy_file_fd_full()

Follow-up for 2f78204498.
This commit is contained in:
Franck Bui
2022-03-14 09:30:11 +01:00
committed by Lennart Poettering
parent 0d67e2b584
commit 43c893e73e

View File

@@ -1214,7 +1214,10 @@ int copy_file_fd_full(
if (r < 0)
return r;
if (S_ISREG(fdt)) {
/* Make sure to copy file attributes only over if target is a regular
* file (so that copying a file to /dev/null won't alter the access
* mode/ownership of that device node...) */
if (S_ISREG(st.st_mode)) {
(void) copy_times(fdf, fdt, copy_flags);
(void) copy_xattr(fdf, fdt, copy_flags);
}