Changeset 446a23e


Ignore:
Timestamp:
2016-03-23T06:44:13Z (8 years ago)
Author:
Dennis Kaarsemaker <dennis@…>
Branches:
master
Children:
8e6ecfe
Parents:
e41ba05
git-author:
Dennis Kaarsemaker <dennis@…> (22-02-16 20:25:39)
git-committer:
Dennis Kaarsemaker <dennis@…> (23-03-16 06:44:13)
Message:

Add a setting to disable 'account add'

In a locked down bitlbee instance it is useful to disable the 'account
add' command.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.conf

    re41ba05 r446a23e  
    6969## or
    7070# OperPassword = md5:I0mnZbn1t4R731zzRdDN2/pK7lRX
     71
     72## AllowAccountAdd
     73##
     74## Whether to allow registered and identified users to add new accounts using
     75## 'account add'
     76##
     77# AllowAccountAdd 1
    7178
    7279## HostName
  • conf.c

    re41ba05 r446a23e  
    5757        conf->auth_pass = NULL;
    5858        conf->oper_pass = NULL;
     59        conf->allow_account_add = 1;
    5960        conf->configdir = g_strdup(CONFIG);
    6061        conf->plugindir = g_strdup(PLUGINDIR);
     
    246247                                g_free(conf->oper_pass);
    247248                                conf->oper_pass = g_strdup(ini->value);
     249                        } else if (g_strcasecmp(ini->key, "allowaccountadd") == 0) {
     250                                if (!is_bool(ini->value)) {
     251                                        fprintf(stderr, "Invalid %s value: %s\n", ini->key, ini->value);
     252                                        return 0;
     253                                }
     254                                conf->allow_account_add = bool2int(ini->value);
    248255                        } else if (g_strcasecmp(ini->key, "hostname") == 0) {
    249256                                g_free(conf->hostname);
  • conf.h

    re41ba05 r446a23e  
    3939        char *auth_pass;
    4040        char *oper_pass;
     41        int allow_account_add;
    4142        char *hostname;
    4243        char *configdir;
  • root_commands.c

    re41ba05 r446a23e  
    416416
    417417                MIN_ARGS(3);
     418
     419                if (!global.conf->allow_account_add) {
     420                        irc_rootmsg(irc, "This server does not allow adding new accounts");
     421                        return;
     422                }
    418423
    419424                if (cmd[4] == NULL) {
Note: See TracChangeset for help on using the changeset viewer.