Skip to content

Commit

Permalink
Ubuntu injector fix; tighten test condition
Browse files Browse the repository at this point in the history
  • Loading branch information
gruuya committed Mar 23, 2021
1 parent e323efd commit 53c2973
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
6 changes: 3 additions & 3 deletions django_sql_sniffer/injector.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ def inject(pid, code_to_inject, verbose=True):
command = ["lldb", "-p", pid, "-b"] + args
else:
args = [
"-eval-command='call PyGILState_Ensure()'",
f"-eval-command='call PyRun_SimpleString(\"exec(open(\\\"{temp_file.name}\\\").read())\")'",
"-eval-command='call PyGILState_Release($1)'"
"-eval-command='call (char *) PyGILState_Ensure()'",
f"-eval-command='call (void) PyRun_SimpleString(\"exec(open(\\\"{temp_file.name}\\\").read())\")'",
"-eval-command='call (void) PyGILState_Release($1)'"
]
command = ["gdb", "-p", pid, "-batch"] + args

Expand Down
3 changes: 1 addition & 2 deletions tests/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ def dummy_query_executor():
tp.kill()

# check all queries captured
for query in queries:
assert query in lt.analyzer._executed_queries
assert set(queries) == set(lt.analyzer._executed_queries.keys())

# check that listener shuts down once it detects the target process is not alive
time.sleep(4)
Expand Down

0 comments on commit 53c2973

Please sign in to comment.