#include "hash.h"
#include "ircd.h"
#include "ircd_alloc.h"
-#include "ircd_auth.h"
#include "ircd_chattr.h"
#include "ircd_log.h"
#include "ircd_reply.h"
#include "opercmds.h"
#include "parse.h"
#include "res.h"
+#include "s_auth.h"
#include "s_bsd.h"
#include "s_debug.h"
#include "s_misc.h"
}
}
-/** Check client limits and attach Client block.
- * If there are more connections from the IP than \a aconf->maximum
- * allows, return ACR_TOO_MANY_FROM_IP. Otherwise, attach \a aconf to
- * \a cptr.
- * @param cptr Client getting \a aconf.
- * @param aconf Configuration item to attach.
- * @return Authorization check result.
- */
-static enum AuthorizationCheckResult
-check_limit_and_attach(struct Client* cptr, struct ConfItem* aconf)
-{
- if (IPcheck_nr(cptr) > aconf->maximum)
- return ACR_TOO_MANY_FROM_IP;
- return attach_conf(cptr, aconf);
-}
-
/** Find the first (best) Client block to attach.
* @param cptr Client for whom to check rules.
* @return Authorization check result.
*/
if (aconf->address.port && aconf->address.port != cli_listener(cptr)->addr.port)
continue;
- if (aconf->username) {
- SetFlag(cptr, FLAG_DOID);
- if (match(aconf->username, cli_username(cptr)))
- continue;
- }
+ if (aconf->username && match(aconf->username, cli_username(cptr)))
+ continue;
if (aconf->host && match(aconf->host, cli_sockhost(cptr)))
continue;
if ((aconf->addrbits >= 0)
&& !ipmask_check(&cli_ip(cptr), &aconf->address.addr, aconf->addrbits))
continue;
- return check_limit_and_attach(cptr, aconf);
+ if (IPcheck_nr(cptr) > aconf->maximum)
+ return ACR_TOO_MANY_FROM_IP;
+ if (aconf->username)
+ SetFlag(cptr, FLAG_DOID);
+ return attach_conf(cptr, aconf);
}
return ACR_NO_AUTHORIZATION;
}
(aconf->username ? aconf->username : "(null)"),
(aconf->host ? aconf->host : "(null)"),
(aconf->name ? aconf->name : "(null)"),
- ConfClass(aconf), aconf->maximum, aconf->passwd);
+ ConfClass(aconf), aconf->maximum,
+ (aconf->passwd ? aconf->passwd : "(null)"));
break;
}
{
conf_error = 0;
feature_unmark(); /* unmark all features for resetting later */
+ clear_nameservers(); /* clear previous list of DNS servers */
/* Now just open an fd. The buffering isn't really needed... */
init_lexer();
yyparse();
class_mark_delete();
mark_listeners_closing();
- iauth_mark_closing();
+ auth_mark_closing();
close_mappings();
read_configuration_file();
log_reopen(); /* reopen log files */
- iauth_close_unused();
+ auth_close_unused();
close_listeners();
class_delete_marked(); /* unless it fails */