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

[tor-commits] [arm/release] fix: getProcessName should return the base name



commit 3f71b5115476a27d6fc58260a6a72125a6a92297
Author: Damian Johnson <atagar@xxxxxxxxxxxxxx>
Date:   Sun Dec 18 14:38:10 2011 -0800

    fix: getProcessName should return the base name
    
    When the proc query failed the fallback ps command would return the command's
    full path rather than just the base name. This in turn would make lookups that
    use this value (like netstat) fail. Caught by Stephan Seitz.
---
 src/util/sysTools.py |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/src/util/sysTools.py b/src/util/sysTools.py
index 4bb0667..1c84462 100644
--- a/src/util/sysTools.py
+++ b/src/util/sysTools.py
@@ -152,6 +152,7 @@ def getProcessName(pid, default = None, cacheFailure = True):
       
       return default
   else:
+    processName = os.path.basename(processName)
     PROCESS_NAME_CACHE[pid] = processName
     return processName
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits