From: Arran Cudbard-Bell Date: Wed, 3 May 2017 13:14:26 +0000 (-0400) Subject: Add PW_TYPE_BOOLEAN parsing in value_box_from_str X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=464fdcc3197693d1cd59e33b2b31d6666165ff73;p=thirdparty%2Ffreeradius-server.git Add PW_TYPE_BOOLEAN parsing in value_box_from_str Because why not... --- diff --git a/src/lib/util/value.c b/src/lib/util/value.c index c04fe67f322..692074593ed 100644 --- a/src/lib/util/value.c +++ b/src/lib/util/value.c @@ -2240,6 +2240,16 @@ int value_box_from_str(TALLOC_CTX *ctx, value_box_t *dst, break; case PW_TYPE_BOOLEAN: + if ((strcmp(in, "yes") == 0) || strcmp(in, "true") == 0) { + dst->datum.boolean = true; + } else if ((strcmp(in, "no") == 0) || (strcmp(in, "false") == 0)) { + dst->datum.boolean = false; + } else { + fr_strerror_printf("\"%s\" is not a valid boolean value", in); + return -1; + } + break; + case PW_TYPE_COMBO_IP_PREFIX: break;