#include "hash.h"
#include "ircd.h"
#include "ircd_alloc.h"
+#include "ircd_auth.h"
#include "ircd_chattr.h"
#include "ircd_features.h"
#include "ircd_log.h"
short digitgroups = 0;
struct User* user = cli_user(sptr);
int killreason;
- char ip_base64[8];
+ char ip_base64[25];
user->last = CurrentTime;
parv[0] = cli_name(sptr);
static time_t last_too_many2;
assert(cptr == sptr);
+ if (!IsIAuthed(sptr)) {
+ if (iauth_active)
+ return iauth_start_client(iauth_active, sptr);
+ else
+ SetIAuthed(sptr);
+ }
switch (conf_check_client(sptr))
{
case ACR_OK:
get_client_name(sptr, SHOW_IP));
}
++ServerStats->is_ref;
- IPcheck_connect_fail(cli_ip(sptr));
+ IPcheck_connect_fail(&cli_ip(sptr));
return exit_client(cptr, sptr, &me,
"Sorry, your connection class is full - try "
"again later or try another server");
/* Can this ever happen? */
case ACR_BAD_SOCKET:
++ServerStats->is_ref;
- IPcheck_connect_fail(cli_ip(sptr));
+ IPcheck_connect_fail(&cli_ip(sptr));
return exit_client(cptr, sptr, &me, "Unknown error -- Try again");
}
ircd_strncpy(user->host, cli_sockhost(sptr), HOSTLEN);
if (MyConnect(sptr)) {
cli_handler(sptr) = CLIENT_HANDLER;
release_dns_reply(sptr);
-
+ SetLocalNumNick(sptr);
send_reply(sptr,
RPL_WELCOME,
feature_str(FEAT_NETWORK),
set_snomask(sptr, cli_snomask(sptr) & SNO_NOISY, SNO_ADD);
if (feature_bool(FEAT_CONNEXIT_NOTICES))
sendto_opmask_butone(0, SNO_CONNEXIT,
- "Client connecting: %s (%s@%s) [%s] {%d} [%s] <%s%s>",
+ "Client connecting: %s (%s@%s) [%s] {%s} [%s] <%s%s>",
cli_name(sptr), user->username, user->host,
cli_sock_ip(sptr), get_client_class(sptr),
cli_info(sptr), NumNick(cptr) /* two %s's */);
nick, cli_hopcount(sptr) + 1, cli_lastnick(sptr),
user->username, user->realhost,
*tmpstr ? "+" : "", tmpstr, *tmpstr ? " " : "",
- inttobase64(ip_base64, ntohl(cli_ip(sptr).s_addr), 6),
+ iptobase64(ip_base64, &cli_ip(sptr), sizeof(ip_base64)),
NumNick(sptr), cli_info(sptr));
-
+
/* Send server notice mask to client */
if (MyUser(sptr) && (cli_snomask(sptr) != SNO_DEFAULT) && HasFlag(sptr, FLAG_SERVNOTICE))
send_reply(sptr, RPL_SNOMASK, cli_snomask(sptr), cli_snomask(sptr));
/*
* IP# of remote client
*/
- cli_ip(new_client).s_addr = htonl(base64toint(parv[parc - 3]));
+ base64toip(parv[parc - 3], &cli_ip(new_client));
add_client_to_list(new_client);
hAddClient(new_client);
cli_user(sptr) = make_user(sptr);
cli_user(sptr)->server = &me;
}
- SetLocalNumNick(sptr);
hAddClient(sptr);
/*
&& (chan->channel->mode.mode & MODE_DELJOINS))
SetDelayedJoin(chan);
else
- sendcmdto_channel_butserv_butone(cptr, CMD_JOIN, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(cptr, CMD_JOIN, chan->channel, cptr, 0,
"%H", chan->channel);
if (IsChanOp(chan) && HasVoice(chan))
- sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
"%H +ov %C %C", chan->channel, cptr,
cptr);
else if (IsChanOp(chan) || HasVoice(chan))
- sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr,
+ sendcmdto_channel_butserv_butone(&me, CMD_MODE, chan->channel, cptr, 0,
"%H +%c %C", chan->channel, IsChanOp(chan) ? 'o' : 'v', cptr);
}
return 0;
ircd_snprintf(0, sender, sizeof(sender), "%s!%s@%s", cli_name(sptr),
user->username, user->host);
ircd_snprintf(0, senderip, sizeof(senderip), "%s!%s@%s", cli_name(sptr),
- user->username, ircd_ntoa((const char*) &(cli_ip(sptr))));
+ user->username, ircd_ntoa(&cli_ip(sptr)));
if (HasHiddenHost(sptr))
ircd_snprintf(0, senderh, sizeof(senderh), "%s!%s@%s", cli_name(sptr),
user->username, user->realhost);