X-Git-Url: https://jfr.im/git/irc/evilnet/x3.git/blobdiff_plain/87677bd8129c49fd621f8fa2c00687c6e6a29a2f..fa3c07bbce89332ed1f96313aad55bbea81f9718:/src/nickserv.c diff --git a/src/nickserv.c b/src/nickserv.c index fb420ef..63ef9d6 100644 --- a/src/nickserv.c +++ b/src/nickserv.c @@ -5,7 +5,7 @@ * * x3 is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or + * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, @@ -1062,10 +1062,10 @@ nickserv_register(struct userNode *user, struct userNode *settee, const char *ha return 0; } - if(strlen(handle) > 15) + if(strlen(handle) > 30) { if(user) - send_message(user, nickserv, "NSMSG_HANDLE_TOLONG", handle, 15); + send_message(user, nickserv, "NSMSG_HANDLE_TOLONG", handle, 30); return 0; } @@ -1874,9 +1874,9 @@ static NICKSERV_FUNC(cmd_rename_handle) reply("NSMSG_HANDLE_EXISTS", argv[2]); return 0; } - if(strlen(argv[2]) > 15) + if(strlen(argv[2]) > 30) { - reply("NMSG_HANDLE_TOLONG", argv[2], 15); + reply("NMSG_HANDLE_TOLONG", argv[2], 30); return 0; } #ifdef WITH_LDAP @@ -1959,6 +1959,10 @@ struct handle_info *loc_auth(char *handle, char *password) } // else #else + if (!hi) { + return NULL; + } + if (!checkpass(password, hi->passwd)) { return NULL; } @@ -2089,6 +2093,7 @@ static NICKSERV_FUNC(cmd_auth) #endif hi = dict_find(nickserv_handle_dict, argv[1], NULL); pw_arg = 2; +#ifdef notdef } else if (argc == 2) { if (nickserv_conf.disable_nicks) { if (!(hi = get_handle_info(user->nick))) { @@ -2107,6 +2112,7 @@ static NICKSERV_FUNC(cmd_auth) hi = ni->owner; } pw_arg = 1; +#endif } else { reply("MSG_MISSING_PARAMS", argv[0]); svccmd_send_help_brief(user, nickserv, cmd); @@ -2164,7 +2170,7 @@ static NICKSERV_FUNC(cmd_auth) } #ifdef WITH_LDAP if( ( nickserv_conf.ldap_enable && ldap_result == LDAP_INVALID_CREDENTIALS ) || - ( !nickserv_conf.ldap_enable && !checkpass(passwd, hi->passwd) ) ) { + ( (!nickserv_conf.ldap_enable) && (!checkpass(passwd, hi->passwd)) ) ) { #else if (!checkpass(passwd, hi->passwd)) { #endif @@ -4032,6 +4038,7 @@ nickserv_discrim_create(struct svccmd *cmd, struct userNode *user, unsigned int } else { reply("MSG_INVALID_CRITERIA", cmp); } +#ifdef WITH_LDAP } else if (nickserv_conf.ldap_enable && !irccasecmp(argv[i], "inldap")) { i++; if(true_string(argv[i])) { @@ -4043,6 +4050,7 @@ nickserv_discrim_create(struct svccmd *cmd, struct userNode *user, unsigned int else { reply("MSG_INVALID_BINARY", argv[i]); } +#endif } else { reply("MSG_INVALID_CRITERIA", argv[i]); goto fail;