Fix oplevel, chkconf and ipv6 bugs.
authorMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 02:06:04 +0000 (02:06 +0000)
committerMichael Poole <mdpoole@troilus.org>
Sat, 11 Sep 2004 02:06:04 +0000 (02:06 +0000)
git-svn-id: file:///home/klmitch/undernet-ircu/undernet-ircu-svn/ircu2/trunk@1115 c9e4aea6-c8fd-4c43-8297-357d70d61c8c

ChangeLog
ircd/channel.c
ircd/ircd.c
ircd/numnicks.c

index d09f1eca01ab5b2e7c9196c1ad55954f77857045..a303dd46b6eeac43b05a8cd94950d171a2c126b3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-09-10  Michael Poole <mdpoole@troilus.org>
+
+       * ircd/channel.c (send_channel_modes): Only send oplevels for
+       channels that actually use them -- for -A channels, send chanops
+       as :o even if OPLEVELS is enabled.
+
+       * ircd/ircd.c: Fix -k (chkconf mode) and show in usage help.
+
+       * ircd/numnicks.c (base64toip): Fill in the right number of 0
+       words when we see _ in a base64-encoded IPv6 address.
+
 2004-09-10  Michael Poole <mdpoole@troilus.org>
 
        * ircd/ircd.c: Add -k as a chkconf-like option to exit after
index 3f4f67dd0f2cf12042bbbc0814c1b9fd3f5e5d3a..06634693c37e6088e4f389646bab7e53bf8b9769 100644 (file)
@@ -840,7 +840,7 @@ void send_channel_modes(struct Client *cptr, struct Channel *chptr)
   int                 opped_members_index = 0;
   struct Membership** opped_members = NULL;
   int                 last_oplevel = 0;
-  int                 feat_oplevels =  feature_bool(FEAT_OPLEVELS);
+  int                 feat_oplevels = (chptr->mode.mode & MODE_APASS) != 0;
 
   assert(0 != cptr);
   assert(0 != chptr); 
index f6002fe3610d182b9780158651e2cd4ecef59819..5fb4cf9144fca0578d04f9891574bfbb4f2f3513 100644 (file)
@@ -86,7 +86,7 @@ extern void mem_dbg_initialise(void);
 enum {
   BOOT_DEBUG = 1,
   BOOT_TTY   = 2,
-  BOOT_CHKCONF = 3
+  BOOT_CHKCONF = 4
 };
 
 
@@ -511,8 +511,8 @@ static void parse_command_line(int argc, char** argv) {
       break;
       
     default:
-      printf("Usage: ircd [-f config] [-h servername] [-x loglevel] [-ntv]\n");
-      printf("\n -n -t\t Don't detach\n -v\t display version\n\n");
+      printf("Usage: ircd [-f config] [-h servername] [-x loglevel] [-ntvk]\n");
+      printf("\n -n -t\t Don't detach\n -v\t display version\n -k\t exit after checking config\n\n");
       printf("Server not started.\n");
       exit(1);
     }
@@ -523,11 +523,6 @@ static void parse_command_line(int argc, char** argv) {
  * daemon_init
  *--------------------------------------------------------------------------*/
 static void daemon_init(int no_fork) {
-  if (!init_connection_limits())
-    exit(9);
-
-  close_connections(!(thisServer.bootopt & (BOOT_DEBUG | BOOT_TTY)));
-
   if (no_fork)
     return;
 
@@ -643,6 +638,11 @@ int main(int argc, char **argv) {
       !check_file_access(configfile, 'C', R_OK))
     return 4;
 
+  if (!init_connection_limits())
+    return 9;
+
+  close_connections(!(thisServer.bootopt & (BOOT_DEBUG | BOOT_TTY)));
+
   event_init(MAXCONNECTIONS);
 
   setup_signals();
index 781ff6f8a263513a9f591fb5ae32af66110b6174..79a42032b1d8d1edaaafee01b7e350c2c8c49912 100644 (file)
@@ -427,7 +427,7 @@ void base64toip(const char* input, struct irc_in_addr* addr)
     do {
       if (*input == '_') {
         unsigned int left;
-        for (left = (strlen(input) - 1) / 3; left; left--)
+        for (left = (25 - strlen(input)) / 3; left; left--)
           addr->in6_16[pos++] = 0;
         input++;
       } else {