Skip to content

Commit 15c1d09

Browse files
authored
Update management.py (#92)
Fix bug with windows binary path management
1 parent 705e5b9 commit 15c1d09

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

osquery/management.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,12 @@ def emit(self, record):
4242
# We bootleg our own version of Windows pipe coms
4343
from osquery.TPipe import TPipe
4444
from osquery.TPipe import TPipeServer
45-
if os.path.exists(os.environ["PROGRAMDATA"] + "\\osquery\\osqueryd\\osqueryd.exe"):
46-
WINDOWS_BINARY_PATH = os.environ["PROGRAMDATA"] + "\\osquery\\osqueryd\\osqueryd.exe"
47-
if os.path.exists(os.environ["PROGRAMW6432"] + "\\osquery\\osqueryd\\osqueryd.exe"):
48-
WINDOWS_BINARY_PATH = os.environ["PROGRAMW6432"] + "\\osquery\\osqueryd\\osqueryd.exe"
45+
PTH = os.path.join(os.environ["PROGRAMDATA"], "osquery", "osqueryd", "osqueryd.exe")
46+
if os.path.exists(PTH):
47+
WINDOWS_BINARY_PATH = PTH
48+
PTH = os.path.join(os.environ["PROGRAMW6432"], "osquery", "osqueryd", "osqueryd.exe")
49+
if os.path.exists(PTH):
50+
WINDOWS_BINARY_PATH = PTH
4951

5052
DARWIN_BINARY_PATH = "/usr/local/bin/osqueryd"
5153
LINUX_BINARY_PATH = "/usr/bin/osqueryd"

0 commit comments

Comments
 (0)