#include <string.h>
#include <stdarg.h>
#include <stdio.h>
+#include <inttypes.h>
MODULE_VERSION("");
if (IsAccount(np)) {
if (np->auth) {
if(np->auth->flags) {
- snprintf(accountbuf,sizeof(accountbuf)," %s:%ld:%lu:%llu",np->authname,np->accountts,np->auth->userid,np->auth->flags);
+ snprintf(accountbuf,sizeof(accountbuf)," %s:%ld:%lu:%"PRIu64,np->authname,np->accountts,np->auth->userid,np->auth->flags);
} else {
snprintf(accountbuf,sizeof(accountbuf)," %s:%ld:%lu",np->authname,np->accountts,np->auth->userid);
}
if (connected) {
if (np->auth) {
if (np->auth->flags) {
- irc_send("%s AC %s %s %ld %lu %llu",mynumeric->content, longtonumeric(np->numeric,5), np->authname, np->accountts, np->auth->userid, np->auth->flags);
+ irc_send("%s AC %s %s %ld %lu %"PRIu64,mynumeric->content, longtonumeric(np->numeric,5), np->authname, np->accountts, np->auth->userid, np->auth->flags);
} else {
irc_send("%s AC %s %s %ld %lu",mynumeric->content, longtonumeric(np->numeric,5), np->authname, np->accountts, np->auth->userid);
}
for(i=0;i<NICKHASHSIZE;i++) {
for(np=nicktable[i];np;np=np->next) {
- if(np && np->authname && !ircd_strcmp(np->authname, acc)) {
+ if(np && np->authname[0] && !ircd_strcmp(np->authname, acc)) {
lua_pushnumeric(l, np->numeric);
found++;
}
#define PUSHER_REALUSERS 11
#define PUSHER_CHANMODES 12
#define PUSHER_TIMESTAMP 13
+#define PUSHER_STRING_INDIRECT 14
void lua_initnickpusher(void) {
int i = 0;
PUSH_NICKPUSHER(PUSHER_STRING, ident);
PUSH_NICKPUSHER(PUSHER_HOSTNAME, host);
PUSH_NICKPUSHER(PUSHER_REALNAME, realname);
- PUSH_NICKPUSHER(PUSHER_STRING, authname);
+ PUSH_NICKPUSHER(PUSHER_STRING_INDIRECT, authname);
PUSH_NICKPUSHER(PUSHER_IP, ipnode);
PUSH_NICKPUSHER(PUSHER_LONG, numeric);
PUSH_NICKPUSHER(PUSHER_LONG, timestamp);
case PUSHER_STRING:
lua_pushstring(l, (char *)offset);
break;
+ case PUSHER_STRING_INDIRECT:
+ lua_pushstring(l, *(char **)offset);
+ break;
case PUSHER_HOSTNAME:
lua_pushstring(l, (*(host **)offset)->name->content);
break;
#include <netdb.h>
#include <string.h>
#include <strings.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
#include "../lib/sstring.h"
#include "../lib/irc_string.h"
}
if(!item) {
- /* Someone needs to figure out how to print the IP :) */
- nterface_log(nrl, NL_INFO, "Unauthorised connection closed");
+ nterface_log(nrl, NL_INFO, "Unauthorised connection from %s closed", inet_ntoa(sin.sin_addr));
close(newfd);
return;
}