diff options
| author | Mark Wielaard <[email protected]> | 2015-01-15 13:39:06 +0100 |
|---|---|---|
| committer | Mark Wielaard <[email protected]> | 2015-01-16 16:59:46 +0100 |
| commit | cc74c21c0de87cc3c7b293234808b3118c4d85db (patch) | |
| tree | 1f6e3053e2d38a13d1316a9bd8cf14f864658a78 /tests/vdsosyms.c | |
| parent | ddbf23a4594b5a6f1b387b15d42312a203075d80 (diff) | |
tests: Make deleted and vdsosyms testcases work with "restricted ptrace".
Some systems might have "restricted ptrace" that doesn't allow process
inspection of arbitrary processes. Change the deleted testcase to
explicitly allow any other process to inspect it using the PR_SET_PTRACER
prctl set to PR_SET_PTRACER_ANY. Change the vdsosyms testcase to inspect
the process itself which should always be allowed.
Reported-by: Anatol Pomozov <[email protected]>
Signed-off-by: Mark Wielaard <[email protected]>
Diffstat (limited to 'tests/vdsosyms.c')
| -rw-r--r-- | tests/vdsosyms.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/vdsosyms.c b/tests/vdsosyms.c index c1f8d89f..4f12b9a6 100644 --- a/tests/vdsosyms.c +++ b/tests/vdsosyms.c @@ -80,8 +80,9 @@ main (int argc __attribute__ ((unused)), char **argv __attribute__ ((unused))) if (dwfl == NULL) error (2, 0, "dwfl_begin: %s", dwfl_errmsg (-1)); - /* Take our parent as "arbitrary" process to inspect. */ - pid_t pid = getppid(); + /* Take ourself as "arbitrary" process to inspect. This should work + even with "restricted ptrace". */ + pid_t pid = getpid(); int result = dwfl_linux_proc_report (dwfl, pid); if (result < 0) |
