[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] agree with nick: this legal-chars-in-filename stuff gets us...



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

Modified Files:
	crypto.c util.c util.h 
Log Message:
agree with nick: this legal-chars-in-filename stuff gets us nothing


Index: crypto.c
===================================================================
RCS file: /home/or/cvsroot/src/common/crypto.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- crypto.c	24 Aug 2004 20:48:22 -0000	1.101
+++ crypto.c	24 Aug 2004 21:57:10 -0000	1.102
@@ -344,13 +344,6 @@
 
   tor_assert(env && keyfile);
 
-#if 0
-  if(strspn(keyfile,CONFIG_LEGAL_FILENAME_CHARACTERS) != strlen(keyfile)) {
-    /* filename contains nonlegal characters */
-    return -1;
-  }
-#endif
-
   /* open the keyfile */
   f_pr=fopen(keyfile,"rb");
   if (!f_pr)

Index: util.c
===================================================================
RCS file: /home/or/cvsroot/src/common/util.c,v
retrieving revision 1.127
retrieving revision 1.128
diff -u -d -r1.127 -r1.128
--- util.c	24 Aug 2004 20:48:22 -0000	1.127
+++ util.c	24 Aug 2004 21:57:10 -0000	1.128
@@ -1507,13 +1507,6 @@
 
   tor_assert(filename);
 
-#if 0
-  if(strcspn(filename,CONFIG_LEGAL_FILENAME_CHARACTERS) != 0) {
-    log_fn(LOG_WARN,"Filename %s contains illegal characters.",filename);
-    return NULL;
-  }
-#endif
-
   if(stat(filename, &statbuf) < 0) {
     log_fn(LOG_INFO,"Could not stat %s.",filename);
     return NULL;
@@ -1624,7 +1617,7 @@
 #ifndef MS_WINDOWS
   return rename(from,to);
 #else
-  switch(file_status(to)) 
+  switch(file_status(to))
     {
     case FN_NOENT:
       break;

Index: util.h
===================================================================
RCS file: /home/or/cvsroot/src/common/util.h,v
retrieving revision 1.86
retrieving revision 1.87
diff -u -d -r1.86 -r1.87
--- util.h	24 Aug 2004 20:48:22 -0000	1.86
+++ util.h	24 Aug 2004 21:57:10 -0000	1.87
@@ -74,17 +74,6 @@
 #define tor_close_socket(s) close(s)
 #endif
 
-#if 0
-/* XXXX Remove this -- These lists are incomplete, and detecting bad filenames
- * is the OS's job. -NM */
-/** Legal characters in a filename */
-#ifdef MS_WINDOWS
-#define CONFIG_LEGAL_FILENAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/\\ "
-#else
-#define CONFIG_LEGAL_FILENAME_CHARACTERS "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.-_/ "
-#endif
-#endif
-
 #define HEX_CHARACTERS "0123456789ABCDEFabcdef"
 
 size_t strlcat(char *dst, const char *src, size_t siz);