From 48dd05b7cfdd3bcc99abf2d18de1062a72c5b751 Mon Sep 17 00:00:00 2001 From: tb Date: Wed, 31 May 2017 07:55:29 +0000 Subject: [PATCH] Change cp -pR to pax copy mode with -k when copying /etc/skel. This way we keep existing files in the user's home directory that might have been installed from siteXX.tgz. Found the hard way by Erling Westenvik. Thanks to trondd for helpful analysis. "If that's what it does, I'm all for it" halex --- distrib/miniroot/install.sub | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 1db72e699db..7ac1f670448 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sub,v 1.1011 2017/05/28 09:24:56 rpe Exp $ +# $OpenBSD: install.sub,v 1.1012 2017/05/31 07:55:29 tb Exp $ # # Copyright (c) 1997-2015 Todd Miller, Theo de Raadt, Ken Westerback # Copyright (c) 2015, Robert Peichaer @@ -2919,7 +2919,7 @@ do_install(){ _home=/mnt$_home mkdir -p $_home - (cd /mnt/etc/skel; cp -pR . $_home) + (cd /mnt/etc/skel; pax -rw -k -pe . $_home) (umask 077 && sed "s,^To: root\$,To: ${ADMIN_NAME} <${ADMIN}>," \ /mnt/var/mail/root >/mnt/var/mail/$ADMIN ) chown -R 1000:1000 $_home /mnt/var/mail/$ADMIN -- 2.20.1