2
0
forked from Ivasoft/openwrt

base-files: use numerically prefixed uci-defaults names

SVN-Revision: 35218
This commit is contained in:
Jo-Philipp Wich
2013-01-18 12:46:43 +00:00
parent 3a2cccda2e
commit 648bd409e3
3 changed files with 0 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
#!/bin/sh
local ppwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/passwd)"
local spwd="$(sed -ne '/^root:/s/^root:\([^:]*\):.*$/\1/p' /etc/shadow)"
if [ -n "${ppwd#[\!x]}" ] && [ -z "${spwd#[\!x]}" ]; then
logger -t migrate-shadow "Moving root password hash into shadow database"
sed -i -e "s:^root\:[^\:]*\::root\:x\::" /etc/passwd
sed -i -e "s:^root\:[^\:]*\::root\:$ppwd\::" /etc/shadow
fi
exit 0