Skip to content

Commit

Permalink
(Limited) support for FreeBSD and OpenBSD
Browse files Browse the repository at this point in the history
  • Loading branch information
p-e-w committed Jan 30, 2016
1 parent c9469d8 commit d6ebbf6
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
10 changes: 9 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,22 @@ That being said, `maybe` **should :warning: NEVER :warning: be used to run untru

## Installation

`maybe` requires [Python](https://www.python.org/) 2.7+/3.2+ :snake:. It has been tested on Linux :penguin:, but should work on most Unixes, possibly including OS X. If you have the [pip](https://pip.pypa.io) package manager, all you need to do is run
`maybe` requires [Python](https://www.python.org/) 2.7+/3.2+ :snake:. If you have the [pip](https://pip.pypa.io) package manager, all you need to do is run

```
pip install maybe
```

either as a superuser or from a [virtualenv](https://virtualenv.pypa.io) environment.

### Operating system support

| OS | Support status |
| --- | --- |
| Linux | :white_check_mark: Full support |
| FreeBSD / OpenBSD | :ballot_box_with_check: Limited support (subprocesses can not be intercepted) |
| OS X | :question: Might be supported in future pending OS X support in python-ptrace |


## Usage

Expand Down
8 changes: 6 additions & 2 deletions maybe/maybe.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from ptrace.tools import locateProgram
from ptrace.debugger import ProcessSignal, NewProcessEvent, ProcessExecution, ProcessExit
from ptrace.debugger.child import createChild
from ptrace.debugger.debugger import PtraceDebugger
from ptrace.debugger.debugger import PtraceDebugger, DebuggerError
from ptrace.func_call import FunctionCallOptions
from ptrace.syscall import SYSCALL_PROTOTYPES, FILENAME_ARGUMENTS
from ptrace.syscall.posix_constants import SYSCALL_ARG_DICT
Expand Down Expand Up @@ -145,8 +145,12 @@ def main():
exit(1)

debugger = PtraceDebugger()
debugger.traceFork()
debugger.traceExec()
try:
debugger.traceFork()
except DebuggerError:
print(T.yellow("Warning: Running without traceFork support. " +
"Syscalls from subprocesses can not be intercepted."))

process = debugger.addProcess(pid, True)
prepareProcess(process)
Expand Down
4 changes: 4 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@

"License :: OSI Approved :: GNU General Public License v3 (GPLv3)",

"Operating System :: POSIX :: Linux",
"Operating System :: POSIX :: BSD :: FreeBSD",
"Operating System :: POSIX :: BSD :: OpenBSD",

"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
Expand Down

0 comments on commit d6ebbf6

Please sign in to comment.