]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Merge.
authorChris Porter <redacted>
Thu, 14 Aug 2008 22:42:44 +0000 (23:42 +0100)
committerChris Porter <redacted>
Thu, 14 Aug 2008 22:42:44 +0000 (23:42 +0100)
localuser/localuser.c
lua/luacommands.c
nterfacer/nterfacer.c

index f5684fdf45d48789fd3b2d2d76676fa26757ff00..a0be41b988ff37df991056d3039694c1e2fe4344 100644 (file)
@@ -13,6 +13,7 @@
 #include <string.h>
 #include <stdarg.h>
 #include <stdio.h>
+#include <inttypes.h>
 
 MODULE_VERSION("");
 
@@ -287,7 +288,7 @@ void sendnickmsg(nick *np) {
   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);
       }
@@ -564,7 +565,7 @@ void sendaccountmessage(nick *np) {
   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);
       }
index 79a8277a6d5576570a1adb1a9e08bb8ca002ac45..fd00c922e6a98b7769a40a2a6ee47cbdf921f5bc 100644 (file)
@@ -381,7 +381,7 @@ static int lua_getuserbyauth(lua_State *l) {
 
   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++;
       }
@@ -940,6 +940,7 @@ static int lua_skill(lua_State *ps) {
 #define PUSHER_REALUSERS 11
 #define PUSHER_CHANMODES 12
 #define PUSHER_TIMESTAMP 13
+#define PUSHER_STRING_INDIRECT 14
 
 void lua_initnickpusher(void) {
   int i = 0;
@@ -951,7 +952,7 @@ void lua_initnickpusher(void) {
   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);
@@ -1002,6 +1003,9 @@ INLINE int lua_usepusher(lua_State *l, struct lua_pusher **lp, void *np) {
       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;
index 604de3ca7fcc25c1617937c14059bccae98b7573..70e9ed411d8811741a7dbc4efafa2bbd5a3a61c5 100644 (file)
@@ -15,6 +15,8 @@
 #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"
@@ -363,8 +365,7 @@ void nterfacer_accept_event(struct esocket *socket) {
   }
 
   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;
   }