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

[vidalia-svn] r3754: TorProcess monkeys with the output, since it has to do the l (vidalia/trunk/src/vidalia/config)



Author: edmanm
Date: 2009-05-01 22:34:52 -0400 (Fri, 01 May 2009)
New Revision: 3754

Modified:
   vidalia/trunk/src/vidalia/config/TorSettings.cpp
Log:

TorProcess monkeys with the output, since it has to do the log message
parsing too. So just copy over the PATH+=:/usr/sbin hack to the QProcess.


Modified: vidalia/trunk/src/vidalia/config/TorSettings.cpp
===================================================================
--- vidalia/trunk/src/vidalia/config/TorSettings.cpp	2009-05-02 01:25:44 UTC (rev 3753)
+++ vidalia/trunk/src/vidalia/config/TorSettings.cpp	2009-05-02 02:34:52 UTC (rev 3754)
@@ -16,7 +16,6 @@
 
 #include "TorSettings.h"
 #include "Vidalia.h"
-#include "TorProcess.h"
 #include "crypto.h"
 #if defined(Q_OS_WIN32)
 #include "win32.h"
@@ -358,10 +357,21 @@
 TorSettings::hashPassword(const QString &password)
 {
   TorSettings settings;
-  TorProcess tor;
+  QProcess tor;
   QString dataDirectory, line;
   QStringList args;
 
+  QStringList env = QProcess::systemEnvironment();
+#if !defined(Q_OS_WIN32)
+  /* Add "/usr/sbin" to an existing $PATH, so this works on Debian too. */
+  for (int i = 0; i < env.size(); i++) {
+    QString envVar = env.at(i);
+    if (envVar.startsWith("PATH="))
+      env.replace(i, envVar += ":/usr/sbin");
+  }
+#endif
+  tor.setEnvironment(env);
+
   /* Tor writes its state file even if all we're doing is --hash-password. So
    * if the user has configured a non-default data directory, then include
    * that in the list of command line arguments. */