mirror of
https://github.com/samba-team/samba.git
synced 2025-01-11 05:18:09 +03:00
verify that the nodes we try to ban/unban are operational and print an
error to the user othervise. (This used to be ctdb commit 5747dd2d80af29d6252afb6aeb3e66328ee20de5)
This commit is contained in:
parent
41d19e650c
commit
6e490e8cce
@ -1196,6 +1196,13 @@ static int control_ban(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
usage();
|
||||
}
|
||||
|
||||
/* verify we can access the node */
|
||||
ret = ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), options.pnn);
|
||||
if (ret == -1) {
|
||||
DEBUG(DEBUG_ERR,("Can not ban node. Node is not operational.\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
ban_time = strtoul(argv[0], NULL, 0);
|
||||
|
||||
b.pnn = options.pnn;
|
||||
@ -1222,6 +1229,13 @@ static int control_unban(struct ctdb_context *ctdb, int argc, const char **argv)
|
||||
int ret;
|
||||
TDB_DATA data;
|
||||
|
||||
/* verify we can access the node */
|
||||
ret = ctdb_ctrl_getpnn(ctdb, TIMELIMIT(), options.pnn);
|
||||
if (ret == -1) {
|
||||
DEBUG(DEBUG_ERR,("Can not unban node. Node is not operational.\n"));
|
||||
return -1;
|
||||
}
|
||||
|
||||
data.dptr = (uint8_t *)&options.pnn;
|
||||
data.dsize = sizeof(uint32_t);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user