|
From: <abe...@us...> - 2013-11-15 23:49:23
|
Revision: 6280
http://sourceforge.net/p/astlinux/code/6280
Author: abelbeck
Date: 2013-11-15 23:49:21 +0000 (Fri, 15 Nov 2013)
Log Message:
-----------
FIRSTRUN, automatically update any ASTURW /etc/passwd and /etc/group 'nobody' entries
Modified Paths:
--------------
branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN
Modified: branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN
===================================================================
--- branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN 2013-11-15 20:56:20 UTC (rev 6279)
+++ branches/1.0/project/astlinux/target_skeleton/etc/init.d/FIRSTRUN 2013-11-15 23:49:21 UTC (rev 6280)
@@ -20,6 +20,22 @@
done
}
+update_system_default_users()
+{
+ local base="$1" user file current IFS
+
+ unset IFS
+ for user in nobody; do
+ for file in passwd group; do
+ current="$(grep "^${user}:" "${base}/etc/${file}")"
+ if [ -n "$current" -a "$current" != "$(grep "^${user}:" "/etc/${file}")" ]; then
+ sed -i -e "s|^${user}:.*$|${current}|" "/etc/${file}"
+ echo "FIRSTRUN: Updated system default '${user}' user/group in '/etc/${file}'"
+ fi
+ done
+ done
+}
+
init () {
local new old=""
@@ -44,8 +60,10 @@
# Update system default user/group files to ASTURW files
if [ -d /oldroot/mnt/asturo ]; then
add_system_default_users /oldroot/mnt/asturo
+ update_system_default_users /oldroot/mnt/asturo
elif [ -d /oldroot/image ]; then
add_system_default_users /oldroot/image
+ update_system_default_users /oldroot/image
fi
case $old in
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|