Put back nickname validity checking in query.
authorPekka Riikonen <priikone@silcnet.org>
Fri, 22 Apr 2005 14:39:59 +0000 (14:39 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Fri, 22 Apr 2005 14:39:59 +0000 (14:39 +0000)
apps/silcd/server_query.c
lib/silcutil/silcapputil.c

index bcce80c91efa20ca74843cc108b96adbf48aff02..f54145da589c2cd00c4601e13bc4d36101bde079 100644 (file)
@@ -413,16 +413,18 @@ void silc_server_query_parse(SilcServer server, SilcServerQuery query)
       }
 
       /* Check nickname */
-      tmp = silc_identifier_check(query->nickname, strlen(query->nickname),
-                                 SILC_STRING_UTF8, 128, &tmp_len);
-      if (!tmp) {
-       silc_server_query_send_error(server, query,
-                                    SILC_STATUS_ERR_BAD_NICKNAME, 0);
-       silc_server_query_free(query);
-       return;
+      if (tmp) {
+       tmp = silc_identifier_check(query->nickname, strlen(query->nickname),
+                                   SILC_STRING_UTF8, 128, &tmp_len);
+       if (!tmp) {
+         silc_server_query_send_error(server, query,
+                                      SILC_STATUS_ERR_BAD_NICKNAME, 0);
+         silc_server_query_free(query);
+         return;
+       }
+       silc_free(query->nickname);
+       query->nickname = tmp;
       }
-      silc_free(query->nickname);
-      query->nickname = tmp;
 
     } else {
       /* Parse the IDs included in the query */
index a79ee597549e91a21c7ae838b3cb6335a64e8202..415d591fd22691142a3d606bc02deff916ce7554 100644 (file)
@@ -1,10 +1,10 @@
 /*
 
-  silcapputil.c 
+  silcapputil.c
 
   Author: Pekka Riikonen <priikone@silcnet.org>
 
-  Copyright (C) 2002 Pekka Riikonen
+  Copyright (C) 2002 - 2005 Pekka Riikonen
 
   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -25,7 +25,7 @@ static char *silc_create_pk_identifier(void)
   char *username = NULL, *realname = NULL;
   char *hostname, email[256];
   char *ident;
-  
+
   /* Get realname */
   realname = silc_get_real_name();
 
@@ -89,7 +89,7 @@ New pair of keys will be created.  Please, answer to following questions.\n\
        alg = silc_get_input("PKCS name (l to list names) [rsa]: ", FALSE);
        if (!alg)
          alg = strdup("rsa");
-    
+
        if (*alg == 'l' || *alg == 'L') {
          char *list = silc_pkcs_get_supported();
          printf("%s\n", list);
@@ -347,8 +347,8 @@ bool silc_show_public_key(const char *pub_filename)
     printf("Organization       : %s\n", ident->org);
   if (ident->country)
     printf("Country            : %s\n", ident->country);
-  printf("Fingerprint (SHA1) : %s\n", fingerprint); 
-  printf("Babbleprint (SHA1) : %s\n", babbleprint); 
+  printf("Fingerprint (SHA1) : %s\n", fingerprint);
+  printf("Babbleprint (SHA1) : %s\n", babbleprint);
 
   fflush(stdout);