-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
tools/opensnoop: Display mode for -e, --extended_fields
When a program creates a file with mode=0000, it cannot even access the file itself. It would be helpful if we could track the mode value. so we can know who did it. Example: open("a.txt", O_WRONLY | O_EXCL | O_CREAT, 0000); Then: $ ls -l a.txt ----------. 1 rongtao rongtao 0 Jan 24 09:07 a.txt $ cat a.txt cat: a.txt: Permission denied $ sudo ./opensnoop.py -e PID COMM FD ERR FLAGS MODE PATH 673067 open 3 0 00000301 n/a a.txt ^^^^ If flags is an illegal value, displaying the mode value can better handle the relationship between flags and mode. After all, mode is only effective when flags only contains O_TMPFILE or O_CREAT. Signed-off-by: Rong Tao <rongtao@cestc.cn>
- Loading branch information
Showing
2 changed files
with
67 additions
and
27 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
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