summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRick Balocca <rbalocca@vyatta.com>2008-08-06 15:51:21 -0700
committerRick Balocca <rbalocca@vyatta.com>2008-08-06 15:51:21 -0700
commit2a49a4affae63864797a473b14def10824e2bc83 (patch)
tree48f3c5d89797abdfd25767d4b06af8aa922a0db2
parentfe3d0a401c90030ffdbf0b9e6d3db9dc2543c304 (diff)
downloadvyatta-cfg-quagga-2a49a4affae63864797a473b14def10824e2bc83.tar.gz
vyatta-cfg-quagga-2a49a4affae63864797a473b14def10824e2bc83.zip
Merge from islavista
-rw-r--r--debian/vyatta-cfg-system.postinst.in16
-rwxr-xr-xscripts/standalone_root_pw_reset4
2 files changed, 11 insertions, 9 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index b21437a5..0dd6248f 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -23,6 +23,7 @@ esac
ln -sf ../vyatta-net.rules /etc/udev/rules.d/$vyatta_net_rules
if [ "$sysconfdir" != "/etc" ]; then
+ touch /etc/sudoers
cp -p /etc/sudoers /etc/sudoers.bak
# for "admin" level
@@ -32,13 +33,12 @@ if [ "$sysconfdir" != "/etc" ]; then
fi
# cleanup any old entries from previous versions
- ed - /etc/sudoers <<EOF
-/### BEGIN VYATTA/,/### END VYATTA/d
-/Cmnd_Alias IPTABLE/,/PPPOE_CMDS/d
-g/sudo-users/d
-g/env_keep+=VYATTA/d
-wq
-EOF
+ sed -i /etc/sudoers \
+ -e '/### BEGIN VYATTA/,/### END VYATTA/d' \
+ -e '/Cmnd_Alias IPTABLE/,/PPPOE_CMDS/d' \
+ -e '/sudo-users/d' \
+ -e '/env_keep+=VYATTA/d' || true
+
# Add Vyatta entries
cat <<"EOF" >>/etc/sudoers
### BEGIN VYATTA
@@ -85,6 +85,8 @@ if [ ! -f /etc/bash_completion ]; then
echo "source /etc/bash_completion.d/20vyatta-cfg" >> /etc/bash_completion
fi
+sed -i 's/^set /builtin set /' /etc/bash_completion
+
# Local Variables:
# mode: shell-script
# sh-indentation: 4
diff --git a/scripts/standalone_root_pw_reset b/scripts/standalone_root_pw_reset
index b173f22d..336d534d 100755
--- a/scripts/standalone_root_pw_reset
+++ b/scripts/standalone_root_pw_reset
@@ -70,13 +70,13 @@ cp $CF ${CF}.before_pwrecovery
echo "Reseting the root password..."
# change system first
-newpwd=$(mkpasswd -H md5 vyatta)
+newpwd=`mkpasswd -H md5 vyatta`
usermod --password "$newpwd" root
# escape / in encrypted passwd
pw=$(echo $newpwd | sed 's:/:\\/:g')
sed -i \
- -e "/^.* user root {/,/}/s/encrypted-password:.*\$/encrypted-password: \"$pw\"/" \
+ -e "/^.* user root {/,/}/s/encrypted-password .*\$/encrypted-password \"$pw\"/" \
$CF
echo $(date "+%b%e %T") $(hostname) "Root password reset to factory value" \