From 446a23ea39184c5fe43cd40706bb683b89534e2e Mon Sep 17 00:00:00 2001 From: Dennis Kaarsemaker Date: Mon, 22 Feb 2016 21:25:39 +0100 Subject: Add a setting to disable 'account add' In a locked down bitlbee instance it is useful to disable the 'account add' command. --- conf.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'conf.c') diff --git a/conf.c b/conf.c index b249a11b..6da77d59 100644 --- a/conf.c +++ b/conf.c @@ -56,6 +56,7 @@ conf_t *conf_load(int argc, char *argv[]) conf->authmode = AUTHMODE_OPEN; conf->auth_pass = NULL; conf->oper_pass = NULL; + conf->allow_account_add = 1; conf->configdir = g_strdup(CONFIG); conf->plugindir = g_strdup(PLUGINDIR); conf->pidfile = g_strdup(PIDFILE); @@ -245,6 +246,12 @@ static int conf_loadini(conf_t *conf, char *file) } else if (g_strcasecmp(ini->key, "operpassword") == 0) { g_free(conf->oper_pass); conf->oper_pass = g_strdup(ini->value); + } else if (g_strcasecmp(ini->key, "allowaccountadd") == 0) { + if (!is_bool(ini->value)) { + fprintf(stderr, "Invalid %s value: %s\n", ini->key, ini->value); + return 0; + } + conf->allow_account_add = bool2int(ini->value); } else if (g_strcasecmp(ini->key, "hostname") == 0) { g_free(conf->hostname); conf->hostname = g_strdup(ini->value); -- cgit v1.2.3