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

[or-cvs] Add quotes around filenames in src/or



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv28785/src/or

Modified Files:
	config.c main.c rendservice.c router.c 
Log Message:
Add quotes around filenames in src/or

Index: config.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.397
retrieving revision 1.398
diff -u -d -r1.397 -r1.398
--- config.c	26 Aug 2005 07:41:19 -0000	1.397
+++ config.c	26 Aug 2005 18:44:26 -0000	1.398
@@ -440,7 +440,7 @@
 
   /* Ensure data directory is private; create if possible. */
   if (check_private_dir(options->DataDirectory, CPD_CREATE) != 0) {
-    log_fn(LOG_ERR, "Couldn't access/create private data directory %s",
+    log_fn(LOG_ERR, "Couldn't access/create private data directory \"%s\"",
            options->DataDirectory);
     return -1;
   }
@@ -969,14 +969,14 @@
         result->value = tor_strdup("");
       break;
     case CONFIG_TYPE_OBSOLETE:
-      log_fn(LOG_WARN,"You asked me for the value of an obsolete config option %s.", key);
+      log_fn(LOG_WARN,"You asked me for the value of an obsolete config option '%s'.", key);
       tor_free(result->key);
       tor_free(result);
       return NULL;
     default:
       tor_free(result->key);
       tor_free(result);
-      log_fn(LOG_WARN,"Bug: unknown type %d for known key %s", var->type, key);
+      log_fn(LOG_WARN,"Bug: unknown type %d for known key '%s'", var->type, key);
       return NULL;
     }
 
@@ -1186,7 +1186,7 @@
     explicit_ip = 0;
     rent = (struct hostent *)gethostbyname(hostname);
     if (!rent) {
-      log_fn(LOG_WARN,"Could not resolve local Address %s. Failing.", hostname);
+      log_fn(LOG_WARN,"Could not resolve local Address '%s'. Failing.", hostname);
       return -1;
     }
     tor_assert(rent->h_length == 4);
@@ -1213,7 +1213,7 @@
     }
   }
 
-  log_fn(LOG_DEBUG, "Resolved Address to %s.", tmpbuf);
+  log_fn(LOG_DEBUG, "Resolved Address to '%s'.", tmpbuf);
   *addr_out = ntohl(in.s_addr);
   if (old_addr && old_addr != *addr_out) {
     log_fn(LOG_NOTICE,"Your IP seems to have changed. Updating.");
@@ -1569,7 +1569,7 @@
     if (server_mode(options)) {
       if (!(options->Nickname = get_default_nickname()))
         return -1;
-      log_fn(LOG_NOTICE, "Choosing default nickname %s", options->Nickname);
+      log_fn(LOG_NOTICE, "Choosing default nickname '%s'", options->Nickname);
     }
   } else {
     if (!is_legal_nickname(options->Nickname)) {
@@ -1986,7 +1986,7 @@
   }
 
   if (strcmp(old->DataDirectory,new_val->DataDirectory)!=0) {
-    log_fn(LOG_WARN,"While Tor is running, changing DataDirectory (%s->%s) is not allowed. Failing.", old->DataDirectory, new_val->DataDirectory);
+    log_fn(LOG_WARN,"While Tor is running, changing DataDirectory (\"%s\"->\"%s\") is not allowed. Failing.", old->DataDirectory, new_val->DataDirectory);
     return -1;
   }
 
@@ -2089,7 +2089,7 @@
                                             &idl))) {
     GetCurrentDirectory(MAX_PATH, path);
     is_set = 1;
-    log_fn(LOG_WARN, "I couldn't find your application data folder: are you running an ancient version of Windows 95? Defaulting to '%s'", path);
+    log_fn(LOG_WARN, "I couldn't find your application data folder: are you running an ancient version of Windows 95? Defaulting to \"%s\"", path);
     return path;
   }
   /* Convert the path from an "ID List" (whatever that is!) to a path. */
@@ -2234,16 +2234,16 @@
     }
   }
   tor_assert(fname);
-  log(LOG_DEBUG, "Opening config file '%s'", fname);
+  log(LOG_DEBUG, "Opening config file \"%s\"", fname);
 
   if (file_status(fname) != FN_FILE ||
       !(cf = read_file_to_str(fname,0))) {
     if (using_default_torrc == 1) {
-      log(LOG_NOTICE, "Configuration file '%s' not present, "
+      log(LOG_NOTICE, "Configuration file \"%s\" not present, "
           "using reasonable defaults.", fname);
       tor_free(fname); /* sets fname to NULL */
     } else {
-      log(LOG_WARN, "Unable to open configuration file '%s'.", fname);
+      log(LOG_WARN, "Unable to open configuration file \"%s\".", fname);
       tor_free(fname);
       goto err;
     }
@@ -2406,7 +2406,7 @@
 
   if (file_opt && !strcasecmp(file_opt->key, "LogFile")) {
     if (add_single_log_option(options, levelMin, levelMax, "file", file_opt->value) < 0) {
-      log_fn(LOG_WARN, "Cannot write to LogFile '%s': %s.", file_opt->value,
+      log_fn(LOG_WARN, "Cannot write to LogFile \"%s\": %s.", file_opt->value,
              strerror(errno));
       return -1;
     }
@@ -2796,13 +2796,13 @@
  if (strncmp(d,"~/",2) == 0) {
    char *fn = expand_filename(d);
    if (!fn) {
-     log_fn(LOG_ERR,"Failed to expand filename '%s'.", d);
+     log_fn(LOG_ERR,"Failed to expand filename \"%s\".", d);
      return -1;
    }
    if (!options->DataDirectory && !strcmp(fn,"/.tor")) {
      /* If our homedir is /, we probably don't want to use it. */
      /* XXXX Default to /var/lib/tor? */
-     log_fn(LOG_WARN, "Default DataDirectory is ~/.tor, which works out to %s, which is probably not what you want.  Using %s/tor instead", fn, LOCALSTATEDIR);
+     log_fn(LOG_WARN, "Default DataDirectory is \"~/.tor\".  This expands to \"%s\", which is probably not what you want.  Using \"%s/tor\" instead", fn, LOCALSTATEDIR);
      tor_free(fn);
      fn = tor_strdup(LOCALSTATEDIR"/tor");
 
@@ -2854,7 +2854,7 @@
       case FN_NOENT:
         break;
       default:
-        log_fn(LOG_WARN,"Config file %s is not a file? Failing.", fname);
+        log_fn(LOG_WARN,"Config file \"%s\" is not a file? Failing.", fname);
         return -1;
     }
   }
@@ -2884,7 +2884,7 @@
         break;
       ++i;
     }
-    log_fn(LOG_NOTICE, "Renaming old configuration file to %s", fn_tmp);
+    log_fn(LOG_NOTICE, "Renaming old configuration file to \"%s\"", fn_tmp);
     rename(fname, fn_tmp);
     tor_free(fn_tmp);
   }
@@ -3168,14 +3168,14 @@
   switch (file_status(fname)) {
     case FN_FILE:
       if (!(contents = read_file_to_str(fname, 0))) {
-        log_fn(LOG_WARN, "Unable to read state file %s", fname);
+        log_fn(LOG_WARN, "Unable to read state file \"%s\"", fname);
         goto done;
       }
       break;
     case FN_NOENT:
       break;
     default:
-      log_fn(LOG_WARN,"State file %s is not a file? Failing.", fname);
+      log_fn(LOG_WARN,"State file \"%s\" is not a file? Failing.", fname);
       goto done;
   }
   new_state = tor_malloc_zero(sizeof(or_state_t));
@@ -3196,7 +3196,7 @@
     goto done;
 
   if (contents)
-    log_fn(LOG_INFO, "Loaded state from %s", fname);
+    log_fn(LOG_INFO, "Loaded state from \"%s\"", fname);
   else
     log_fn(LOG_INFO, "Initialized state");
   or_state_set(new_state);
@@ -3242,12 +3242,12 @@
   tor_free(state);
   fname = get_or_state_fname();
   if (write_str_to_file(fname, contents, 0)<0) {
-    log_fn(LOG_WARN, "Unable to write state to file %s", fname);
+    log_fn(LOG_WARN, "Unable to write state to file \"%s\"", fname);
     tor_free(fname);
     tor_free(contents);
     return -1;
   }
-  log_fn(LOG_INFO, "Saved state to %s", fname);
+  log_fn(LOG_INFO, "Saved state to \"%s\"", fname);
   tor_free(fname);
   tor_free(contents);
 

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.542
retrieving revision 1.543
diff -u -d -r1.542 -r1.543
--- main.c	24 Aug 2005 14:31:32 -0000	1.542
+++ main.c	26 Aug 2005 18:44:26 -0000	1.543
@@ -917,7 +917,7 @@
   if (authdir_mode(options)) {
     /* reload the approved-routers file */
     tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", options->DataDirectory);
-    log_fn(LOG_INFO,"Reloading approved fingerprints from %s...",keydir);
+    log_fn(LOG_INFO,"Reloading approved fingerprints from \"%s\"...",keydir);
     if (dirserv_parse_fingerprint_file(keydir) < 0) {
       log_fn(LOG_NOTICE, "Error reloading fingerprints. Continuing with old list.");
     }
@@ -939,7 +939,7 @@
     }
     tor_snprintf(keydir,sizeof(keydir),"%s/router.desc",
                  options->DataDirectory);
-    log_fn(LOG_INFO,"Saving descriptor to %s...",keydir);
+    log_fn(LOG_INFO,"Saving descriptor to \"%s\"...",keydir);
     if (write_str_to_file(keydir, descriptor, 0)) {
       return 0;
     }

Index: rendservice.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/rendservice.c,v
retrieving revision 1.134
retrieving revision 1.135
diff -u -d -r1.134 -r1.135
--- rendservice.c	13 Aug 2005 00:22:07 -0000	1.134
+++ rendservice.c	26 Aug 2005 18:44:26 -0000	1.135
@@ -122,7 +122,7 @@
   } else {
     smartlist_set_capacity(service->ports, -1);
     smartlist_add(rend_service_list, service);
-    log_fn(LOG_DEBUG,"Configuring service with directory %s",service->directory);
+    log_fn(LOG_DEBUG,"Configuring service with directory \"%s\"",service->directory);
     for (i = 0; i < smartlist_len(service->ports); ++i) {
       char addrbuf[INET_NTOA_BUF_LEN];
       p = smartlist_get(service->ports, i);
@@ -322,7 +322,7 @@
     s = smartlist_get(rend_service_list,i);
     if (s->private_key)
       continue;
-    log_fn(LOG_INFO, "Loading hidden-service keys from '%s'", s->directory);
+    log_fn(LOG_INFO, "Loading hidden-service keys from \"%s\"", s->directory);
 
     /* Check/create directory */
     if (check_private_dir(s->directory, CPD_CREATE) < 0)
@@ -331,7 +331,7 @@
     /* Load key */
     if (strlcpy(fname,s->directory,sizeof(fname)) >= sizeof(fname) ||
         strlcat(fname,"/private_key",sizeof(fname)) >= sizeof(fname)) {
-      log_fn(LOG_WARN, "Directory name too long: '%s'", s->directory);
+      log_fn(LOG_WARN, "Directory name too long: \"%s\"", s->directory);
       return -1;
     }
     s->private_key = init_key_from_file(fname);
@@ -349,7 +349,7 @@
     }
     if (strlcpy(fname,s->directory,sizeof(fname)) >= sizeof(fname) ||
         strlcat(fname,"/hostname",sizeof(fname)) >= sizeof(fname)) {
-      log_fn(LOG_WARN, "Directory name too long: '%s'", s->directory);
+      log_fn(LOG_WARN, "Directory name too long: \"%s\"", s->directory);
       return -1;
     }
     tor_snprintf(buf, sizeof(buf),"%s.onion\n", s->service_id);
@@ -1046,7 +1046,7 @@
 
   for (i=0; i < smartlist_len(rend_service_list); ++i) {
     service = smartlist_get(rend_service_list, i);
-    log(severity, "Service configured in %s:", service->directory);
+    log(severity, "Service configured in \"%s\":", service->directory);
     for (j=0; j < smartlist_len(service->intro_nodes); ++j) {
       nickname = smartlist_get(service->intro_nodes, j);
       router = router_get_by_nickname(smartlist_get(service->intro_nodes,j));

Index: router.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/router.c,v
retrieving revision 1.194
retrieving revision 1.195
diff -u -d -r1.194 -r1.195
--- router.c	26 Aug 2005 15:34:53 -0000	1.194
+++ router.c	26 Aug 2005 18:44:26 -0000	1.195
@@ -145,7 +145,7 @@
       goto error;
   }
   if (crypto_pk_write_private_key_to_filename(prkey, fname)) {
-    log(LOG_ERR, "Couldn't write generated key to %s.", fname);
+    log(LOG_ERR, "Couldn't write generated key to \"%s\".", fname);
     goto error;
   }
   log_fn(LOG_INFO, "Rotating onion key");
@@ -175,7 +175,7 @@
 
   /* The old filename exists, and the new one doesn't.  Rename and load. */
   if (rename(fname_old, fname_new) < 0) {
-    log_fn(LOG_ERR, "Couldn't rename %s to %s: %s", fname_old, fname_new,
+    log_fn(LOG_ERR, "Couldn't rename \"%s\" to \"%s\": %s", fname_old, fname_new,
            strerror(errno));
     return NULL;
   }
@@ -200,10 +200,10 @@
   switch (file_status(fname)) {
     case FN_DIR:
     case FN_ERROR:
-      log(LOG_ERR, "Can't read key from %s", fname);
+      log(LOG_ERR, "Can't read key from \"%s\"", fname);
       goto error;
     case FN_NOENT:
-      log(LOG_INFO, "No key found in %s; generating fresh key.", fname);
+      log(LOG_INFO, "No key found in \"%s\"; generating fresh key.", fname);
       if (crypto_pk_generate_key(prkey)) {
         log(LOG_ERR, "Error generating onion key");
         goto error;
@@ -214,7 +214,7 @@
       }
       log(LOG_INFO, "Generated key seems valid");
       if (crypto_pk_write_private_key_to_filename(prkey, fname)) {
-        log(LOG_ERR, "Couldn't write generated key to %s.", fname);
+        log(LOG_ERR, "Couldn't write generated key to \"%s\".", fname);
         goto error;
       }
       return prkey;
@@ -291,14 +291,14 @@
   /* 1. Read identity key. Make it if none is found. */
   tor_snprintf(keydir,sizeof(keydir),"%s/keys/identity.key",datadir);
   tor_snprintf(keydir2,sizeof(keydir2),"%s/keys/secret_id_key",datadir);
-  log_fn(LOG_INFO,"Reading/making identity key %s...",keydir2);
+  log_fn(LOG_INFO,"Reading/making identity key \"%s\"...",keydir2);
   prkey = init_key_from_file_name_changed(keydir,keydir2);
   if (!prkey) return -1;
   set_identity_key(prkey);
   /* 2. Read onion key.  Make it if none is found. */
   tor_snprintf(keydir,sizeof(keydir),"%s/keys/onion.key",datadir);
   tor_snprintf(keydir2,sizeof(keydir2),"%s/keys/secret_onion_key",datadir);
-  log_fn(LOG_INFO,"Reading/making onion key %s...",keydir2);
+  log_fn(LOG_INFO,"Reading/making onion key \"%s\"...",keydir2);
   prkey = init_key_from_file_name_changed(keydir,keydir2);
   if (!prkey) return -1;
   set_onion_key(prkey);
@@ -337,13 +337,13 @@
   }
 
   tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", datadir);
-  log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir);
+  log_fn(LOG_INFO,"Dumping descriptor to \"%s\"...",keydir);
   if (write_str_to_file(keydir, mydesc,0)) {
     return -1;
   }
   /* 5. Dump fingerprint to 'fingerprint' */
   tor_snprintf(keydir,sizeof(keydir),"%s/fingerprint", datadir);
-  log_fn(LOG_INFO,"Dumping fingerprint to %s...",keydir);
+  log_fn(LOG_INFO,"Dumping fingerprint to \"%s\"...",keydir);
   if (crypto_pk_get_fingerprint(get_identity_key(), fingerprint, 1)<0) {
     log_fn(LOG_ERR, "Error computing fingerprint");
     return -1;
@@ -360,7 +360,7 @@
     return 0;
   /* 6. [authdirserver only] load approved-routers file */
   tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", datadir);
-  log_fn(LOG_INFO,"Loading approved fingerprints from %s...",keydir);
+  log_fn(LOG_INFO,"Loading approved fingerprints from \"%s\"...",keydir);
   if (dirserv_parse_fingerprint_file(keydir) < 0) {
     log_fn(LOG_ERR, "Error loading fingerprints");
     return -1;
@@ -372,13 +372,13 @@
   }
   /* 7. [authdirserver only] load old directory, if it's there */
   tor_snprintf(keydir,sizeof(keydir),"%s/cached-directory", datadir);
-  log_fn(LOG_INFO,"Loading cached directory from %s...",keydir);
+  log_fn(LOG_INFO,"Loading cached directory from \"%s\"...",keydir);
   cp = read_file_to_str(keydir,0);
   if (!cp) {
-    log_fn(LOG_INFO,"Cached directory %s not present. Ok.",keydir);
+    log_fn(LOG_INFO,"Cached directory \"%s\" not present. Ok.",keydir);
   } else {
     if (dirserv_load_from_directory_string(cp) < 0) {
-      log_fn(LOG_WARN, "Cached directory %s is corrupt, only loaded part of it.", keydir);
+      log_fn(LOG_WARN, "Cached directory \"%s\" is corrupt, only loaded part of it.", keydir);
       tor_free(cp);
       return 0;
     }