Skip to content

Commit

Permalink
libpriv/passwd: Use GLNX_FILE_COPY_NOXATTRS
Browse files Browse the repository at this point in the history
Prep for unified core work.  This was failing due to a bug
in libglnx <GNOME/libglnx#80> but
I think this change is also correct.  There's no good reason
for us to copy xattrs like the SELinux label here - rather
we want the labels to be reset during commit.
  • Loading branch information
cgwalters committed Sep 11, 2017
1 parent 53dc175 commit aabc023
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/libpriv/rpmostree-passwd-util.c
Expand Up @@ -1097,7 +1097,9 @@ rpmostree_passwd_prepare_rpm_layering (int rootfs_dfd,

/* Copy /usr/lib/{passwd,group} -> /usr/etc (breaking hardlinks) */
if (!glnx_file_copy_at (rootfs_dfd, usrlibfile, NULL,
rootfs_dfd, usretcfile, 0, cancellable, error))
rootfs_dfd, usretcfile,
GLNX_FILE_COPY_NOXATTRS,
cancellable, error))
return FALSE;

/* Copy the merge's passwd/group to usr/lib (breaking hardlinks) */
Expand All @@ -1106,7 +1108,8 @@ rpmostree_passwd_prepare_rpm_layering (int rootfs_dfd,
if (!glnx_file_copy_at (AT_FDCWD,
glnx_strjoina (merge_passwd_dir, "/", file), NULL,
rootfs_dfd, usrlibfiletmp,
GLNX_FILE_COPY_OVERWRITE, cancellable, error))
GLNX_FILE_COPY_OVERWRITE | GLNX_FILE_COPY_NOXATTRS,
cancellable, error))
return FALSE;

if (!glnx_renameat (rootfs_dfd, usrlibfiletmp, rootfs_dfd, usrlibfile, error))
Expand All @@ -1132,7 +1135,8 @@ rpmostree_passwd_prepare_rpm_layering (int rootfs_dfd,
}

if (!glnx_file_copy_at (rootfs_dfd, src, NULL,
rootfs_dfd, tmp, GLNX_FILE_COPY_OVERWRITE,
rootfs_dfd, tmp,
GLNX_FILE_COPY_OVERWRITE | GLNX_FILE_COPY_NOXATTRS,
cancellable, error))
return FALSE;
if (!glnx_renameat (rootfs_dfd, tmp, rootfs_dfd, src, error))
Expand Down

0 comments on commit aabc023

Please sign in to comment.