Просмотр исходного кода

* Remove a bunch of old, unused code

Bryan Drewery 17 лет назад
Родитель
Сommit
4a7cf2f248
19 измененных файлов с 6 добавлено и 618 удалено
  1. 3 36
      src/auth.c
  2. 2 5
      src/auth.h
  3. 0 59
      src/bg.c
  4. 0 26
      src/botnet.c
  5. 0 7
      src/conf.c
  6. 0 110
      src/debug.c
  7. 0 4
      src/debug.h
  8. 0 75
      src/enclink.c
  9. 1 1
      src/log.c
  10. 0 17
      src/main.c
  11. 0 14
      src/misc.c
  12. 0 10
      src/mod/channels.mod/tclchan.c
  13. 0 6
      src/mod/irc.mod/irc.c
  14. 0 56
      src/mod/irc.mod/msgcmds.c
  15. 0 22
      src/mod/update.mod/update.c
  16. 0 17
      src/set.c
  17. 0 104
      src/shell.c
  18. 0 3
      src/shell.h
  19. 0 46
      src/tclhash.c

+ 3 - 36
src/auth.c

@@ -40,10 +40,6 @@
 
 hash_table_t *Auth::ht_handle = NULL, *Auth::ht_host = NULL;
 
-#ifdef no
-static const char* makebdhash(char *);
-#endif
-
 Auth::Auth(const char *_nick, const char *_host, struct userrec *u)
 {
   Status(AUTHING);
@@ -69,9 +65,6 @@ Auth::Auth(const char *_nick, const char *_host, struct userrec *u)
 
   sdprintf(STR("New auth created! (%s!%s) [%s]"), nick, host, handle);
   authtime = atime = now;
-#ifdef NOTUSED
-  bd = 0;
-#endif
   idx = -1;
 }
 
@@ -83,25 +76,17 @@ Auth::~Auth()
   hash_table_remove(ht_host, host, this);
 }
 
-void Auth::MakeHash(bool bd)
+void Auth::MakeHash()
 {
  make_rand_str(rand, 50);
-#ifdef NOTUSED
- if (bd)
-   strlcpy(hash, makebdhash(rand), sizeof hash);
- else
-#endif
-   makehash(user, rand, hash, 50);
+ makehash(user, rand, hash, 50);
 }
 
-void Auth::Done(bool _bd)
+void Auth::Done()
 {
   hash[0] = 0;
   rand[0] = 0;
   Status(AUTHED);
-#ifdef NOTUSED
-  bd = _bd;
-#endif
 }
 
 void Auth::NewNick(const char *newnick) {
@@ -268,7 +253,6 @@ static int auth_tell_walk(const void *key, void *data, void *param)
   long lparam = (long) param;
   int idx = (int) lparam;
 
-//  dprintf(idx, "%s(%s!%s) [%s] authtime: %li, atime: %li, Status: %d\n", auth->bd ? "x " : "", auth->nick, 
   dprintf(idx, "(%s!%s) [%s] authtime: %li, atime: %li, Status: %d\n", auth->nick, 
         auth->host, auth->handle, (long)auth->authtime, (long)auth->atime, auth->Status());
   
@@ -296,23 +280,6 @@ void makehash(struct userrec *u, const char *randstring, char *out, size_t out_s
   OPENSSL_cleanse(hash, sizeof(hash));
 }
 
-#ifdef no
-/* This isn't even used */
-const char*
-makebdhash(char *randstring)
-{
-  char hash[70] = "";
-  const char *bdpass = STR("bdpass");
-
-  simple_snprintf(hash, sizeof hash, "%s%s%s", randstring, bdpass, settings.packname);
-  sdprintf(STR("bdhash: %s"), hash);
-
-  const char* md5 = MD5(hash);
-  OPENSSL_cleanse(hash, sizeof(hash));
-  return md5;
-}
-#endif
-
 void check_auth_dcc(Auth *auth, const char *cmd, const char *par)
 {
   real_check_bind_dcc(cmd, auth->idx, par, auth);

+ 2 - 5
src/auth.h

@@ -17,10 +17,10 @@ class Auth {
   ~Auth();
 
   int Status(int newstat = -1) { if (newstat >= 0) { status = newstat; } return status; }
-  void MakeHash(bool bd = 0);
+  void MakeHash();
   bool Authed() { return (status == AUTHED); }
   bool GetIdx(const char *);
-  void Done(bool = 0);
+  void Done();
   void NewNick(const char *nick);
 
   static Auth *Find(const char * host);
@@ -35,9 +35,6 @@ class Auth {
   struct userrec *user;
   time_t authtime;              /* what time they authed at */
   time_t atime;                 /* when they last were active */
-#ifdef NOTUSED
-  int bd;                       /* is this auth a backdoor access? */
-#endif
   int idx;			/* do they have an associated idx? */
   char hash[MD5_HASH_LENGTH + 1];       /* used for dcc authing */
   char rand[51];

+ 0 - 59
src/bg.c

@@ -47,14 +47,6 @@
 
 time_t lastfork = 0;
 
-#if !defined(CYGWIN_HACKS) && !defined(__sun__)
-#ifdef NO
-pid_t watcher;                  /* my child/watcher */
-
-static void init_watcher(pid_t);
-#endif
-#endif /* !CYGWIN_HACKS */
-
 int close_tty()
 {
   int fd = -1;
@@ -103,12 +95,6 @@ do_fork()
 
   writepid(conf.bot->pid_file, pid);
   lastfork = now;
-#if !defined(CYGWIN_HACKS) && !defined(__sun__)
-#ifdef NO
-  if (conf.watcher)
-    init_watcher(pid);
-#endif
-#endif /* !CYGWIN_HACKS */
   return pid;
 }
 
@@ -134,48 +120,3 @@ writepid(const char *pidfile, pid_t pid)
   } else
     printf("* Warning!  Could not write %s file!\n", pidfile);
 }
-
-#if !defined(CYGWIN_HACKS) && !defined(__sun__)
-#ifdef NO
-static void
-init_watcher(pid_t parent)
-{
-  int x = fork();
-
-  if (x == -1)
-    fatal("Could not fork off a watcher process", 0);
-  if (x != 0) {                 /* parent [bot] */
-    watcher = x;
-    /* printf("WATCHER: %d\n", watcher); */
-    return;
-  } else {                      /* child [watcher] */
-    watcher = getpid();
-    /* printf("MY PARENT: %d\n", parent); */
-    /* printf("my pid: %d\n", watcher); */
-    if (ptrace(PT_ATTACH, parent, 0, 0) == -1)
-      fatal("Cannot attach to parent", 0);
-
-    while (1) {
-      int status = 0, sig = 0, ret = 0;
-
-      waitpid(parent, &status, 0);
-      sig = WSTOPSIG(status);
-      if (sig) {
-        ret = ptrace(PT_CONTINUE, parent, (char *) 1, sig);
-        if (ret == -1)          /* send the signal! */
-          fatal("Could not send signal to parent", 0);
-        /* printf("Sent signal %s (%d) to parent\n", strsignal(sig), sig); */
-      } else {
-        ret = ptrace(PT_CONTINUE, parent, (char *) 1, 0);
-        if (ret == -1) {
-          if (errno == ESRCH)   /* parent is gone! */
-            exit(0);            /* just exit */
-          else
-            fatal("Could not continue parent", 0);
-        }
-      }
-    }
-  }
-}
-#endif
-#endif /* !CYGWIN_HACKS */

+ 0 - 26
src/botnet.c

@@ -367,32 +367,6 @@ void unvia(int idx, tand_t *who)
   }
 }
 
-#ifdef NOTUSED
-void besthub(char *hub)
-{
-  tand_t *ptr = tandbot;
-  struct userrec *u = NULL, *besthubu = NULL;
-  char bestlval[HANDLEN + 4] = "", lval[HANDLEN + 4] = "";
-
-  hub[0] = 0;
-  strlcpy(bestlval, "z", sizeof(bestlval));
-  while (ptr) {
-    u = get_user_by_handle(userlist, ptr->bot);
-    if (u) {
-      link_pref_val(u, lval);
-      if (strcmp(lval, bestlval) < 0) {
-        strlcpy(bestlval, lval, sizeof(bestlval));
-        besthubu = u;
-      }
-    }
-    ptr = ptr->next;
-  }
-  if (besthubu)
-    strcpy(hub, besthubu->handle);
-  return;
-}
-#endif
-
 /* Return index into dcc list of the bot that connects us to bot <x>
  */
 int nextbot(const char *who)

+ 0 - 7
src/conf.c

@@ -949,13 +949,6 @@ writeconf(char *filename, FILE * stream, int bits)
     comment("");
   }
 
-#ifdef NO
-  comment("# This will spawn a child process for EACH BOT that will block ALL process hijackers.");
-  my_write(f, STR("! watcher %d\n"), conf.watcher);
-
-  comment("");
-#endif
-
   comment("# '|' means OR, [] means the enclosed is optional");
   comment("# A '+' in front of HOST means the HOST is ipv6");
   comment("# A '/' in front of BOT will disable that bot.");

+ 0 - 110
src/debug.c

@@ -135,116 +135,6 @@ void sdprintf (const char *format, ...)
 #endif
 }
 
-#ifdef NOTUSED
-char* hexize(const unsigned char* data, size_t len) {
-  static char buffers[5][513] = { "", "", "", "", "" };
-  static int n = 0;
-  char *buf = buffers[n++];
-
-  buf[0] = 0;
-
-  for (size_t i = 0; i < len; ++i) {
-    if (i == 0)
-      sprintf(buf, "%.2X", (int) (data[i]));
-    else
-      sprintf(buf, "%s %.2X", buf, (int) (data[i]));
-  }
-
-  buf[len * 3] = 0;
-
-  if (n == 5) n = 0;
-  return buf;
-}
-#endif
-
-void printstr(unsigned char *str, int len)
-{
-#ifdef no
-        static char *outstr;
-        int i, n, c, usehex;
-        char *s, *outend;
-	int max_strlen = 64;
-        int xflag = 0;
-
-        outstr = (char *) my_calloc(1, 2 * max_strlen);
-        outend = outstr + max_strlen * 2 - 10;
-
-        n = (((max_strlen) < (len)) ? (max_strlen) : (len));
-        usehex = 0;
-        if (xflag > 1)
-                usehex = 1;
-        else if (xflag) {
-                for (i = 0; i < n; i++) {
-                        c = str[i];
-                        if (len < 0 && c == '\0')
-                                break;
-                        if (!isprint(c) && !egg_isspace(c)) {
-                                usehex = 1;
-                                break;
-                        }
-                }
-        }
-
-        s = outstr;
-        *s++ = '\"';
-
-        if (usehex) {
-                for (i = 0; i < n; i++) {
-                        c = str[i];
-                        if (len < 0 && c == '\0')
-                                break;
-                        sprintf(s, "\\x%02x", c);
-                        s += 4;
-                        if (s > outend)
-                                break;
-                }
-        }
-        else {
-                for (i = 0; i < n; i++) {
-                        c = str[i];
-                        if (len < 0 && c == '\0')
-                                break;
-                        switch (c) {
-                        case '\"': case '\'': case '\\':
-                                *s++ = '\\'; *s++ = c; break;
-                        case '\f':
-                                *s++ = '\\'; *s++ = 'f'; break;
-                        case '\n':
-                                *s++ = '\\'; *s++ = 'n'; break;
-                        case '\r':
-                                *s++ = '\\'; *s++ = 'r'; break;
-                        case '\t':
-                                *s++ = '\\'; *s++ = 't'; break;
-                        case '\v':
-                                *s++ = '\\'; *s++ = 'v'; break;
-                        default:
-                                if (egg_isprint(c))
-                                        *s++ = c;
-                                else if (i < n - 1 && egg_isdigit(str[i + 1])) {
-                                        sprintf(s, "\\%03o", c);
-                                        s += 4;
-                                }
-                                else {
-                                        sprintf(s, "\\%o", c);
-                                        s += strlen(s);
-                                }
-                                break;
-                        }
-                        if (s > outend)
-                                break;
-                }
-        }
-
-        *s++ = '\"';
-        if (i < len || (len < 0 && (i == n || s > outend))) {
-                *s++ = '.'; *s++ = '.'; *s++ = '.';
-        }
-        *s = '\0';
-
-        printf("%s\n", outstr);
-#endif
-}
-
 #ifdef DEBUG_CONTEXT
 
 #define CX(ptr) cx_file[ptr] && cx_file[ptr][0] ? cx_file[ptr] : "", cx_line[ptr], cx_note[ptr] && cx_note[ptr][0] ? cx_note[ptr] : ""

+ 0 - 4
src/debug.h

@@ -39,8 +39,4 @@ void init_signals();
 void init_debug();
 void eggContext(const char *, int);
 void eggContextNote(const char *, int, const char *);
-void printstr(unsigned char *, int);
-#ifdef NOTUSED
-char* hexize(const unsigned char*, size_t);
-#endif
 #endif /* !_DEBUG_H */

+ 0 - 75
src/enclink.c

@@ -208,81 +208,6 @@ void ghost_parse(int idx, int snum, char *buf)
   }
 }
 
-#ifdef no
-static int binary_read(int snum, char *src, size_t *len)
-{
-  char *line = NULL;
-
-  line = decrypt_binary(socklist[snum].ikey, (unsigned char *) src, len);
-  strlcpy(src, line, SGRAB + 10);
-  free(line);
-  if (socklist[snum].iseed) {
-    *(dword *) & socklist[snum].ikey[0] = prand(&socklist[snum].iseed, 0xFFFFFFFF);
-    *(dword *) & socklist[snum].ikey[4] = prand(&socklist[snum].iseed, 0xFFFFFFFF);
-    *(dword *) & socklist[snum].ikey[8] = prand(&socklist[snum].iseed, 0xFFFFFFFF);
-    *(dword *) & socklist[snum].ikey[12] = prand(&socklist[snum].iseed, 0xFFFFFFFF);
-
-    if (!socklist[snum].iseed)
-      socklist[snum].iseed++;
-  }
-//  *len = strlen(src);
-  return OK;
-}
-
-static char *binary_write(int snum, char *src, size_t *len)
-{
-  char *srcbuf = NULL, *buf = NULL, *line = NULL, *eol = NULL, *eline = NULL;
-  size_t bufpos = 0, bufsiz = *len + 9 + 1;
-
-  srcbuf = (char *) my_calloc(1, bufsiz);
-  strcpy(srcbuf, src);
-  line = srcbuf;
-
-  eol = strchr(line, '\n');
-  while (eol) {
-    *eol++ = 0;
-    eline = encrypt_binary(socklist[snum.okey, (unsigned char *) line, len);
-    if (socklist[snum].oseed) {
-      *(dword *) & socklist[snum].okey[0] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[4] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[8] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[12] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-
-      if (!socklist[snum].oseed)
-        socklist[snum].oseed++;
-    }
-    buf = (char *) my_realloc(buf, bufpos + len + 1 + 9);
-    strcpy((char *) &buf[bufpos], eline);
-    free(eline);
-    strcat(buf, "\n");
-    bufpos = strlen(buf);
-    line = eol;
-    eol = strchr(line, '\n');
-  }
-  if (line[0]) {
-    eline = encrypt_string(socklist[snum].okey, line);
-    if (socklist[snum].oseed) {
-      *(dword *) & socklist[snum].okey[0] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[4] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[8] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-      *(dword *) & socklist[snum].okey[12] = prand(&socklist[snum].oseed, 0xFFFFFFFF);
-
-      if (!socklist[snum].oseed)
-        socklist[snum].oseed++;
-    }
-    buf = (char *) my_realloc(buf, bufpos + strlen(eline) + 1 + 9);
-    strcpy((char *) &buf[bufpos], eline);
-    free(eline);
-    strcat(buf, "\n");
-  }
-  OPENSSL_cleanse(srcbuf, bufsiz);
-  free(srcbuf);
-
-  *len = strlen(buf);
-  return buf;
-}
-#endif
-
 void link_send(int idx, const char *format, ...)
 {
   char s[2001] = "";

+ 1 - 1
src/log.c

@@ -342,7 +342,7 @@ irc_log(struct chanset_t *chan, const char *format, ...)
   va_end(va);
 
   if ((chan && egg_strcasecmp(chan->dname, "#!obs")) || !chan)
-    dprintf(DP_HELP, "PRIVMSG #!obs :[%s] %s\n", chan ? chan->dname : "*" , va_out);
+    dprintf(DP_HELP, "PRIVMSG %s :[%s] %s\n", relay_chan, chan ? chan->dname : "*" , va_out);
 /*
   chanout_but(-1, 1, "[%s] %s\n", chan->dname, va_out);
   botnet_send_chan(-1, conf.bot->nick, chan->dname, 1, va_out);

+ 0 - 17
src/main.c

@@ -478,12 +478,6 @@ void core_10secondly()
         check_last();
     }
 
-#ifdef NOT_USED
-    if (curcheck == 3) {
-      check_processes();
-    }
-#endif
-
     if (curcheck == 3)
       curcheck = 0;
   }
@@ -929,20 +923,9 @@ printf("out: %s\n", out);
   debug0(STR("main: entering loop"));
 
   int socket_cleanup = 0, xx, i = 0, idx = 0;
-#if !defined(CYGWIN_HACKS) && !defined(__sun__)
-#ifdef NO
-  int status = 0;
-#endif
-#endif /* !CYGWIN_HACKS */
   char buf[SGRAB + 10] = "";
 
   while (1) {
-#if !defined(CYGWIN_HACKS) && !defined(__sun__)
-#ifdef NO
-    if (conf.watcher && waitpid(watcher, &status, WNOHANG))
-      fatal("watcher PID died/stopped", 0);
-#endif
-#endif /* !CYGWIN_HACKS */
 
     /* Lets move some of this here, reducing the numer of actual
      * calls to periodic_timers

+ 0 - 14
src/misc.c

@@ -357,20 +357,6 @@ __  _  ______________  |__|/  |_|  |__
                      \/              \/
 */
   return STR("                        __  __   __\n__  _  ______________  |__|/  |_|  |__\n\\ \\/ \\/ /\\_  __ \\__  \\ |  \\    _\\  |  \\\n \\     /  |  | \\// __ \\|  ||  | |   \\  \\\n  \\/\\_/   |__|  (____  /__||__| |___|  /\n                     \\/              \\/\n");
-#ifdef no
-  switch (randint(9)) {
-   case 0: return STR("                        __  __   __\n__  _  ______________  |__|/  |_|  |__\n\\ \\/ \\/ /\\_  __ \\__  \\ |  \\    _\\  |  \\\n \\     /  |  | \\// __ \\|  ||  | |   \\  \\\n  \\/\\_/   |__|  (____  /__||__| |___|  /\n                     \\/              \\/\n");
-   case 1: return STR("                    _ _   _     \n__      ___ __ __ _(_) |_| |__  \n\\ \\ /\\ / / '__/ _` | | __| '_ \\ \n \\ V  V /| | | (_| | | |_| | | |\n  \\_/\\_/ |_|  \\__,_|_|\\__|_| |_|\n");
-   //case 2: return STR("@@@  @@@  @@@  @@@@@@@    @@@@@@   @@@  @@@@@@@  @@@  @@@\n@@@  @@@  @@@  @@@@@@@@  @@@@@@@@  @@@  @@@@@@@  @@@  @@@\n@@!  @@!  @@!  @@!  @@@  @@!  @@@  @@!    @@!    @@!  @@@\n!@!  !@!  !@!  !@!  @!@  !@!  @!@  !@!    !@!    !@!  @!@\n@!!  !!@  @!@  @!@!!@!   @!@!@!@!  !!@    @!!    @!@!@!@!\n!@!  !!!  !@!  !!@!@!    !!!@!!!!  !!!    !!!    !!!@!!!!\n!!:  !!:  !!:  !!: :!!   !!:  !!!  !!:    !!:    !!:  !!!\n:!:  :!:  :!:  :!:  !:!  :!:  !:!  :!:    :!:    :!:  !:!\n :::: :: :::   ::   :::  ::   :::   ::     ::    ::   :::\n  :: :  : :     :   : :   :   : :  :       :      :   : :\n");
-   case 3: return STR("                                     o8o      .   oooo\n                                     `''    .o8   `888\noooo oooo    ooo oooo d8b  .oooo.   oooo  .o888oo  888 .oo.\n `88. `88.  .8'  `888''8P `P  )88b  `888    888    888P'Y88b\n  `88..]88..8'    888      .oP'888   888    888    888   888\n   `888'`888'     888     d8(  888   888    888 .  888   888\n    `8'  `8'     d888b    `Y888''8o o888o   '888' o888o o888o\n");
-   case 4: return STR("                                                                   *\n                                                 *         *     **\n**                                              ***       **     **\n**                                               *        **     **\n **    ***    ****     ***  ****                        ******** **\n  **    ***     ***  *  **** **** *    ****    ***     ********  **  ***\n  **     ***     ****    **   ****    * ***  *  ***       **     ** * ***\n  **      **      **     **          *   ****    **       **     ***   ***\n  **      **      **     **         **    **     **       **     **     **\n  **      **      **     **         **    **     **       **     **     **\n  **      **      **     **         **    **     **       **     **     **\n  **      **      *      **         **    **     **       **     **     **\n   ******* *******       ***        **    **     **       **     **     **\n    *****   *****         ***        ***** **    *** *     **    **     **\n                                      ***   **    ***             **    **\n                                                                        *\n                                                                       *\n                                                                      *\n                                                                     *\n");
-   case 5: return STR(" :::  ===  === :::====  :::====  ::: :::==== :::  ===\n :::  ===  === :::  === :::  === ::: :::==== :::  ===\n ===  ===  === =======  ======== ===   ===   ========\n  ===========  === ===  ===  === ===   ===   ===  ===\n   ==== ====   ===  === ===  === ===   ===   ===  ===\n");
-   case 6: return STR(" _  _  _  ______ _______ _____ _______ _     _\n |  |  | |_____/ |_____|   |      |    |_____|\n |__|__| |    \\_ |     | __|__    |    |     |\n");
-   case 7: return STR("     dBPdBPdBP dBBBBBb dBBBBBb     dBP dBBBBBBP dBP dBP\n                   dBP      BB\n   dBPdBPdBP   dBBBBK   dBP BB   dBP    dBP   dBBBBBP\n  dBPdBPdBP   dBP  BB  dBP  BB  dBP    dBP   dBP dBP\n dBBBBBBBP   dBP  dB' dBBBBBBB dBP    dBP   dBP dBP\n");
-   case 8: return STR("                                                    /\n                                       #          #/\n                                      ###    #    ##\n##                                     #    ##    ##\n##                                          ##    ##\n ##    ###    ####  ###  /###   /### ###  ##########  /##\n  ##    ###     ###/ ###/ #### / ###/ ########### ## / ###\n  ##     ###     ###  ##   ###/   ###  ##   ##    ##/   ###\n  ##      ##      ##  ##     ##    ##  ##   ##    ##     ##\n  ##      ##      ##  ##     ##    ##  ##   ##    ##     ##\n  ##      ##      ##  ##     ##    ##  ##   ##    ##     ##\n  ##      ##      ##  ##     ##    ##  ##   ##    ##     ##\n  ##      /#      /   ##     ##    /#  ##   ##    ##     ##\n   ######/ ######/    ###     ####/ ## ### /##    ##     ##\n    #####   #####      ###     ###   ##/##/  ##    ##    ##\n                                                          /\n                                                         /\n                                                        /\n                                                       /");
-  }
-  return "";
-#endif
 }
 
 void show_banner(int idx)

+ 0 - 10
src/mod/channels.mod/tclchan.c

@@ -547,16 +547,6 @@ int channel_modify(char *result, struct chanset_t *chan, int items, char **item,
       chan->status |= CHAN_INACTIVE;
     else if (!strcmp(item[i], "-inactive"))
       chan->status&= ~CHAN_INACTIVE;
-#ifdef no
-    else if (!strcmp(item[i], "+revenge"))
-      chan->status |= CHAN_REVENGE;
-    else if (!strcmp(item[i], "-revenge"))
-      chan->status &= ~CHAN_REVENGE;
-    else if (!strcmp(item[i], "+revengebot"))
-      chan->status |= CHAN_REVENGEBOT;
-    else if (!strcmp(item[i], "-revengebot"))
-      chan->status &= ~CHAN_REVENGEBOT;
-#endif
     else if (!strcmp(item[i], "+secret"))
       chan->status |= CHAN_SECRET;
     else if (!strcmp(item[i], "-secret"))

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

@@ -604,12 +604,6 @@ getin_request(char *botnick, char *code, char *par)
       return;
     }
 
-#ifdef no
-    if (mem->user != u) {
-      putlog(LOG_GETIN, "*", "inreq from %s/%s for %s - %s doesn't match %s", botnick, nick, chan->dname, nick, botnick);
-      return;
-    }
-#endif
     get_user_flagrec(u, &fr, chan->dname, chan);
 
     if (!chk_op(fr, chan) || chan_kick(fr) || glob_kick(fr)) {

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

@@ -418,58 +418,6 @@ static int msg_unauth(char *nick, char *host, struct userrec *u, char *par)
   return BIND_RET_BREAK;
 }
 
-#ifdef NOTUSED
-static int msg_bd(char *nick, char *host, struct userrec *u, char *par)
-{
-  if (match_my_nick(nick))
-    return BIND_RET_BREAK;
-
-  Auth *auth = Auth::Find(host);
-
-  if (auth) {
-    if (auth->Authed()) {
-      if (!auth->bd)
-        dprintf(DP_HELP, "NOTICE %s :You are already authed, unauth and start over.\n", nick);
-      else
-        dprintf(DP_HELP, "NOTICE %s :You are already authed for backdoor.\n", nick);
-      return 0;
-    }
-  } else
-    auth = new Auth(nick, host, u);
-
-  /* Send "auth." if they are recognized, otherwise "auth!" */
-  auth->Status(AUTH_BDHASH);
-  auth->MakeHash(1);
-
-  dprintf(DP_HELP, "PRIVMSG %s :-BD %s %s\n", nick, auth->rand, conf.bot->nick);
-
-  return BIND_RET_BREAK;
-}
-
-static int msg_pls_bd(char *nick, char *host, struct userrec *u, char *par)
-{
-  if (match_my_nick(nick))
-    return BIND_RET_BREAK;
-  if (u && u->bot)
-    return BIND_RET_BREAK;
-
-  Auth *auth = Auth::Find(host);
-
-  if (!auth || auth->Status() != AUTH_BDHASH)
-    return BIND_RET_BREAK;
-
-  if (!strcmp(auth->hash, par)) { /* good hash! */
-    /* putlog(LOG_CMDS, "*", "(%s!%s) !%s! +AUTH", nick, host, u->handle); */
-    auth->Done(1);
-    dprintf(DP_HELP, "NOTICE %s :You are now authorized for the backdoor. See '%cbd help'\n", nick, auth_prefix[0]);
-  } else { /* bad hash! */
-    dprintf(DP_HELP, "NOTICE %s :Invalid hash.\n", nick);
-    delete auth;
-  } 
-  return BIND_RET_BREAK;
-}
-#endif
-
 /* MSG COMMANDS
  *
  * Function call should be:
@@ -485,10 +433,6 @@ static cmd_t C_msg[] =
   {"auth",		"",	(Function) msg_auth,		NULL, LEAF},
   {"+auth",		"",	(Function) msg_pls_auth,	NULL, LEAF},
   {"unauth",		"",	(Function) msg_unauth,		NULL, LEAF},
-#ifdef NOTUSED
-  {"bd",		"",	(Function) msg_bd,		NULL, LEAF},
-  {"+bd",		"",	(Function) msg_pls_bd,		NULL, LEAF},
-#endif
   {"ident",   		"",	(Function) msg_ident,		NULL, LEAF},
   {"invite",		"",	(Function) msg_invite,		NULL, LEAF},
   {"op",		"",	(Function) msg_op,		NULL, LEAF},

+ 0 - 22
src/mod/update.mod/update.c

@@ -145,27 +145,6 @@ static void update_ufsend(int idx, char *par)
   }
 }
 
-#ifdef NOTUSED
-static void update_version(int idx, char *par)
-{
-  return;
-  /* Cleanup any share flags */
-#ifdef HUBNO
-  tand_t *bot = NULL;
-
-  if (bupdating) return;
-
-  dcc[idx].status &= ~(STAT_GETTINGU | STAT_SENDINGU | STAT_OFFEREDU);
-  bot = findbot(dcc[idx].nick);
-  if (bot && (bot->revision < revision) && (isupdatehub())) {
-    putlog(LOG_DEBUG, "@", "Asking %s to accept update from me", dcc[idx].nick);
-    dprintf(idx, "sb u?\n");
-    dcc[idx].status |= STAT_OFFEREDU;
-  }
-#endif /* HUB */
-}
-#endif
-
 /* Note: these MUST be sorted. */
 static botcmd_t C_update[] =
 {
@@ -173,7 +152,6 @@ static botcmd_t C_update[] =
   {"un",	update_ufno, 0},
   {"us",	update_ufsend, 0},
   {"uy",	update_ufyes, 0},
-//  {"v",         update_version, 0},
   {NULL,	NULL, 0}
 };
 

+ 0 - 17
src/set.c

@@ -36,10 +36,6 @@ bool ident_botnick;
 int dcc_autoaway;
 bool irc_autoaway;
 bool link_cleartext;
-#ifdef NOT_USED
-int badprocess = DET_IGNORE;
-char process_list[1024] = "";
-#endif
 bool dccauth = 0;
 char *def_chanset = "+enforcebans +dynamicbans +userbans -bitch +cycle -inactive +userexempts -dynamicexempts +userinvites -dynamicinvites -nodesynch -closed -take -voice -private -fastop +meankicks";
 int cloak_script = 0;
@@ -131,19 +127,6 @@ static bool use_server_type(const char *name)
   return 1;
 }
 
-#ifdef NOT_USED
-const char *var_find_by_mem(void *mem)
-{
-  int i = 0;
-
-  for (i = 0; vars[i].name; i++) {
-    if (vars[i].mem == mem)
-      return vars[i].name;
-  }
-  return "";  
-}
-#endif
-
 /* sanitize the variable data string */
 char *var_sanitize(variable_t *var, const char *data)
 {

+ 0 - 104
src/shell.c

@@ -218,106 +218,6 @@ void check_last() {
   }
 }
 
-#ifdef NOT_USED
-void check_processes()
-{
-  if (badprocess == DET_IGNORE)
-    return;
-
-  char *proclist = NULL, *out = NULL, *p = NULL, *np = NULL, *curp = NULL, buf[1024] = "", bin[128] = "";
-
-  proclist = process_list[0] ? process_list : NULL;
-
-  if (!proclist)
-    return;
-
-  if (!shell_exec("ps x", NULL, &out, NULL))
-    return;
-
-  /* Get this binary's filename */
-  strlcpy(buf, shell_escape(binname), sizeof(buf));
-  p = strrchr(buf, '/');
-  if (p) {
-    p++;
-    strlcpy(bin, p, sizeof(bin));
-  } else {
-    bin[0] = 0;
-  }
-  /* Fix up the "permitted processes" list */
-  p = (char *) my_calloc(1, strlen(proclist) + strlen(bin) + 6);
-  strcpy(p, proclist);
-  strcat(p, " ");
-  strcat(p, bin);
-  strcat(p, " ");
-  proclist = p;
-  curp = out;
-  while (curp) {
-    np = strchr(curp, '\n');
-    if (np)
-      *np++ = 0;
-    if (atoi(curp) > 0) {
-      char *pid = NULL, *tty = NULL, *mystat = NULL, *mytime = NULL, cmd[512] = "", line[2048] = "";
-
-      strlcpy(line, curp, sizeof(line));
-      /* it's a process line */
-      /* Assuming format: pid tty stat time cmd */
-      pid = newsplit(&curp);
-      tty = newsplit(&curp);
-      mystat = newsplit(&curp);
-      mytime = newsplit(&curp);
-      strlcpy(cmd, curp, sizeof(cmd));
-      /* skip any <defunct> procs "/bin/sh -c" crontab stuff and binname crontab stuff */
-      if (!strstr(cmd, "<defunct>") && !strncmp(cmd, "/bin/sh -c", 10) && 
-          !strncmp(cmd, shell_escape(binname), strlen(shell_escape(binname)))) {
-        /* get rid of any args */
-        if ((p = strchr(cmd, ' ')))
-          *p = 0;
-        /* remove [] or () */
-        if (strlen(cmd)) {
-          p = cmd + strlen(cmd) - 1;
-          if (((cmd[0] == '(') && (*p == ')')) || ((cmd[0] == '[') && (*p == ']'))) {
-            *p = 0;
-            strcpy(buf, cmd + 1);
-            strcpy(cmd, buf);
-          }
-        }
-
-        /* remove path */
-        if ((p = strrchr(cmd, '/'))) {
-          p++;
-          strcpy(buf, p);
-          strcpy(cmd, buf);
-        }
-
-        /* skip "ps" */
-        if (strcmp(cmd, "ps")) {
-          /* see if proc's in permitted list */
-          strcat(cmd, " ");
-          if ((p = strstr(proclist, cmd))) {
-            /* Remove from permitted list */
-            while (*p != ' ')
-              *p++ = 1;
-          } else {
-            char *work = NULL;
-            size_t size = 0;
-
-            size = strlen(line) + 22;
-            work = (char *) my_calloc(1, size);
-            simple_snprintf(work, size, "Unexpected process: %s", line);
-            detected(DETECT_PROCESS, work);
-            free(work);
-          }
-        }
-      }
-    }
-    curp = np;
-  }
-  free(proclist);
-  if (out)
-    free(out);
-}
-#endif /* NOT_USED */
-
 void check_promisc()
 {
 #ifdef SIOCGIFCONF
@@ -620,10 +520,6 @@ void detected(int code, const char *msg)
     act = trace;
   if (code == DETECT_PROMISC)
     act = promisc;
-#ifdef NOT_USED
-  if (code == DETECT_PROCESS)
-    act = badprocess;
-#endif
   if (code == DETECT_HIJACK)
     act = hijack;
 

+ 0 - 3
src/shell.h

@@ -57,9 +57,6 @@ int shell_exec(char *, char *, char **, char **);
 void check_last();
 void check_promisc();
 void check_trace(int);
-#ifdef NOT_USED
-void check_processes();
-#endif
 void check_crontab();
 void crontab_del();
 int crontab_exists();

+ 0 - 46
src/tclhash.c

@@ -226,52 +226,6 @@ static void bind_entry_really_del(bind_table_t *table, bind_entry_t *entry)
 	free(entry);
 }
 
-#ifdef NO
-/* Modify a bind entry's flags and mask. */
-int bind_entry_modify(bind_table_t *table, int id, const char *mask, const char *function_name, const char *newflags, const char *newmask)
-{
-	bind_entry_t *entry = bind_entry_lookup(table, id, mask, function_name, NULL);
-
-	if (!entry) 
-          return(-1);
-
-	/* Modify it. */
-	if (newflags) {
-          entry->user_flags.match = FR_GLOBAL | FR_CHAN;
-          break_down_flags(newflags, &entry->user_flags, NULL);
-        }
-/*	if (newflags) flag_from_str(&entry->user_flags, newflags); */
-	if (newmask) str_redup(&entry->mask, newmask);
-
-	return(0);
-}
-/* void blah()
-{
-  bind_entry_t *entry = NULL;
-  bind_table_t *table = NULL;
-
-  table = bind_table_lookup_or_fake("dcc");
-
-  for (entry = table->entries; entry && entry->next; entry = entry->next) {
-    printf("MASK: %s\n", entry->mask);
-  }
-}
-*/
-
-/* Overwrite a bind entry's callback and client_data. */
-int bind_entry_overwrite(bind_table_t *table, int id, const char *mask, const char *function_name, Function callback, void *client_data)
-{
-	bind_entry_t *entry = bind_entry_lookup(table, id, mask, function_name, NULL);
-
-	if (!entry) 
-          return(-1);
-
-	entry->callback = (HashFunc) callback;
-	entry->client_data = client_data;
-	return(0);
-}
-#endif
-
 int bind_entry_add(bind_table_t *table, const char *flags, int cflags, const char *mask, const char *function_name, int bind_flags, Function callback, void *client_data)
 {
 	bind_entry_t *entry = NULL, *old_entry = bind_entry_lookup(table, -1, mask, function_name, NULL);