mirror of
https://github.com/libguestfs/libguestfs.git
synced 2026-03-22 07:03:38 +00:00
When saving a configuration file, Augeas creates a new file and replaces the old one with it; this creates a /etc/shadow file without the SELinux xattrs, since they are missing. Thus, create a temporary file with all the attributes of /etc/shadow, so all the attributes of it (permissions and xattrs, among others) can be restored properly on the new /etc/shadow. As side effect, if a guest is already properly SELinux-labelled, then there should be no more need to relabel it to make sure /etc/shadow still has the right SELinux xattrs.