Hi Nico,

new version that only locks passwd.

/Peter
On Dienstag, 15. November 2011 00:02:06 Nico wrote:
> Hi Peter,
> 
> A single lock for both /etc/passwd and /etc/shadow should be enough,
> it was just there to prevent multiple initscripts from messing with
> /etc/passwd at boot.
> 
> --
> -{Nico}
> _______________________________________________
> openwrt-devel mailing list
> [email protected]
> https://lists.openwrt.org/mailman/listinfo/openwrt-devel
diff --git a/package/base-files/files/lib/functions.sh b/package/base-files/files/lib/functions.sh
index f6ec3d7..5230ea8 100755
--- a/package/base-files/files/lib/functions.sh
+++ b/package/base-files/files/lib/functions.sh
@@ -429,8 +429,10 @@ user_add() {
 	local rc
 	[ -f "${IPKG_INSTROOT}/etc/passwd" ] || return 1
 	[ -n "$IPKG_INSTROOT" ] || lock /var/lock/passwd
-	echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
+	echo "${name}:*:9797:0:::::" >> ${IPKG_INSTROOT}/etc/shadow
 	rc=$?
+	echo "${name}:x:${uid}:${gid}:${desc}:${home}:${shell}" >> ${IPKG_INSTROOT}/etc/passwd
+	rc=$(($rc + $?))
 	[ -n "$IPKG_INSTROOT" ] || lock -u /var/lock/passwd
 	return $rc
 }
_______________________________________________
openwrt-devel mailing list
[email protected]
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to