-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
40 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
On some Linux versions it may be impossible for non-root users to read smaps files. | ||
|
||
The file may appear to allow read: | ||
|
||
```text | ||
$ ls -l /proc/$$/smaps | ||
-r--r--r-- 1 oracle oinstall 0 Apr 1 14:26 /proc/28953/smaps | ||
``` | ||
|
||
Even so, the Linux capabilities system may prevent you from reading the file. | ||
|
||
This can be changed by setting the `CAP_SYS_PTRACE' capability for `cat`: | ||
|
||
```text | ||
# getcap /usr/bin/cat | ||
# setcap cap_sys_ptrace+ep /usr/bin/cat | ||
# getcap /usr/bin/cat | ||
/usr/bin/cat = cap_sys_ptrace+ep | ||
``` | ||
|
||
While it may not be a good idea to do this to `cat`, it is fine on this test system. | ||
|
||
And now oracle can read its own smaps file: | ||
|
||
```text | ||
$ wc /proc/$$/smaps | ||
756 2522 23287 /proc/28953/smaps | ||
``` | ||
|
||
More information is available via `man capabilities` | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|