mirror of
git://projects.qi-hardware.com/openwrt-xburst.git
synced 2024-12-21 05:33:21 +02:00
de0e01d031
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@29865 3c298f89-4303-0410-b956-a3cf2f4a3e73
13 lines
418 B
Bash
13 lines
418 B
Bash
#!/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
|