summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2018-08-20 13:43:38 +1000
committerKarolin Seeger <kseeger@samba.org>2018-08-28 10:59:16 +0200
commit624b4d15577daf68976cf3674699a948da969ea8 (patch)
tree55ca00d1b54b4c13a38b0808578506e61a766dbb
parent55674458d245314b458e30449972ec3821ddd1d1 (diff)
downloadsamba-624b4d15577daf68976cf3674699a948da969ea8.tar.gz
ctdb-common: Allow boolean configuration values to have yes/no values
This make the new configuration style more consistent with the old one. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13589 Signed-off-by: Martin Schwenke <martin@meltin.net> Reviewed-by: Amitay Isaacs <amitay@gmail.com> (cherry picked from commit 21de59ab7fe53240380b9a9a5b32d5af32d34237)
-rw-r--r--ctdb/common/conf.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ctdb/common/conf.c b/ctdb/common/conf.c
index 74af7f8a048..669ac23a74b 100644
--- a/ctdb/common/conf.c
+++ b/ctdb/common/conf.c
@@ -122,12 +122,12 @@ static int string_to_integer(const char *str, int *int_val)
static int string_to_boolean(const char *str, bool *bool_val)
{
- if (strcasecmp(str, "true") == 0) {
+ if (strcasecmp(str, "true") == 0 || strcasecmp(str, "yes") == 0) {
*bool_val = true;
return 0;
}
- if (strcasecmp(str, "false") == 0) {
+ if (strcasecmp(str, "false") == 0 || strcasecmp(str, "no") == 0) {
*bool_val = false;
return 0;
}