summaryrefslogtreecommitdiffstats
path: root/ctdb/tools
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2013-09-23 16:19:52 +1000
committerAmitay Isaacs <amitay@gmail.com>2013-09-25 14:34:55 +1000
commit058037d58c2acdc3a5fdb46746f757a7201e6563 (patch)
tree4d900bf4b8fd12abaf676d5cba625ebbbb6ceeff /ctdb/tools
parent4c4bfcbd6f76ce9b7cd22d073fee2db4bca253ae (diff)
downloadsamba-058037d58c2acdc3a5fdb46746f757a7201e6563.tar.gz
samba-058037d58c2acdc3a5fdb46746f757a7201e6563.tar.xz
samba-058037d58c2acdc3a5fdb46746f757a7201e6563.zip
tools/ctdb: Ban time of 0 is invalid
Apparently it used to mean a permanent ban but it is unclear if this was ever supported. Signed-off-by: Martin Schwenke <martin@meltin.net> (This used to be ctdb commit c8a6e5ce579e2fe320c40268e7e9ddfe68b8cd30)
Diffstat (limited to 'ctdb/tools')
-rw-r--r--ctdb/tools/ctdb.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c
index d67975a8748..7dab373493a 100644
--- a/ctdb/tools/ctdb.c
+++ b/ctdb/tools/ctdb.c
@@ -3182,6 +3182,11 @@ static int control_ban(struct ctdb_context *ctdb, int argc, const char **argv)
bantime.pnn = options.pnn;
bantime.time = strtoul(argv[0], NULL, 0);
+ if (bantime.time == 0) {
+ DEBUG(DEBUG_ERR, ("Invalid ban time specified - must be >0\n"));
+ return -1;
+ }
+
return update_flags_and_ipreallocate(ctdb, &bantime,
update_state_banned,
NODE_FLAGS_BANNED,