summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am1
-rw-r--r--etc/default/vyatta-cfg2
-rwxr-xr-xscripts/vyatta-cfg-cmd-wrapper2
-rw-r--r--scripts/vyatta-check-typeless-node.pl21
-rw-r--r--src/commit.c2
-rw-r--r--templates/interfaces/ethernet/node.tag/address/node.def2
-rw-r--r--templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def1
7 files changed, 27 insertions, 4 deletions
diff --git a/Makefile.am b/Makefile.am
index 2879932..a309d34 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -42,6 +42,7 @@ sbin_SCRIPTS += scripts/vyatta-load-config.pl
sbin_SCRIPTS += scripts/vyatta-cfg-notify
sbin_SCRIPTS += scripts/vyatta-interfaces.pl
sbin_SCRIPTS += scripts/vyatta-irqaffin
+sbin_SCRIPTS += scripts/vyatta-check-typeless-node.pl
share_perl5_SCRIPTS = scripts/VyattaConfig.pm
share_perl5_SCRIPTS += scripts/VyattaConfigDOMTree.pm
diff --git a/etc/default/vyatta-cfg b/etc/default/vyatta-cfg
index 7d189d8..b07440f 100644
--- a/etc/default/vyatta-cfg
+++ b/etc/default/vyatta-cfg
@@ -3,7 +3,7 @@
{
declare -x -r VYATTA_ACTIVE_CONFIGURATION_DIR=${vyatta_configdir}/active
-declare -x -r VYATTA_CHANGES_ONLY_DIR=${vyatta_configdir}/tmp/changes_only_$$
+declare -x -r VYATTA_CHANGES_ONLY_DIR=/tmp/changes_only_$$
declare -x -r VYATTA_TEMP_CONFIG_DIR=${vyatta_configdir}/tmp/new_config_$$
declare -x -r VYATTA_CONFIG_TMP=${vyatta_configdir}/tmp/tmp_$$
declare -x -r VYATTA_CONFIG_TEMPLATE=$vyatta_cfg_templates
diff --git a/scripts/vyatta-cfg-cmd-wrapper b/scripts/vyatta-cfg-cmd-wrapper
index a1a573e..518147d 100755
--- a/scripts/vyatta-cfg-cmd-wrapper
+++ b/scripts/vyatta-cfg-cmd-wrapper
@@ -32,7 +32,7 @@ export VYATTA_EDIT_LEVEL=/;
export VYATTA_TEMPLATE_LEVEL=/;
export VYATTA_ACTIVE_CONFIGURATION_DIR=/opt/vyatta/config/active;
-export VYATTA_CHANGES_ONLY_DIR=/opt/vyatta/config/tmp/changes_only_$PPID;
+export VYATTA_CHANGES_ONLY_DIR=/tmp/changes_only_$PPID;
export VYATTA_TEMP_CONFIG_DIR=/opt/vyatta/config/tmp/new_config_$PPID;
export VYATTA_CONFIG_TMP=/opt/vyatta/config/tmp/tmp_$PPID;
diff --git a/scripts/vyatta-check-typeless-node.pl b/scripts/vyatta-check-typeless-node.pl
new file mode 100644
index 0000000..65a7408
--- /dev/null
+++ b/scripts/vyatta-check-typeless-node.pl
@@ -0,0 +1,21 @@
+#!/usr/bin/perl
+use lib "/opt/vyatta/share/perl5/";
+use VyattaConfig;
+use VyattaMisc;
+use Getopt::Long;
+
+## Check if a typeless node exists
+# this is a lame little script to get around bug 2525 not being fixed.
+# i.e. $VAR(./node/) always expands to true. Once bug 2525 is properly
+# fixed, this can go away
+my $node = shift;
+my $config = new VyattaConfig;
+
+if ($config->exists("$node")) {
+ exit 0;
+}
+else {
+ exit 1;
+}
+
+exit 0;
diff --git a/src/commit.c b/src/commit.c
index c3219e5..980a98b 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -1359,7 +1359,7 @@ static int fin_commit(boolean ok)
system(command);
my_free(command);
- command = my_malloc(strlen(format3) + c_len, "");
+ command = my_malloc(strlen(format3) + t_len, "");
sprintf(command, format3, get_tmpp());
system(command);
my_free(command);
diff --git a/templates/interfaces/ethernet/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/address/node.def
index 79bc6e2..23b1262 100644
--- a/templates/interfaces/ethernet/node.tag/address/node.def
+++ b/templates/interfaces/ethernet/node.tag/address/node.def
@@ -4,7 +4,7 @@ help: Configure an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../@)"; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../@)"
update:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../@)"; "Error setting address $VAR(@) on interface $VAR(../@)"
delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../@)"; "Error deleting address $VAR(@) on interface $VAR(../@)"
-allowed: echo "dhcp"
+allowed: echo "dhcp <>"
comp_help:Possible completions:
<IP address>/<prefix length>\tSet the IP address and prefix length
dhcp\t\t\t\tSet the IP address and prefix length via DHCP
diff --git a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
index 6653727..a33818f 100644
--- a/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
+++ b/templates/interfaces/ethernet/node.tag/vif/node.tag/address/node.def
@@ -4,6 +4,7 @@ help: Configure an IP address for this interface
syntax:expression: exec "/opt/vyatta/sbin/vyatta-interfaces.pl --valid-addr $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Invalid IP address/prefix [$VAR(@)] for interface $VAR(../../@).$VAR(../@)"
create:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-update $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error setting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
delete:expression: "sudo /opt/vyatta/sbin/vyatta-interfaces.pl --eth-addr-delete $VAR(@) --dev $VAR(../../@).$VAR(../@) "; "Error deleting address $VAR(@) on dev $VAR(../../@).$VAR(../@) "
+allowed: echo "dhcp <>"
comp_help:Possible completions:
<IP address>/<prefix length> Set the IP address and prefix length
dhcp Set the IP address and prefix length via DHCP