#!/bin/sh
#
# aryzhov@spasu.net
#
# Security cleanup for ARZ Jumpstart clients - running from chrooted env
#
[ -z "$SID" ] && SID=/tmp/install_config
[ X$SubrIsRead = XYes ] || . $SID/Scripts/Misc/!Includes/Subroutines
[ X$VarsAreSet = XYes ] || SetJVars
SetRootOpts ; [ X$ROOT != X/ ] && exec Chroot_Script $0 $*

#
# Move the root guy's home from / to /root, along with all . stuff
#
mkdir -p /root
cp /etc/passwd /etc/passwd.pre-`basename $0` || StartShell "Failed to copy /etc/passwd"
printf "g/^root:/s/:\/:/:\/root:/\nw\nq\n" | ed -s /etc/passwd
(cd / && find `ls -a1 | grep '^[.][^.]'` 2>/dev/null | cpio -dump /root/. && rm -rf .??*)
chown -R 0:0    /root/.
chmod -R go-rwx /root/.


#
# Scratch unnecessary user accounts
#
for U in uucp nuucp lp; do  userdel $U; done


#
#
#
