From c8fecfb40e0e65823f3429e0f4787bcef4109c8c Mon Sep 17 00:00:00 2001 From: Stig Thormodsrud Date: Wed, 30 Apr 2008 11:19:18 -0700 Subject: Fix 3139 Check for previous authentication type before allowing another --- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 18 ++++++++++-------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 22 ++++++++++++---------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 18 ++++++++++-------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 18 ++++++++++-------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 20 ++++++++++---------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 22 ++++++++++++---------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 22 ++++++++++++---------- .../node.tag/ip/rip/authentication/md5/node.def | 5 ++++- .../rip/authentication/plaintext-password/node.def | 20 +++++++++++--------- 16 files changed, 119 insertions(+), 81 deletions(-) diff --git a/templates/interfaces/ethernet/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/ethernet/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/ethernet/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/ethernet/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/ethernet/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/ethernet/node.tag/ip/rip/authentication/plaintext-password/node.def index 636074b7..958ba0ba 100644 --- a/templates/interfaces/ethernet/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/ethernet/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,15 +6,17 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"ip rip authentication mode text\" \ - -c \"ip rip authentication string $VAR(@)\"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"no ip rip authentication mode\" \ - -c \"no ip rip authentication string $VAR(@)\"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)"; + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)"; comp_help: possible completions: Password (16 characters or less) diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/plaintext-password/node.def index 2b9dac5b..da94d143 100644 --- a/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,17 +6,19 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../@).$VAR(../../../../@) \" \ - -c \"ip rip authentication mode text \" \ - -c \"ip rip authentication string $VAR(@) \"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../@).$VAR(../../../../@) \" \ - -c \"no ip rip authentication mode \" \ - -c \"no ip rip authentication string $VAR(@) \"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../@).$VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../@).$VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Plain text password (16 characters or less) diff --git a/templates/interfaces/loopback/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/loopback/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/loopback/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/loopback/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/loopback/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/loopback/node.tag/ip/rip/authentication/plaintext-password/node.def index bb6c0eeb..17a99a94 100644 --- a/templates/interfaces/loopback/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/loopback/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,15 +6,17 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"ip rip authentication mode text\" \ - -c \"ip rip authentication string $VAR(@)\"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"no ip rip authentication mode\" \ - -c \"no ip rip authentication string $VAR(@)\"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Password (16 characters or less) diff --git a/templates/interfaces/multilink/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/multilink/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/multilink/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/multilink/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/multilink/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/multilink/node.tag/ip/rip/authentication/plaintext-password/node.def index 636074b7..99d59378 100644 --- a/templates/interfaces/multilink/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/multilink/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,15 +6,17 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"ip rip authentication mode text\" \ - -c \"ip rip authentication string $VAR(@)\"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"no ip rip authentication mode\" \ - -c \"no ip rip authentication string $VAR(@)\"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Password (16 characters or less) diff --git a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/plaintext-password/node.def index 438d260f..4a7f96b8 100644 --- a/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/serial/node.tag/cisco-hdlc/vif/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,17 +6,17 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"ip rip authentication mode text \" \ - -c \"ip rip authentication string $VAR(@) \"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"no ip rip authentication mode \" \ - -c \"no ip rip authentication string $VAR(@) \"; " +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Plain text password (16 characters or less) diff --git a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/plaintext-password/node.def index 1e124e8d..cc83f470 100644 --- a/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/serial/node.tag/frame-relay/vif/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,17 +6,19 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"ip rip authentication mode text \" \ - -c \"ip rip authentication string $VAR(@) \"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"no ip rip authentication mode \" \ - -c \"no ip rip authentication string $VAR(@) \"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Plain text password (16 characters or less) diff --git a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/plaintext-password/node.def index 438d260f..1bc3c650 100644 --- a/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/serial/node.tag/ppp/vif/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,17 +6,19 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"ip rip authentication mode text \" \ - -c \"ip rip authentication string $VAR(@) \"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal \" \ - -c \"interface $VAR(../../../../../../@).$VAR(../../../../@) \" \ - -c \"no ip rip authentication mode \" \ - -c \"no ip rip authentication string $VAR(@) \"; " +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" \ + -c "interface $VAR(../../../../../../@).$VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" comp_help: possible completions: Plain text password (16 characters or less) diff --git a/templates/interfaces/tunnel/node.tag/ip/rip/authentication/md5/node.def b/templates/interfaces/tunnel/node.tag/ip/rip/authentication/md5/node.def index e1819c01..8d165fe6 100644 --- a/templates/interfaces/tunnel/node.tag/ip/rip/authentication/md5/node.def +++ b/templates/interfaces/tunnel/node.tag/ip/rip/authentication/md5/node.def @@ -1,5 +1,8 @@ tag: type: u32 help: Set MD5 authentication key ID -syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; "ID must be between 1 and 255" +syntax:expression: $VAR(@) >= 1 && $VAR(@) <= 255; \ + "ID must be between 1 and 255" +commit:expression: $VAR(../plaintext-password/) == "" ; \ + "plaintext-password already set" diff --git a/templates/interfaces/tunnel/node.tag/ip/rip/authentication/plaintext-password/node.def b/templates/interfaces/tunnel/node.tag/ip/rip/authentication/plaintext-password/node.def index 593c7690..aaaae83e 100644 --- a/templates/interfaces/tunnel/node.tag/ip/rip/authentication/plaintext-password/node.def +++ b/templates/interfaces/tunnel/node.tag/ip/rip/authentication/plaintext-password/node.def @@ -6,15 +6,17 @@ syntax:expression: exec " \ exit 1 ; \ fi ; " -update:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"ip rip authentication mode text\" \ - -c \"ip rip authentication string $VAR(@)\"; " +commit:expression: $VAR(../md5/) == "" ; "md5 password already set" + +update: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "ip rip authentication mode text" \ + -c "ip rip authentication string $VAR(@)" + +delete: ${vyatta_sbindir}/vyatta-vtysh.pl \ + -c "configure terminal" -c "interface $VAR(../../../../@)" \ + -c "no ip rip authentication mode" \ + -c "no ip rip authentication string $VAR(@)" -delete:expression: "${vyatta_sbindir}/vyatta-vtysh.pl \ - -c \"configure terminal\" -c \"interface $VAR(../../../../@)\" \ - -c \"no ip rip authentication mode\" \ - -c \"no ip rip authentication string $VAR(@)\"; " comp_help: possible completions: Password (16 characters or less) - -- cgit v1.2.3