diff options
author | Martin Schwenke <martin@meltin.net> | 2013-09-23 16:19:52 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@gmail.com> | 2013-09-25 14:34:55 +1000 |
commit | 058037d58c2acdc3a5fdb46746f757a7201e6563 (patch) | |
tree | 4d900bf4b8fd12abaf676d5cba625ebbbb6ceeff /ctdb/tools | |
parent | 4c4bfcbd6f76ce9b7cd22d073fee2db4bca253ae (diff) | |
download | samba-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.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ctdb/tools/ctdb.c b/ctdb/tools/ctdb.c index d67975a874..7dab373493 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, |