|
From: <abe...@us...> - 2014-10-03 23:51:59
|
Revision: 6746
http://sourceforge.net/p/astlinux/code/6746
Author: abelbeck
Date: 2014-10-03 23:51:54 +0000 (Fri, 03 Oct 2014)
Log Message:
-----------
Set the root user shell to /bin/bash so it does not depend on what /bin/sh points to, additionally automatically update the root passwd entry if /etc/passwd is edited and on asturw via the FIRSTRUN script.
Modified Paths:
--------------
branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN
branches/1.0/project/astlinux/target_skeleton/etc/passwd
Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN 2014-10-03 17:38:12 UTC (rev 6745)
+++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN 2014-10-03 23:51:54 UTC (rev 6746)
@@ -36,6 +36,17 @@
done
}
+update_root_passwd_default()
+{
+ local base="$1" current
+
+ current="$(grep "^root:" "${base}/etc/passwd")"
+ if [ -n "$current" -a "$current" != "$(grep "^root:" "/etc/passwd")" ]; then
+ sed -i -e "s|^root:.*$|${current}|" "/etc/passwd"
+ echo "FIRSTRUN: Updated system default 'root' user in '/etc/passwd'"
+ fi
+}
+
init () {
local new old=""
@@ -61,9 +72,11 @@
if [ -d /oldroot/mnt/asturo ]; then
add_system_default_users /oldroot/mnt/asturo
update_system_default_users /oldroot/mnt/asturo
+ update_root_passwd_default /oldroot/mnt/asturo
elif [ -d /oldroot/image ]; then
add_system_default_users /oldroot/image
update_system_default_users /oldroot/image
+ update_root_passwd_default /oldroot/image
fi
case $old in
Modified: branches/1.0/project/astlinux/target_skeleton/etc/passwd
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/etc/passwd 2014-10-03 17:38:12 UTC (rev 6745)
+++ branches/1.0/project/astlinux/target_skeleton/etc/passwd 2014-10-03 23:51:54 UTC (rev 6746)
@@ -1,4 +1,4 @@
-root:x:0:0:root:/root:/bin/sh
+root:x:0:0:root:/root:/bin/bash
sshd:x:22:22:sshd:/dev/null:/bin/false
ftp:x:21:21:ftp user:/home/ftp:/bin/false
prosody:x:130:130:XMPP-server:/etc/prosody/data:/bin/false
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|