|=====
| Operator | Description
| = | Set the attribute to the contents of the _<rhs>_, if the _<attribute>_ does not exist. If the attribute already exists, nothing is done. If the attribute does not exist, it is created, and the contents set to the value of the _<rhs>_
-| := | Override the attribute with the contents with the _<rhs>_. If the attribute already exists, its value is over-written. If the attribute does not exist, it is created, and the contents set to thex value of the _<rhs>_
+| := | Delete all existing copies of the named attribute, and create a new attribute with the contents set to the value of the _<rhs>_
| += | Perform addition. The contents of the _<rhs>_ are added to the value of the _<attribute>_.
| -= | Perform subtraction. The contents of the _<rhs>_ are subtracted from the value of the _<attribute>_.
| *= | Perform multiplication. The value of the _<attribute>_ is multiplied by the contents of the _<rhs>_.
pair = true;
}
- if (!box) {
+ if (!box && (map->op != T_OP_SET)) {
RWDEBUG("%s %s ... - Assignment failed - No value on right-hand side", map->lhs->name, fr_tokens[map->op]);
return -1;
}
fr_dict_attr_t const *da = tmpl_attr_tail_da(current->lhs.vpt);
fr_pair_t *vp;
+ if (!box) {
+ RDEBUG2("%s %s ...", current->lhs.vpt->name, fr_tokens[map->op]);
+ goto done;
+ }
+
/*
* Something went wrong creating the value, it's a failure. Note that we fail _all_
* subsequent assignments, too.
--- /dev/null
+#
+# Tests the ":=" operator where the RHS expansion fails.
+#
+# It should still nuke the LHS attributes
+#
+
+&NAS-Port := 1812
+if !(&NAS-Port == 1812) {
+ test_fail
+}
+
+#
+# Service-Type doesn't exist, so the ":=" means "delete everything"
+#
+&NAS-Port := %(integer:%{Service-Type})
+
+#
+# This should no longer exist.
+#
+if &NAS-Port {
+ test_fail
+}
+
+
+success