]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Treat unset $HOME like empty $HOME
authorSebastian Hahn <sebastian@torproject.org>
Mon, 7 Jun 2010 00:18:01 +0000 (02:18 +0200)
committerSebastian Hahn <sebastian@torproject.org>
Mon, 7 Jun 2010 00:18:01 +0000 (02:18 +0200)
This means Tor no longer dies when it doesn't have a $HOME.

changes/bug1522 [new file with mode: 0644]
src/common/util.c

diff --git a/changes/bug1522 b/changes/bug1522
new file mode 100644 (file)
index 0000000..e120913
--- /dev/null
@@ -0,0 +1,3 @@
+ o Minor bugfixes
+   - Treat an unset $HOME like an empty $HOME. Fixes bug 1522; bugfix on
+     tor-0.0.8pre1.
index fe48e932845f1e2309f86ed85e9b9e5fb75ce749..748e23bab1d42bbe68bdfd65141e9d18f41b6d48 100644 (file)
@@ -2323,12 +2323,10 @@ expand_filename(const char *filename)
 
     if (filename[1] == '/' || filename[1] == '\0') {
       home = getenv("HOME");
-      if (!home) {
-        log_warn(LD_CONFIG, "Couldn't find $HOME environment variable while "
-                 "expanding \"%s\"", filename);
-        return NULL;
-      }
-      home = tor_strdup(home);
+      if (!home)
+        home = tor_strdup("");
+      else
+        home = tor_strdup(home);
       rest = strlen(filename)>=2?(filename+2):"";
     } else {
 #ifdef HAVE_PWD_H