Fixed more backup router reconnecting problems
[silc.git] / apps / silcd / command.c
index c4b0edbef9be85f2b42bc73bf9bde5d954a3d69c..f35969ecf8968c3377595a04bd8fe7b84e63c50e 100644 (file)
@@ -1289,7 +1289,7 @@ SILC_SERVER_CMD_FUNC(invite)
 
   /* Send invite list back only if the list was modified, or no arguments
      was given. */
-  type = 0;
+  ttype = 0;
   argc = silc_argument_get_arg_num(cmd->args);
   if (argc == 1)
     ttype = 1;
@@ -1303,7 +1303,7 @@ SILC_SERVER_CMD_FUNC(invite)
                                 2, tmp, len,
                                 3, ttype && list ?
                                 list->data : NULL,
-                                type && list ? silc_buffer_len(list) : 0);
+                                ttype && list ? silc_buffer_len(list) : 0);
   silc_buffer_free(list);
 
  out:
@@ -1474,9 +1474,8 @@ SILC_SERVER_CMD_FUNC(kill)
     sock = remote_client->connection;
     silc_server_remove_from_channels(server, NULL, remote_client,
                                     TRUE, (char *)"Killed", TRUE, TRUE);
-    silc_server_free_client_data(server, NULL, remote_client, TRUE,
-                                comment ? comment :
-                                (unsigned char *)"Killed");
+    silc_server_free_sock_user_data(server, sock, comment ? comment :
+                                   (unsigned char *)"Killed");
     if (sock)
       silc_server_close_connection(server, sock);
   } else {
@@ -1558,12 +1557,13 @@ SILC_SERVER_CMD_FUNC(info)
     char info_string[256];
 
     memset(info_string, 0, sizeof(info_string));
-    snprintf(info_string, sizeof(info_string),
-            "location: %s server: %s admin: %s <%s>",
-            server->config->server_info->location,
-            server->config->server_info->server_type,
-            server->config->server_info->admin,
-            server->config->server_info->email);
+    silc_snprintf(info_string, sizeof(info_string),
+                 "location: %s server: %s admin: %s <%s> version: %s",
+                 server->config->server_info->location,
+                 server->config->server_info->server_type,
+                 server->config->server_info->admin,
+                 server->config->server_info->email,
+                 silc_dist_version);
 
     server_info = info_string;
     entry = server->id_entry;
@@ -2824,7 +2824,7 @@ SILC_SERVER_CMD_FUNC(umode)
   SilcServer server = cmd->server;
   SilcClientEntry client = silc_packet_get_context(cmd->sock);
   unsigned char *tmp_mask, m[4];
-  SilcUInt32 mask = 0;
+  SilcUInt32 mask = 0, tmp_len;
   SilcUInt16 ident = silc_command_get_ident(cmd->payload);
   SilcBool set_mask = FALSE;
 
@@ -2834,8 +2834,8 @@ SILC_SERVER_CMD_FUNC(umode)
   SILC_SERVER_COMMAND_CHECK(SILC_COMMAND_UMODE, cmd, 1, 2);
 
   /* Get the client's mode mask */
-  tmp_mask = silc_argument_get_arg_type(cmd->args, 2, NULL);
-  if (tmp_mask) {
+  tmp_mask = silc_argument_get_arg_type(cmd->args, 2, &tmp_len);
+  if (tmp_mask && tmp_len == 4) {
     SILC_GET32_MSB(mask, tmp_mask);
     set_mask = TRUE;
   }
@@ -2948,7 +2948,7 @@ SILC_SERVER_CMD_FUNC(cmode)
 
   /* Get the channel mode mask */
   tmp_mask = silc_argument_get_arg_type(cmd->args, 2, &tmp_len);
-  if (tmp_mask) {
+  if (tmp_mask && tmp_len == 4) {
     SILC_GET32_MSB(mode_mask, tmp_mask);
     set_mask = TRUE;
   }