summaryrefslogtreecommitdiffstats
path: root/redhat/tdelibs/kdelibs-3.5.13-fix_tdesu_internal_pathing.patch
blob: deb93afaa91a204a96361b7a37d164332ad234b7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
commit e131f10b84dbec07ad49d36c192777a72189a39e
Author: Timothy Pearson <kb9vqf@pearsoncomputing.net>
Date:   1329026747 -0600

    Fix tdesu internal pathing
    This closes Bug 766

diff --git a/tdesu/stub.cpp b/tdesu/stub.cpp
index 7f083d7..5b222f5 100644
--- a/kdesu/stub.cpp
+++ b/kdesu/stub.cpp
@@ -121,11 +121,16 @@ int StubProcess::ConverseStub(int check)
 	    TQCString path = getenv("PATH");
             if (!path.isEmpty() && path[0] == ':')
                 path = path.mid(1);
-	    if (m_User == "root") 
-		if (!path.isEmpty())
-		    path = "/sbin:/bin:/usr/sbin:/usr/bin:" + path;
-		else
-		    path = "/sbin:/bin:/usr/sbin:/usr/bin";
+	    if (m_User == "root")
+	       if (!path.isEmpty())
+	          path = "/usr/local/sbin:/usr/sbin:/sbin:" + path;
+	       else
+                  if (strcmp(__KDE_BINDIR, "/usr/bin") == 0) {
+		          path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin";
+		  }
+		  else {
+			  path = "/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:" __KDE_BINDIR ":/usr/bin:/bin";
+		  }
 	    writeLine(path);
 	} else if (line == "user") {
 	    writeLine(m_User);