From f6ec442f339611df91a79c770483d0e6b13566ff Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 10 Dec 2007 14:40:58 -0800 Subject: fix for bug 2526: show user's history file and add needed packages for tech-support. --- debian/control | 2 ++ 1 file changed, 2 insertions(+) (limited to 'debian') diff --git a/debian/control b/debian/control index a5c9b9f..020126d 100644 --- a/debian/control +++ b/debian/control @@ -12,6 +12,8 @@ Depends: bash (>= 3.1), ethtool, ntpdate, procps (>= 1:3.2.7-3), + pciutils, + lsof, coreutils (>= 5.97-5.3) Suggests: util-linux (>= 2.13-5), net-tools, -- cgit v1.2.3 From 688433f5c3da09c9de19fec8d6217764bb5a036c Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Mon, 10 Dec 2007 18:56:21 -0800 Subject: add wrappers/symlinks for pipe commands (wrappers are needed for command matching in restricted modes). --- Makefile.am | 4 ++++ debian/vyatta-op.postinst.in | 4 ++++ debian/vyatta-op.postrm.in | 4 ++++ etc/bash_completion.d/10vyatta-op | 2 -- scripts/count | 4 ++++ scripts/match | 4 ++++ scripts/no-match | 4 ++++ scripts/no-more | 4 ++++ 8 files changed, 28 insertions(+), 2 deletions(-) create mode 100755 scripts/count create mode 100755 scripts/match create mode 100755 scripts/no-match create mode 100755 scripts/no-more (limited to 'debian') diff --git a/Makefile.am b/Makefile.am index c9849cb..82d2a53 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,6 +13,10 @@ allowed_DATA = functions/allowed/hosts bin_SCRIPTS = scripts/vyatta-show-interfaces bin_SCRIPTS += scripts/vyatta-show-version +bin_SCRIPTS += scripts/count +bin_SCRIPTS += scripts/match +bin_SCRIPTS += scripts/no-match +bin_SCRIPTS += scripts/no-more bin_sudo_users_SCRIPTS = scripts/vyatta-show-log bin_sudo_users_SCRIPTS += scripts/vyatta-show-log-all diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in index 4f0b3b4..626ace2 100644 --- a/debian/vyatta-op.postinst.in +++ b/debian/vyatta-op.postinst.in @@ -8,4 +8,8 @@ bindir=@bindir@ ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode ln -sf /sbin/iptables ${bindir}/sudo-users/iptables +ln -sf ${bindir}/count /usr/bin/ +ln -sf ${bindir}/match /usr/bin/ +ln -sf ${bindir}/no-match /usr/bin/ +ln -sf ${bindir}/no-more /usr/bin/ diff --git a/debian/vyatta-op.postrm.in b/debian/vyatta-op.postrm.in index f86a7ba..34f21ed 100644 --- a/debian/vyatta-op.postrm.in +++ b/debian/vyatta-op.postrm.in @@ -9,5 +9,9 @@ if [ "$1" = "purge" ]; then rm -f ${bindir}/sudo-users/ethtool rm -f ${bindir}/sudo-users/dmidecode rm -f ${bindir}/sudo-users/iptables + rm -f /usr/bin/count + rm -f /usr/bin/match + rm -f /usr/bin/no-match + rm -f /usr/bin/no-more fi diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index 5a672c3..52be05a 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -304,8 +304,6 @@ done eval $nullglob_save unset nullglob_save -alias no-more=cat - _vyatta_op_init $@ ### Local Variables: diff --git a/scripts/count b/scripts/count new file mode 100755 index 0000000..1ab3796 --- /dev/null +++ b/scripts/count @@ -0,0 +1,4 @@ +#!/bin/bash + +wc -l "$@" + diff --git a/scripts/match b/scripts/match new file mode 100755 index 0000000..c452824 --- /dev/null +++ b/scripts/match @@ -0,0 +1,4 @@ +#!/bin/bash + +grep -E -e "$@" + diff --git a/scripts/no-match b/scripts/no-match new file mode 100755 index 0000000..528d80c --- /dev/null +++ b/scripts/no-match @@ -0,0 +1,4 @@ +#!/bin/bash + +grep -E -v -e "$@" + diff --git a/scripts/no-more b/scripts/no-more new file mode 100755 index 0000000..59f51e8 --- /dev/null +++ b/scripts/no-more @@ -0,0 +1,4 @@ +#!/bin/bash + +cat "$@" + -- cgit v1.2.3 From 4a26e01aedbbee2092a0d3c547cb2061d2305a6d Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Tue, 11 Dec 2007 10:24:56 -0800 Subject: implement "pipe" commands as functions --- Makefile.am | 4 ---- debian/vyatta-op.postinst.in | 4 ---- debian/vyatta-op.postrm.in | 4 ---- etc/bash_completion.d/10vyatta-op | 21 +++++++++++++++++++++ scripts/count | 4 ---- scripts/match | 4 ---- scripts/no-match | 4 ---- scripts/no-more | 4 ---- 8 files changed, 21 insertions(+), 28 deletions(-) delete mode 100755 scripts/count delete mode 100755 scripts/match delete mode 100755 scripts/no-match delete mode 100755 scripts/no-more (limited to 'debian') diff --git a/Makefile.am b/Makefile.am index 82d2a53..c9849cb 100644 --- a/Makefile.am +++ b/Makefile.am @@ -13,10 +13,6 @@ allowed_DATA = functions/allowed/hosts bin_SCRIPTS = scripts/vyatta-show-interfaces bin_SCRIPTS += scripts/vyatta-show-version -bin_SCRIPTS += scripts/count -bin_SCRIPTS += scripts/match -bin_SCRIPTS += scripts/no-match -bin_SCRIPTS += scripts/no-more bin_sudo_users_SCRIPTS = scripts/vyatta-show-log bin_sudo_users_SCRIPTS += scripts/vyatta-show-log-all diff --git a/debian/vyatta-op.postinst.in b/debian/vyatta-op.postinst.in index 626ace2..4f0b3b4 100644 --- a/debian/vyatta-op.postinst.in +++ b/debian/vyatta-op.postinst.in @@ -8,8 +8,4 @@ bindir=@bindir@ ln -sf /usr/sbin/ethtool ${bindir}/sudo-users/ethtool ln -sf /usr/sbin/dmidecode ${bindir}/sudo-users/dmidecode ln -sf /sbin/iptables ${bindir}/sudo-users/iptables -ln -sf ${bindir}/count /usr/bin/ -ln -sf ${bindir}/match /usr/bin/ -ln -sf ${bindir}/no-match /usr/bin/ -ln -sf ${bindir}/no-more /usr/bin/ diff --git a/debian/vyatta-op.postrm.in b/debian/vyatta-op.postrm.in index 34f21ed..f86a7ba 100644 --- a/debian/vyatta-op.postrm.in +++ b/debian/vyatta-op.postrm.in @@ -9,9 +9,5 @@ if [ "$1" = "purge" ]; then rm -f ${bindir}/sudo-users/ethtool rm -f ${bindir}/sudo-users/dmidecode rm -f ${bindir}/sudo-users/iptables - rm -f /usr/bin/count - rm -f /usr/bin/match - rm -f /usr/bin/no-match - rm -f /usr/bin/no-more fi diff --git a/etc/bash_completion.d/10vyatta-op b/etc/bash_completion.d/10vyatta-op index 52be05a..d5ea362 100644 --- a/etc/bash_completion.d/10vyatta-op +++ b/etc/bash_completion.d/10vyatta-op @@ -291,6 +291,27 @@ _vyatta_op_run () return $ret } +# "pipe" functions +count () +{ + wc -l "$@" +} + +match () +{ + grep -E -e "$@" +} + +no-match () +{ + grep -E -v -e "$@" +} + +no-more () +{ + cat "$@" +} + # don't initialize if we are in configure mode if [ "$_OFR_CONFIGURE" == "ok" ]; then return 0 diff --git a/scripts/count b/scripts/count deleted file mode 100755 index 1ab3796..0000000 --- a/scripts/count +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -wc -l "$@" - diff --git a/scripts/match b/scripts/match deleted file mode 100755 index c452824..0000000 --- a/scripts/match +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -grep -E -e "$@" - diff --git a/scripts/no-match b/scripts/no-match deleted file mode 100755 index 528d80c..0000000 --- a/scripts/no-match +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -grep -E -v -e "$@" - diff --git a/scripts/no-more b/scripts/no-more deleted file mode 100755 index 59f51e8..0000000 --- a/scripts/no-more +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash - -cat "$@" - -- cgit v1.2.3 From fb94b5aaf0922f656cb9c81d69d10bbcc4dc9091 Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Thu, 13 Dec 2007 12:32:29 -0800 Subject: Add "show user", "show arp", and "show host". --- debian/control | 3 ++- templates/show/arp/node.def | 2 ++ templates/show/host/date/node.def | 2 ++ templates/show/host/lookup/node.def | 1 + templates/show/host/lookup/node.tag/node.def | 3 +++ templates/show/host/name/node.def | 2 ++ templates/show/host/node.def | 1 + templates/show/host/os/node.def | 2 ++ templates/show/users/node.def | 2 ++ 9 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 templates/show/arp/node.def create mode 100644 templates/show/host/date/node.def create mode 100644 templates/show/host/lookup/node.def create mode 100644 templates/show/host/lookup/node.tag/node.def create mode 100644 templates/show/host/name/node.def create mode 100644 templates/show/host/node.def create mode 100644 templates/show/host/os/node.def create mode 100644 templates/show/users/node.def (limited to 'debian') diff --git a/debian/control b/debian/control index 020126d..074e6e5 100644 --- a/debian/control +++ b/debian/control @@ -14,7 +14,8 @@ Depends: bash (>= 3.1), procps (>= 1:3.2.7-3), pciutils, lsof, - coreutils (>= 5.97-5.3) + coreutils (>= 5.97-5.3), + host Suggests: util-linux (>= 2.13-5), net-tools, ncurses-bin (>= 5.5-5), diff --git a/templates/show/arp/node.def b/templates/show/arp/node.def new file mode 100644 index 0000000..021f848 --- /dev/null +++ b/templates/show/arp/node.def @@ -0,0 +1,2 @@ +help: Show Address Resolution Protocol Information +run: /usr/sbin/arp -e diff --git a/templates/show/host/date/node.def b/templates/show/host/date/node.def new file mode 100644 index 0000000..6ea4383 --- /dev/null +++ b/templates/show/host/date/node.def @@ -0,0 +1,2 @@ +help: Show host current date +run: /bin/date diff --git a/templates/show/host/lookup/node.def b/templates/show/host/lookup/node.def new file mode 100644 index 0000000..d8368b6 --- /dev/null +++ b/templates/show/host/lookup/node.def @@ -0,0 +1 @@ +help: Lookup host info for host/ipaddress diff --git a/templates/show/host/lookup/node.tag/node.def b/templates/show/host/lookup/node.tag/node.def new file mode 100644 index 0000000..e0dd0df --- /dev/null +++ b/templates/show/host/lookup/node.tag/node.def @@ -0,0 +1,3 @@ +help: Lookup host information for host/ipaddres +allowed: vyatta-allowed-hosts +run: /usr/bin/host $4 diff --git a/templates/show/host/name/node.def b/templates/show/host/name/node.def new file mode 100644 index 0000000..0197d10 --- /dev/null +++ b/templates/show/host/name/node.def @@ -0,0 +1,2 @@ +help: Show host name +run: /bin/hostname diff --git a/templates/show/host/node.def b/templates/show/host/node.def new file mode 100644 index 0000000..65a0694 --- /dev/null +++ b/templates/show/host/node.def @@ -0,0 +1 @@ +help: Show host information diff --git a/templates/show/host/os/node.def b/templates/show/host/os/node.def new file mode 100644 index 0000000..1cfe2ec --- /dev/null +++ b/templates/show/host/os/node.def @@ -0,0 +1,2 @@ +help: Show host operating system details +run: /bin/uname -a diff --git a/templates/show/users/node.def b/templates/show/users/node.def new file mode 100644 index 0000000..6a88319 --- /dev/null +++ b/templates/show/users/node.def @@ -0,0 +1,2 @@ +help: Show user information +run: who -- cgit v1.2.3