updates.
authorPekka Riikonen <priikone@silcnet.org>
Thu, 12 Jul 2001 17:13:13 +0000 (17:13 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Thu, 12 Jul 2001 17:13:13 +0000 (17:13 +0000)
CHANGES
apps/irssi/src/silc/core/clientutil.c
apps/silcd/Makefile.am
apps/silcd/packet_receive.c
lib/silcclient/client.c
lib/silcclient/command.c
lib/silcclient/command_reply.c
lib/silcclient/protocol.c

diff --git a/CHANGES b/CHANGES
index 47158a730569561a8560169e48cba5420fd084d4..a8730a0dfe9914836b6ee322d950ceb87c99ff73 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,8 @@
+Thu Jul 12 17:49:31 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
+
+       * Do not change the ~/.silc directory's permissions automatically.
+         Affected file irssi/src/silc/core/clientutil.c.
+
 Thu Jul 12 10:18:40 EEST 2001  Pekka Riikonen <priikone@silcnet.org>
 
        * Do not cancel the protocol in silc_server_close_connection
index fa7cf6255342f8076201db96fde9fd651dbc8941..463969670987bcd3850d10655285e069e134555f 100644 (file)
@@ -351,6 +351,7 @@ int silc_client_check_silc_dir()
       return FALSE;
     }
     
+#if 0
     /* Check the permissions of the dir */
     if ((st.st_mode & 0777) != 0755) {
       if ((chmod(filename, 0755)) == -1) {
@@ -359,6 +360,7 @@ int silc_client_check_silc_dir()
        return FALSE;
       }
     }
+#endif
   }
 
   /*
index f3caad4b72607685b0fe8fbdb24c0b3b8033ef6c..0db442b9a72977a163b757a72d83f575550ae722 100644 (file)
@@ -18,7 +18,7 @@
 
 AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
-sbin_PROGRAMS = silcd testi
+sbin_PROGRAMS = silcd
 
 silcd_SOURCES = \
        protocol.c \
@@ -33,9 +33,7 @@ silcd_SOURCES = \
        serverid.c \
        silcd.c \
        server_version.c
-silcd_DEPENDENCIES = ../lib/libsilc.a
-
-testi_SOURCES = testi.c
+silcd_DEPENDENCIES = ../lib/libsilc.a -lefence
 
 LIBS = $(SILC_COMMON_LIBS)
 LDADD =
index 83a9348fe21aa0ed9076bacfaad5d4f3ab629436..51ff706ee3b06c9b6158aafbeeadb52535dab3b0 100644 (file)
@@ -1872,8 +1872,7 @@ void silc_server_new_channel(SilcServer server,
                    sock->hostname));
     
     silc_idlist_add_channel(server->global_list, strdup(channel_name), 
-                           0, channel_id, sock->user_data, 
-                           NULL, NULL);
+                           0, channel_id, sock->user_data, NULL, NULL);
 
     server->stat.channels++;
   } else {
index b96905008976eb378b3e6f0fa3f902148e3b767e..8fa87ad8d7282542836264ec568340c90838df23 100644 (file)
@@ -1202,6 +1202,8 @@ void silc_client_close_connection(SilcClient client,
       silc_idcache_del_all(conn->client_cache);
     if (conn->channel_cache)
       silc_idcache_del_all(conn->channel_cache);
+    if (conn->server_cache)
+      silc_idcache_del_all(conn->server_cache);
 
     /* Free data */
     if (conn->remote_host)
index cb9519375a955209e904bd869d6ff5b7928b1e1d..f9fc1f805b2e38fcc765ce47f1fd66750f610dda 100644 (file)
@@ -219,16 +219,6 @@ static void silc_client_command_destructor(void *context)
   silc_client_command_free((SilcClientCommandContext)context);
 }
 
-/* silc_client_get_client completion callback */
-void silc_client_command_completion(SilcClient client,
-                                   SilcClientConnection conn,
-                                   SilcClientEntry clients,
-                                   uint32 clients_count,
-                                   void *context)
-{
-
-}
-
 /* Command WHOIS. This command is used to query information about 
    specific user. */
 
@@ -397,7 +387,6 @@ SILC_CLIENT_CMD_FUNC(nick)
                            "Your nickname is %s", conn->nickname);
     }
 
-    /* XXX Notify application */
     COMMAND;
     goto out;
   }
@@ -500,7 +489,8 @@ SILC_CLIENT_CMD_FUNC(topic)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -510,14 +500,16 @@ SILC_CLIENT_CMD_FUNC(topic)
   }
 
   if (!conn->current_channel) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on that channel");
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "You are not on that channel");
     COMMAND_ERROR;
     goto out;
   }
 
   /* Get the Channel ID of the channel */
   if (!silc_idcache_find_by_name_one(conn->channel_cache, name, &id_cache)) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on that channel");
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "You are not on that channel");
     COMMAND_ERROR;
     goto out;
   }
@@ -579,7 +571,8 @@ SILC_CLIENT_CMD_FUNC(invite)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -590,7 +583,8 @@ SILC_CLIENT_CMD_FUNC(invite)
 
     channel = silc_client_get_channel(cmd->client, conn, name);
     if (!channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are on that channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are on that channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -600,7 +594,8 @@ SILC_CLIENT_CMD_FUNC(invite)
   if (cmd->argc == 3) {
     if (cmd->argv[2][0] != '+' && cmd->argv[2][0] != '-') {
       if (!silc_parse_nickname(cmd->argv[2], &nickname, &server, &num)) {
-       cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "Bad nickname");
+       cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                             "Bad nickname");
        COMMAND_ERROR;
        goto out;
       }
@@ -914,10 +909,6 @@ SILC_CLIENT_CMD_FUNC(ping)
   silc_client_command_free(cmd);
 }
 
-SILC_CLIENT_CMD_FUNC(notice)
-{
-}
-
 /* Command JOIN. Joins to a channel. */
 
 SILC_CLIENT_CMD_FUNC(join)
@@ -933,24 +924,10 @@ SILC_CLIENT_CMD_FUNC(join)
     goto out;
   }
 
-  if (cmd->argc < 2) {
-    /* Show channels currently joined to */
-
-    goto out;
-  }
-
   /* See if we have joined to the requested channel already */
   if (silc_idcache_find_by_name_one(conn->channel_cache, cmd->argv[1],
-                                   &id_cache)) {
-#if 0
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
-                         "You are talking to channel %s", cmd->argv[1]);
-    conn->current_channel = (SilcChannelEntry)id_cache->context;
-    cmd->client->screen->bottom_line->channel = cmd->argv[1];
-    silc_screen_print_bottom_line(cmd->client->screen, 0);
-#endif
+                                   &id_cache))
     goto out;
-  }
 
   idp = silc_id_payload_encode(conn->local_id, SILC_ID_CLIENT);
 
@@ -1150,7 +1127,8 @@ SILC_CLIENT_CMD_FUNC(cmode)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1161,7 +1139,8 @@ SILC_CLIENT_CMD_FUNC(cmode)
 
     channel = silc_client_get_channel(cmd->client, conn, name);
     if (!channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are on that channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are on that channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1379,7 +1358,8 @@ SILC_CLIENT_CMD_FUNC(cumode)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1390,7 +1370,8 @@ SILC_CLIENT_CMD_FUNC(cumode)
 
     channel = silc_client_get_channel(cmd->client, conn, name);
     if (!channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are on that channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are on that channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1543,7 +1524,8 @@ SILC_CLIENT_CMD_FUNC(kick)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1553,14 +1535,16 @@ SILC_CLIENT_CMD_FUNC(kick)
   }
 
   if (!conn->current_channel) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on that channel");
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "You are not on that channel");
     COMMAND_ERROR;
     goto out;
   }
 
   /* Get the Channel ID of the channel */
   if (!silc_idcache_find_by_name_one(conn->channel_cache, name, &id_cache)) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on that channel");
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "You are not on that channel");
     COMMAND_ERROR;
     goto out;
   }
@@ -1569,7 +1553,8 @@ SILC_CLIENT_CMD_FUNC(kick)
 
   /* Parse the typed nickname. */
   if (!silc_parse_nickname(cmd->argv[2], &nickname, &server, &num)) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "Bad nickname");
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "Bad nickname");
     COMMAND_ERROR;
     goto out;
   }
@@ -1578,7 +1563,8 @@ SILC_CLIENT_CMD_FUNC(kick)
   target = silc_idlist_get_client(cmd->client, conn, nickname, 
                                  server, num, FALSE);
   if (!target) {
-    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "No such client: %s",
+    cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                         "No such client: %s",
                          cmd->argv[2]);
     COMMAND_ERROR;
     goto out;
@@ -1843,7 +1829,8 @@ SILC_CLIENT_CMD_FUNC(ban)
 
   if (cmd->argv[1][0] == '*') {
     if (!conn->current_channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are not on any channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are not on any channel");
       COMMAND_ERROR;
       goto out;
     }
@@ -1854,7 +1841,8 @@ SILC_CLIENT_CMD_FUNC(ban)
 
     channel = silc_client_get_channel(cmd->client, conn, name);
     if (!channel) {
-      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, "You are on that channel");
+      cmd->client->ops->say(cmd->client, conn, SILC_CLIENT_MESSAGE_INFO, 
+                           "You are on that channel");
       COMMAND_ERROR;
       goto out;
     }
index a264ec240597c0b4dc39b4a2e4b889b838e08f4d..ae68cb7981a036af02cb77c03a359749b4e8a284 100644 (file)
@@ -82,8 +82,8 @@ const SilcCommandStatusMessage silc_command_status_messages[] = {
   { STAT(NO_SERVER_ID),      "No Server ID given" },
   { STAT(BAD_CLIENT_ID),     "Bad Client ID" },
   { STAT(BAD_CHANNEL_ID),    "Bad Channel ID" },
-  { STAT(NO_SUCH_CLIENT_ID), "There was no such client" },
-  { STAT(NO_SUCH_CHANNEL_ID),"There was no such channel" },
+  { STAT(NO_SUCH_CLIENT_ID), "There is no such client" },
+  { STAT(NO_SUCH_CHANNEL_ID),"There is no such channel" },
   { STAT(NICKNAME_IN_USE),   "Nickname already exists" },
   { STAT(NOT_ON_CHANNEL),    "You are not on that channel" },
   { STAT(USER_NOT_ON_CHANNEL),"They are not on the channel" },
index a47927edf1f82921b2ab6b73dd3e81ae691333d8..ecfa193cd729231badf5c00e86f387a678daf644 100644 (file)
@@ -131,16 +131,7 @@ void silc_client_protocol_ke_set_keys(SilcSKE ske,
                                    keymat->enc_key_len);
   conn->receive_key->set_iv(conn->receive_key, keymat->receive_iv);
 
-  /* Allocate PKCS to be used */
-#if 0
-  /* XXX Do we ever need to allocate PKCS for the connection??
-     If yes, we need to change KE protocol to get the initiators
-     public key. */
-  silc_pkcs_alloc(pkcs->pkcs->name, &conn->public_Key);
-  silc_pkcs_set_public_key(conn->public_key, ske->ke2_payload->pk_data, 
-                          ske->ke2_payload->pk_len);
-#endif
-
+  /* Rekey stuff */
   conn->rekey = silc_calloc(1, sizeof(*conn->rekey));
   conn->rekey->send_enc_key = 
     silc_calloc(keymat->enc_key_len / 8,