[or-cvs] warn and fail if server chose a nickname with illegal chara...

Roger Dingledine arma at seul.org
Sat Mar 20 20:28:56 UTC 2004


Update of /home/or/cvsroot/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/src/or

Modified Files:
	config.c 
Log Message:
warn and fail if server chose a nickname with illegal characters


Index: config.c
===================================================================
RCS file: /home/or/cvsroot/src/or/config.c,v
retrieving revision 1.98
retrieving revision 1.99
diff -u -d -r1.98 -r1.99
--- config.c	15 Mar 2004 04:57:24 -0000	1.98
+++ config.c	20 Mar 2004 20:28:53 -0000	1.99
@@ -568,9 +568,15 @@
     result = -1;
   }
 
-  if(options->ORPort && options->Nickname == NULL) {
-    log_fn(LOG_WARN,"Nickname required if ORPort is set, but not found.");
-    result = -1;
+  if (options->ORPort) {
+    if (options->Nickname == NULL) {
+      log_fn(LOG_WARN,"Nickname required if ORPort is set, but not found.");
+      result = -1;
+    } else if (strspn(options->Nickname, LEGAL_NICKNAME_CHARACTERS) !=
+               strlen(options->Nickname)) {
+      log_fn(LOG_WARN, "Nickname '%s' contains illegal characters.", options->Nickname);
+      result = -1;
+    }
   }
 
   if(options->ORPort) { /* get an IP for ourselves */



More information about the tor-commits mailing list