diff options
author | 2023-02-24 20:44:48 -0500 | |
---|---|---|
committer | 2023-02-24 20:44:48 -0500 | |
commit | d657245f7353f692c22db2801ac64f7d807eb415 (patch) | |
tree | 5494cbde66f9fb6220df8a72415a6160f130a6b9 /contrib/syscalls.sh | |
parent | Merge pull request #5677 from kmk3/print-failed-long-arg (diff) | |
parent | editorconfig: add indentation rules (diff) | |
download | firejail-d657245f7353f692c22db2801ac64f7d807eb415.tar.gz firejail-d657245f7353f692c22db2801ac64f7d807eb415.tar.zst firejail-d657245f7353f692c22db2801ac64f7d807eb415.zip |
Merge pull request #5674 from kmk3/fix-ws-add-editorconfig
build: Fix whitespace and add .editorconfig
Diffstat (limited to 'contrib/syscalls.sh')
-rwxr-xr-x | contrib/syscalls.sh | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/contrib/syscalls.sh b/contrib/syscalls.sh index 2c5bdf5ec..aece84e72 100755 --- a/contrib/syscalls.sh +++ b/contrib/syscalls.sh | |||
@@ -8,22 +8,22 @@ SYSCALLS_OUTPUT_FILE="$(pwd)/syscalls.txt" | |||
8 | 8 | ||
9 | if [ $# -eq 0 ] | 9 | if [ $# -eq 0 ] |
10 | then | 10 | then |
11 | echo | 11 | echo |
12 | echo " *** No program specified!!! ***" | 12 | echo " *** No program specified!!! ***" |
13 | echo | 13 | echo |
14 | echo -e "Make this file executable and execute it as:\\n" | 14 | echo -e "Make this file executable and execute it as:\\n" |
15 | echo -e "\\e[96m syscalls.sh /full/path/to/program\\n" | 15 | echo -e "\\e[96m syscalls.sh /full/path/to/program\\n" |
16 | echo -e "\\e[39mif you saved this script in a directory in your PATH (e.g., in ${HOME}/bin), otherwise as:\\n" | 16 | echo -e "\\e[39mif you saved this script in a directory in your PATH (e.g., in ${HOME}/bin), otherwise as:\\n" |
17 | echo -e "\\e[96m ./syscalls.sh /full/path/to/program\\n" | 17 | echo -e "\\e[96m ./syscalls.sh /full/path/to/program\\n" |
18 | echo -e "\\e[39mUse the full path to the respective program to avoid executing it sandboxed with Firejail\\n(if a Firejail profile for it already exits and 'sudo firecfg' was executed earlier)\\nin order to determine the necessary system calls." | 18 | echo -e "\\e[39mUse the full path to the respective program to avoid executing it sandboxed with Firejail\\n(if a Firejail profile for it already exits and 'sudo firecfg' was executed earlier)\\nin order to determine the necessary system calls." |
19 | echo | 19 | echo |
20 | exit 0 | 20 | exit 0 |
21 | else | 21 | else |
22 | strace -cfo "$STRACE_OUTPUT_FILE" "$@" && awk '{print $NF}' "$STRACE_OUTPUT_FILE" | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > "$SYSCALLS_OUTPUT_FILE" | 22 | strace -cfo "$STRACE_OUTPUT_FILE" "$@" && awk '{print $NF}' "$STRACE_OUTPUT_FILE" | sed '/syscall\|-\|total/d' | sort -u | awk -vORS=, '{ print $1 }' | sed 's/,$/\n/' > "$SYSCALLS_OUTPUT_FILE" |
23 | echo | 23 | echo |
24 | echo -e "\e[39mThese are the sorted syscalls:\n\e[93m" | 24 | echo -e "\e[39mThese are the sorted syscalls:\n\e[93m" |
25 | cat "$SYSCALLS_OUTPUT_FILE" | 25 | cat "$SYSCALLS_OUTPUT_FILE" |
26 | echo | 26 | echo |
27 | echo -e "\e[39mThe sorted syscalls were saved to:\n\e[96m$SYSCALLS_OUTPUT_FILE\n\e[39m" | 27 | echo -e "\e[39mThe sorted syscalls were saved to:\n\e[96m$SYSCALLS_OUTPUT_FILE\n\e[39m" |
28 | exit 0 | 28 | exit 0 |
29 | fi | 29 | fi |