summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:43:32 -0700
committerMark O'Brien <mobrien@firebolt.vyatta.com>2008-07-09 13:43:32 -0700
commitbcfbf5b462faa5e0e13c82c8a367e8df698b6c20 (patch)
treedbaf63ba4719590fa5016cc105f4f73eef3c722b /debian
parentcceaba487befe7103ecb058c4dbf3e3a46102dc3 (diff)
parent4e213e1a8148d755bb3921cae3caee847901b54e (diff)
downloadvyatta-cfg-quagga-bcfbf5b462faa5e0e13c82c8a367e8df698b6c20.tar.gz
vyatta-cfg-quagga-bcfbf5b462faa5e0e13c82c8a367e8df698b6c20.zip
Merge branch 'hollywood' of git:/git/vyatta-cfg-system into hollywood
Diffstat (limited to 'debian')
-rw-r--r--debian/vyatta-cfg-system.postinst.in41
-rw-r--r--debian/vyatta-cfg-system.postrm3
2 files changed, 26 insertions, 18 deletions
diff --git a/debian/vyatta-cfg-system.postinst.in b/debian/vyatta-cfg-system.postinst.in
index 0852319e..b21437a5 100644
--- a/debian/vyatta-cfg-system.postinst.in
+++ b/debian/vyatta-cfg-system.postinst.in
@@ -23,16 +23,28 @@ esac
ln -sf ../vyatta-net.rules /etc/udev/rules.d/$vyatta_net_rules
if [ "$sysconfdir" != "/etc" ]; then
- # for "admin" level (FIXME)
+ cp -p /etc/sudoers /etc/sudoers.bak
+
+ # for "admin" level
sed -i 's/^# %sudo ALL=NOPASSWD: ALL/%sudo ALL=NOPASSWD: ALL/' /etc/sudoers
if ! grep -q '^%sudo ALL=NOPASSWD: ALL' /etc/sudoers; then
echo -e "\n%sudo ALL=NOPASSWD: ALL" >> /etc/sudoers
fi
- # Allow operator to do a limited number of commands without password
- if ! grep -q '^%operator ALL=NOPASSWD:' /etc/sudoers; then
- cat <<"EOF" >>/etc/sudoers
-### BEGIN VYATTA OPERATOR COMMANDS
+ # 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
+ # Add Vyatta entries
+ cat <<"EOF" >>/etc/sudoers
+### BEGIN VYATTA
+Defaults syslog_goodpri=info
+Defaults env_keep+=VYATTA_*
+
Cmnd_Alias IPTABLES = /sbin/iptables --list -n,\
/sbin/iptables -L -vn,\
/sbin/iptables -L * -vn,\
@@ -46,21 +58,14 @@ Cmnd_Alias IPFLUSH = /sbin/ip route flush cache, \
Cmnd_Alias ETHTOOLP = /usr/sbin/ethtool -p *
Cmnd_Alias DATE = /bin/date, /usr/sbin/ntpdate
Cmnd_Alias PPPOE_CMDS = /sbin/pppd, /sbin/poff
+Cmnd_Alias PCAPTURE = /usr/bin/tshark, /usr/bin/tcpdump
%operator ALL=NOPASSWD: /sbin/reboot, DATE, IPTABLES, ETHTOOLP, IPFLUSH, \
- PPPOE_CMDS, /usr/bin/tshark, /usr/sbin/wanpipemon
-### END VYATTA OPERATOR COMMANDS
+ PPPOE_CMDS, PCAPTURE, /usr/sbin/wanpipemon
+EOF
+ cat <<EOF >>/etc/sudoers
+%users ALL=NOPASSWD: ${bindir}/sudo-users/
+### END VYATTA
EOF
- fi
-
- # for "users" level (FIXME)
- if ! grep -q "^%users ALL=NOPASSWD: ${bindir}/sudo-users/" /etc/sudoers; then
- echo -e "\n%users ALL=NOPASSWD: ${bindir}/sudo-users/" >> /etc/sudoers
- fi
-
- # keep env vars
- if ! grep -q 'env_keep+=VYATTA_*' /etc/sudoers ; then
- echo "Defaults env_keep+=VYATTA_*" >> /etc/sudoers
- fi
fi
# update crontab for logrotate
diff --git a/debian/vyatta-cfg-system.postrm b/debian/vyatta-cfg-system.postrm
index d668f55d..46ec1aaa 100644
--- a/debian/vyatta-cfg-system.postrm
+++ b/debian/vyatta-cfg-system.postrm
@@ -2,6 +2,9 @@
if [ "$1" = "purge" ]; then
rm -f /etc/udev/rules.d/*vyatta-net.rules
+
+ sed -i '/### BEGIN VYATTA/,/### END VYATTA/d' /etc/sudoers
+
fi
# Local Variables: