summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2017-01-16 07:24:15 +1100
committerAmitay Isaacs <amitay@samba.org>2017-01-17 02:20:16 +0100
commitf9368f8e129cb32ee30cb6501a6fe728db37e1d5 (patch)
tree238347eb23e7904d1b884bfad3d577ce10a0bc5c
parent5e00a6b346325f52e35b9785eaffd72239aebcf5 (diff)
downloadsamba-f9368f8e129cb32ee30cb6501a6fe728db37e1d5.tar.gz
ctdb-scripts: Fix regression when cleaning up routing table IDs
Commit 0ca00267cd2620a14968961738bcd2a69b597e95 removed explicit continuations in strings for awk programs. In one case this causes a disconnect between condition and action, where an implicit continuation does not work. This results in duplicate lines in the rt_tables file. Move the opening brace for the action to make the implicit continuation work as expected. An alternative would be to revert the removal of the explicit continuations and add shellcheck tags. However, that doesn't mean that an author of future code will necessarily use explicit continuations, so the same mistake might still be make in the future. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12516 Reported-by: Barry Evans <bevans@pixitmedia.com> Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com>
-rwxr-xr-xctdb/config/events.d/13.per_ip_routing4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/config/events.d/13.per_ip_routing b/ctdb/config/events.d/13.per_ip_routing
index a7a23c02483..4fff73b40e1 100755
--- a/ctdb/config/events.d/13.per_ip_routing
+++ b/ctdb/config/events.d/13.per_ip_routing
@@ -184,8 +184,8 @@ clean_up_table_ids ()
-v pre="$table_id_prefix" \
'/^#/ ||
!(min <= $1 && $1 <= max) &&
- !(index($2, pre) == 1)
- { print $0 }' "$rt_tables" >"$_tmp"
+ !(index($2, pre) == 1) {
+ print $0 }' "$rt_tables" >"$_tmp"
mv "$_tmp" "$rt_tables"
) 9>"$rt_tables_lock"