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

atagar at torproject.org atagar at torproject.org
Sun Apr 29 04:00:59 UTC 2012


commit 3f71b5115476a27d6fc58260a6a72125a6a92297
Author: Damian Johnson <atagar at torproject.org>
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
 





More information about the tor-commits mailing list