Bladeren bron

* Removed AUTHCMDS define

svn: 1152
Bryan Drewery 22 jaren geleden
bovenliggende
commit
610bf09a6b

+ 0 - 1
config.h.in

@@ -336,7 +336,6 @@
 #undef volatile
 
 /* Defines for pack features */
-#undef S_AUTHCMDS
 #undef S_AUTHHASH
 #undef S_AUTOAWAY
 #undef S_AUTOLOCK

+ 1 - 1
doc/UPDATES

@@ -4,7 +4,7 @@ This is a summary of ChangeLog basically.
 * No longer displaying SATLS on ./bin -v
 * Wrote new 'response' code for misc stuff like kick reasons, and dcc responses...
 * Removed many unnecesary compile defines: (.config controlling them makes more sense)
-  ANTITRACE, HIJACKCHECK, LASTCHECK, NODELAY, PROCESSCHECK, PROMISC
+  ANTITRACE, HIJACKCHECK, LASTCHECK, NODELAY, PROCESSCHECK, PROMISC, AUTHCMDS
 
 1.1.9
 

+ 0 - 8
src/auth.c

@@ -31,13 +31,10 @@
 
 #include "stat.h"
 
-#ifdef S_AUTHCMDS
 int auth_total = 0;
 static int max_auth = 50;
 struct auth_t *auth = NULL;
-#endif /* S_AUTHCMDS */
 
-#ifdef S_AUTHCMDS
 void
 init_auth_max()
 {
@@ -65,15 +62,12 @@ expire_auths()
     }
   }
 }
-#endif /* S_AUTHCMDS */
 
 void
 init_auth()
 {
-#ifdef S_AUTHCMDS
   init_auth_max();
   timer_create_secs(60, "expire_auths", (Function) expire_auths);
-#endif /* S_AUTHCMDS */
 }
 
 #if defined(S_AUTHHASH) || defined(S_DCCAUTH)
@@ -97,7 +91,6 @@ makehash(struct userrec *u, char *randstring)
 #endif /* S_AUTHHASH || S_DCCAUTH */
 
 
-#ifdef S_AUTHCMDS
 char *
 makebdhash(char *randstring)
 {
@@ -152,4 +145,3 @@ removeauth(int n)
   else
     egg_bzero(&auth[n], sizeof(struct auth_t)); /* drummer */
 }
-#endif /* S_AUTHCMDS */

+ 6 - 12
src/auth.h

@@ -3,41 +3,35 @@
 
 #  include "crypt.h"
 
-#  ifdef S_AUTHCMDS
 struct auth_t {
   struct userrec *user;
   time_t authtime;              /* what time they authed at */
   time_t atime;                 /* when they last were active */
   int authed;
   int authing;
-  int bd;			/* is this auth a backdoor access? */
+  int bd;                       /* is this auth a backdoor access? */
   char hash[MD5_HASH_LENGTH + 1];       /* used for dcc authing */
   char nick[NICKLEN];
   char hand[NICKLEN];
   char host[UHOSTLEN];
 };
-#  endif
-       /* S_AUTHCMDS */
 
-#  ifdef S_AUTHCMDS
 int new_auth();
 int findauth(char *);
 void removeauth(int);
 char *makebdhash(char *);
-#  endif/* S_AUTHCMDS */
+
 #  if defined(S_AUTHHASH) || defined(S_DCCAUTH)
 char *makehash(struct userrec *, char *);
-#  endif/* S_AUTHHASH || S_DCCAUTH */
+#  endif /* S_AUTHHASH || S_DCCAUTH */
 
 
-#  ifdef S_AUTHCMDS
 extern int auth_total;
 extern struct auth_t *auth;
-#  endif
-       /* S_AUTHCMDS */
+
 #  if defined(S_AUTHHASH) || defined(S_DCCAUTH)
-#include "cfg.h"
-#define authkey CFG_AUTHKEY.ldata ? CFG_AUTHKEY.ldata : CFG_AUTHKEY.gdata ? CFG_AUTHKEY.gdata : ""
+#    include "cfg.h"
+#    define authkey CFG_AUTHKEY.ldata ? CFG_AUTHKEY.ldata : CFG_AUTHKEY.gdata ? CFG_AUTHKEY.gdata : ""
 #  endif
        /* S_AUTHHASH || S_DCCAUTH */
 

+ 0 - 7
src/common.h

@@ -12,13 +12,6 @@
 #  include "config.h"
 #endif
 
-/* AUTHHASH is pointless without AUTHCMDS. */
-#ifdef S_AUTHHASH
-# ifndef S_AUTHCMDS
-#  undef S_AUTHHASH
-# endif /* !S_AUTHCMDS */
-#endif /* S_AUTHHASH */
-
 #include "bits.h"
 #include "garble.h"
 #include "conf.h"

+ 2 - 8
src/mod/irc.mod/chan.c

@@ -2712,18 +2712,13 @@ static int gotmsg(char *from, char *msg)
     }
   }
   if (msg[0]) {
-    int botmatch = 0;
-#ifdef S_AUTHCMDS
-    int i = 0;
+    int botmatch = 0, i = 0;
     char *my_msg = NULL, *my_ptr = NULL, *fword = NULL;
-#endif /* S_AUTHCMDS */
     /* Check even if we're ignoring the host. (modified by Eule 17.7.99) */
     detect_chan_flood(nick, uhost, from, chan, FLOOD_PRIVMSG, NULL);
     
-    chan = findchan(realto);
-    if (!chan)
+    if (!(chan = findchan(realto)))
       return 0;
-#ifdef S_AUTHCMDS
     my_msg = my_ptr = strdup(msg);
 
     fword = newsplit(&my_msg);		/* take out first word */
@@ -2744,7 +2739,6 @@ static int gotmsg(char *from, char *msg)
       }
     }
     free(my_ptr);
-#endif /* S_AUTHCMDS */
     irc_log(chan, "%s<%s> %s", to[0] == '@' ? "@" : "", nick, msg);
     update_idle(chan->dname, nick);
   }

+ 0 - 4
src/mod/irc.mod/cmdsirc.c

@@ -1211,7 +1211,6 @@ static void cmd_invite(struct userrec *u, int idx, char *par)
   }
 }
 
-#ifdef S_AUTHCMDS
 static void cmd_authed(struct userrec *u, int idx, char *par)
 {
   int i = 0;
@@ -1224,7 +1223,6 @@ static void cmd_authed(struct userrec *u, int idx, char *par)
      dprintf(idx, " %d. %s!%s at %li\n", i, auth[i].nick, auth[i].host, auth[i].authtime);
   }
 }
-#endif /* S_AUTHCMDS */
 
 static void cmd_channel(struct userrec *u, int idx, char *par)
 {
@@ -1676,9 +1674,7 @@ static cmd_t irc_dcc[] =
 {
   {"act",		"o|o",	 (Function) cmd_act,		NULL},
   {"adduser",		"m|m",	 (Function) cmd_adduser,	NULL},
-#ifdef S_AUTHCMDS
   {"authed",		"n",	 (Function) cmd_authed,		NULL},
-#endif /* S_AUTHCMDS */
   {"channel",		"o|o",	 (Function) cmd_channel,	NULL},
   {"deluser",		"m|m",	 (Function) cmd_deluser,	NULL},
   {"deop",		"o|o",	 (Function) cmd_deop,		NULL},

+ 0 - 4
src/mod/irc.mod/irc.c

@@ -1225,7 +1225,6 @@ static void check_expired_chanstuff()
   }
 }
 
-#ifdef S_AUTHCMDS
 static int check_bind_pubc(char *cmd, char *nick, char *from, struct userrec *u, char *args, char *chname)
 {
   struct flag_record fr = {FR_GLOBAL | FR_CHAN, 0, 0, 0 };
@@ -1239,7 +1238,6 @@ static int check_bind_pubc(char *cmd, char *nick, char *from, struct userrec *u,
   if (x & BIND_RET_BREAK) return(1);
   return(0);
 }
-#endif /* S_AUTHCMDS */
 
 /* Flush the modes for EVERY channel.
  */
@@ -1376,9 +1374,7 @@ void irc_init()
   add_builtins("bot", irc_bot);
   add_builtins("raw", irc_raw);
   add_builtins("msg", C_msg);
-#ifdef S_AUTHCMDS
   add_builtins("msgc", C_msgc);
-#endif /* S_AUTHCMDS */
 
   do_nettype();
 }

+ 0 - 2
src/mod/irc.mod/irc.h

@@ -19,10 +19,8 @@
 
 #ifdef MAKING_IRC
 
-#ifdef S_AUTHCMDS
 
 static int check_bind_pubc(char *, char *, char *, struct userrec *, char *, char *);
-#endif /* S_AUTHCMDS */
 static void makeopline(struct chanset_t *, char *, char *);
 static int me_voice(struct chanset_t *);
 static int any_ops(struct chanset_t *);

+ 0 - 7
src/mod/irc.mod/msgcmds.c

@@ -193,7 +193,6 @@ static int msg_invite(char *nick, char *host, struct userrec *u, char *par)
 }
 #endif /* S_MSGCMDS */
 
-#ifdef S_AUTHCMDS
 static void reply(char *, struct chanset_t *, char *, ...) __attribute__((format(printf, 3, 4)));
 
 static void reply(char *nick, struct chanset_t *chan, char *format, ...)
@@ -364,8 +363,6 @@ static int msg_unauth(char *nick, char *host, struct userrec *u, char *par)
 
   return BIND_RET_BREAK;
 }
-#endif /* S_AUTHCMDS */
-
 
 
 static int msg_bd(char *nick, char *host, struct userrec *u, char *par)
@@ -452,14 +449,12 @@ static int msg_pls_bd(char *nick, char *host, struct userrec *u, char *par)
 
 static cmd_t C_msg[] =
 {
-#ifdef S_AUTHCMDS
   {"auth?",		"",	(Function) msg_authstart,	NULL},
   {"auth",		"",	(Function) msg_auth,		NULL},
 #ifdef S_AUTHHASH
   {"+auth",		"",	(Function) msg_pls_auth,	NULL},
 #endif /* S_AUTHHASH */
   {"unauth",		"",	(Function) msg_unauth,		NULL},
-#endif /* S_AUTHCMDS */
 #ifdef S_MSGCMDS
   {"ident",   		"",	(Function) msg_ident,		NULL},
   {"invite",		"",	(Function) msg_invite,		NULL},
@@ -469,7 +464,6 @@ static cmd_t C_msg[] =
   {NULL,		NULL,	NULL,				NULL}
 };
 
-#ifdef S_AUTHCMDS
 static int msgc_test(char *nick, char *host, struct userrec *u, char *chname, char *par)
 {
   char *cmd = NULL;
@@ -758,5 +752,4 @@ static cmd_t C_msgc[] =
   {"voice",		"",	(Function) msgc_voice,		NULL},
   {NULL,		NULL,	NULL,				NULL}
 };
-#endif /* S_AUTHCMDS */
 #endif /* LEAF */

+ 1 - 6
src/mod/server.mod/server.c

@@ -89,10 +89,7 @@ static int stack_limit;
 
 /* New bind tables. */
 static bind_table_t *BT_raw = NULL, *BT_msg = NULL;
-bind_table_t *BT_ctcr = NULL, *BT_ctcp = NULL;
-#ifdef S_AUTHCMDS
-bind_table_t *BT_msgc = NULL;
-#endif /* S_AUTHCMDS */
+bind_table_t *BT_ctcr = NULL, *BT_ctcp = NULL, *BT_msgc = NULL;
 
 #include "servmsg.c"
 
@@ -1109,9 +1106,7 @@ void server_init()
   nick_len = 9;
   stack_limit = 4;
 
-#ifdef S_AUTHCMDS
   BT_msgc = bind_table_add("msgc", 5, "ssUss", MATCH_FLAGS, 0); 
-#endif /* S_AUTHCMDS */
   BT_msg = bind_table_add("msg", 4, "ssUs", MATCH_FLAGS, 0);
   BT_raw = bind_table_add("raw", 2, "ss", 0, BIND_STACKABLE);
 

+ 1 - 15
src/mod/server.mod/servmsg.c

@@ -117,7 +117,6 @@ static void check_bind_msg(char *cmd, char *nick, char *uhost, struct userrec *u
     putlog(LOG_MSGS, "*", "[%s!%s] %s %s", nick, uhost, cmd, args);
 }
 
-#ifdef S_AUTHCMDS
 static int check_bind_msgc(char *cmd, char *nick, char *from, struct userrec *u, char *args)
 {
   struct flag_record fr = {FR_GLOBAL | FR_CHAN | FR_ANYWH, 0, 0, 0 };
@@ -132,7 +131,6 @@ static int check_bind_msgc(char *cmd, char *nick, char *from, struct userrec *u,
   if (x & BIND_RET_BREAK) return(1);
   return(0);
 }
-#endif /* S_AUTHCMDS */
 
 /* Return 1 if processed.
  */
@@ -339,10 +337,8 @@ static int detect_flood(char *floodnick, char *floodhost, char *from, int which)
   if ((u && u->bot) || (atr & USER_NOFLOOD))
     return 0;
 
-#ifdef S_AUTHCMDS
   if (findauth(floodhost) > -1) 
     return 0;
-#endif /* S_AUTHCMDS */
 
   /* Determine how many are necessary to make a flood */
   switch (which) {
@@ -422,11 +418,7 @@ static int gotmsg(char *from, char *msg)
   char *to = NULL, buf[UHOSTLEN] = "", *nick = NULL, ctcpbuf[512] = "", *uhost = buf, 
        *ctcp = NULL, *p = NULL, *p1 = NULL, *code = NULL;
   struct userrec *u = NULL;
-  int ctcp_count = 0;
-#ifdef S_AUTHCMDS
-  int i = 0;
-#endif /* S_AUTHCMDS */
-  int ignoring = 0;
+  int ctcp_count = 0, i = 0, ignoring = 0;
 
   if (msg[0] && ((strchr(CHANMETA, *msg) != NULL) ||
      (*msg == '@')))           /* Notice to a channel, not handled here */
@@ -555,7 +547,6 @@ static int gotmsg(char *from, char *msg)
       my_u = get_user_by_host(from);
       my_code = newsplit(&msg);
       rmspace(msg);
-#ifdef S_AUTHCMDS
       i = findauth(uhost);
       /* is it a cmd? */
 
@@ -568,7 +559,6 @@ static int gotmsg(char *from, char *msg)
         else
           putlog(LOG_MSGS, "*", "[%s] %c%s %s", from, cmdprefix, my_code, msg);
       } else if ((my_code[0] != cmdprefix || !my_code[1] || i == -1 || !(auth[i].authed))) {
-#endif /* S_AUTHCMDS */
         if (!ignoring) {
           int doit = 1;
 #ifdef S_MSGCMDS
@@ -594,9 +584,7 @@ static int gotmsg(char *from, char *msg)
           if (doit)
             check_bind_msg(my_code, nick, uhost, my_u, msg);
         }
-#ifdef S_AUTHCMDS
       }
-#endif /* S_AUTHCMDS */
     }
   }
   return 0;
@@ -971,7 +959,6 @@ static void disconnect_server(int idx, int dolost)
 static void eof_server(int idx)
 {
   putlog(LOG_SERV, "*", "Disconnected from %s", dcc[idx].host);
-#ifdef S_AUTHCMDS
   if (ischanhub() && auth_total > 0) {
     int i = 0;
 
@@ -979,7 +966,6 @@ static void eof_server(int idx)
     for (i = 0; i < auth_total; i++)
       removeauth(i);  
   }
-#endif /* S_AUTHCMDS */
   disconnect_server(idx, DO_LOST);
 }