From 8d50efd29e567f68db2eb43a80d2b746a2ee842e Mon Sep 17 00:00:00 2001 From: Bram Matthys Date: Fri, 30 Jun 2023 15:17:20 +0200 Subject: [PATCH] Fix documentation confusing regarding rpc-user::match vs ::mask. Only match was working earlier, and for now both are accepted, like everywhere else. Reported by BlackBishop. Also, added a missing check for unknown rpc-user items, so a proper "Unknown directive" error is thrown. (this missing check made the first issue worse) --- src/modules/rpc/rpc.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/modules/rpc/rpc.c b/src/modules/rpc/rpc.c index c501291eb..c262ab549 100644 --- a/src/modules/rpc/rpc.c +++ b/src/modules/rpc/rpc.c @@ -380,7 +380,7 @@ int rpc_config_test_rpc_user(ConfigFile *cf, ConfigEntry *ce, int type, int *err } for (cep = ce->items; cep; cep = cep->next) { - if (!strcmp(cep->name, "match")) + if (!strcmp(cep->name, "match") || !strcmp(cep->name, "mask")) { has_match = 1; test_match_block(cf, cep, &errors); @@ -390,6 +390,11 @@ int rpc_config_test_rpc_user(ConfigFile *cf, ConfigEntry *ce, int type, int *err has_password = 1; if (Auth_CheckError(cep) < 0) errors++; + } else + { + config_error_unknown(cep->file->filename, + cep->line_number, "rpc-user", cep->name); + errors++; } } @@ -412,7 +417,7 @@ int rpc_config_run_rpc_user(ConfigFile *cf, ConfigEntry *ce, int type) for (cep = ce->items; cep; cep = cep->next) { - if (!strcmp(cep->name, "match")) + if (!strcmp(cep->name, "match") || !strcmp(cep->name, "mask")) { conf_match_block(cf, cep, &e->match); } else