summaryrefslogtreecommitdiff
path: root/src/common
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-08-24 21:57:12 +0000
committerRoger Dingledine <arma@torproject.org>2004-08-24 21:57:12 +0000
commitd91cacb8392dbea4dec69a48fbaf1fc9aa8a84dc (patch)
treeadab84a1db161220077fbcc4ab1ea6fb1691db2a /src/common
parent015232bd394367b8422b69222847e622a45b3714 (diff)
downloadtor-d91cacb8392dbea4dec69a48fbaf1fc9aa8a84dc.tar.gz
tor-d91cacb8392dbea4dec69a48fbaf1fc9aa8a84dc.zip
agree with nick: this legal-chars-in-filename stuff gets us nothing
svn:r2310
Diffstat (limited to 'src/common')
-rw-r--r--src/common/crypto.c7
-rw-r--r--src/common/util.c9
-rw-r--r--src/common/util.h11
3 files changed, 1 insertions, 26 deletions
diff --git a/src/common/crypto.c b/src/common/crypto.c
index 4339e8c758..063f076144 100644
--- a/src/common/crypto.c
+++ b/src/common/crypto.c
@@ -344,13 +344,6 @@ int crypto_pk_read_private_key_from_filename(crypto_pk_env_t *env, const char *k
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)
diff --git a/src/common/util.c b/src/common/util.c
index e3a918c052..6a162cf070 100644
--- a/src/common/util.c
+++ b/src/common/util.c
@@ -1507,13 +1507,6 @@ char *read_file_to_str(const char *filename) {
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 @@ int replace_file(const char *from, const char *to)
#ifndef MS_WINDOWS
return rename(from,to);
#else
- switch(file_status(to))
+ switch(file_status(to))
{
case FN_NOENT:
break;
diff --git a/src/common/util.h b/src/common/util.h
index f7e4cc7fa7..184a78b66e 100644
--- a/src/common/util.h
+++ b/src/common/util.h
@@ -74,17 +74,6 @@ struct timeval {
#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);