From 5d1659cca519dec72e3aab34bbd4387e75b7e137 Mon Sep 17 00:00:00 2001 From: halex Date: Wed, 4 Aug 2010 07:07:41 +0000 Subject: [PATCH] Set an appropriate To: header in /var/mail/$user which is copied from /var/mail/root idea and first version from deraadt@, ok deraadt@ krw@ --- distrib/miniroot/install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 3374073a9d8..d9b4b63a21a 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/ksh -# $OpenBSD: install.sh,v 1.207 2010/04/06 21:01:20 deraadt Exp $ +# $OpenBSD: install.sh,v 1.208 2010/08/04 07:07:41 halex Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1997-2009 Todd Miller, Theo de Raadt, Ken Westerback @@ -290,7 +290,9 @@ if [[ -n $user ]]; then mkdir -p /mnt/home/$user (cd /mnt/etc/skel; cp -pR . /mnt/home/$user) - cp -p /mnt/var/mail/root /mnt/var/mail/$user + ( umask 077 && + sed "s,^To: root\$,To: ${username} <${user}>," \ + /mnt/var/mail/root > /mnt/var/mail/$user ) chown -R 1000.10 /mnt/home/$user /mnt/var/mail/$user echo "1,s@wheel:.:0:root\$@wheel:\*:0:root,${user}@ w -- 2.20.1