sed -i -e 's!^# directory = /etc!directory = /var!g'"$sysroot"/etc/libuser.conf
for i in passwd shadow group gshadow .pwd.lock subuid subgid;do
ln -sfnr "$sysroot"/var/"$i""$sysroot"/etc/"$i"
done
sed -i -e 's#/etc/passwd#/var/passwd#g;s#/etc/npasswd#/var/npasswd#g'"$sysroot"/usr/lib64/security/pam_unix.so
sed -i -e 's#/etc/shadow#/var/shadow#g;s#/etc/nshadow#/var/nshadow#g'"$sysroot"/usr/lib64/security/pam_unix.so
sed -i -e 's#/etc/.pwdXXXXXX#/var/.pwdXXXXXX#g'"$sysroot"/usr/lib64/security/pam_unix.so
sed -i -e 's#/etc/passwd#/var/passwd#g;s#/etc/shadow#/var/shadow#g;s#/etc/gshadow#/var/gshadow#g;s#/etc/group#/var/group#g;s#/etc/subuid#/var/subuid#g;s#/etc/subgid#/var/subgid#g'"$sysroot"/usr/sbin/user{add,mod,del}"$sysroot"/usr/sbin/group{add,mod,del}
sed -i -e 's#/etc/.pwd.lock#/var/.pwd.lock#g'\
"$sysroot"/lib*/libc.so.* \
"$sysroot"/usr/lib/systemd/libsystemd-shared*.so
[[ -e "$sysroot"/usr/lib*/librpmostree-1.so.1 ]]&& sed -i -e 's#/etc/.pwd.lock#/var/.pwd.lock#g'"$sysroot"/usr/lib*/librpmostree-1.so.1