slitaz-boot-scripts rev 96

Avoid usage of an existing system user or root
author Christophe Lincoln <pankso@slitaz.org>
date Tue Jun 10 16:26:13 2008 +0200 (2008-06-10)
parents d76432221c42
children 2bcec684c19c
files etc/init.d/bootopts.sh
line diff
     1.1 --- a/etc/init.d/bootopts.sh	Mon Jun 09 23:39:44 2008 +0200
     1.2 +++ b/etc/init.d/bootopts.sh	Tue Jun 10 16:26:13 2008 +0200
     1.3 @@ -77,6 +77,10 @@
     1.4  if ! grep -q "1000:1000" /etc/passwd; then
     1.5  	if grep -q "user=" /proc/cmdline; then
     1.6  		USER=`cat /proc/cmdline | sed 's/.*user=\([^ ]*\).*/\1/'`
     1.7 +		# Avoid usage of an existing system user or root.
     1.8 +		if grep -q ^$USER /etc/passwd; then
     1.9 +			USER=linux
    1.10 +		fi
    1.11  	else
    1.12  		USER=linux
    1.13  	fi