summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-admin/checksec/files/_checksec')
-rw-r--r--app-admin/checksec/files/_checksec18
1 files changed, 18 insertions, 0 deletions
diff --git a/app-admin/checksec/files/_checksec b/app-admin/checksec/files/_checksec
new file mode 100644
index 00000000..b30e0160
--- /dev/null
+++ b/app-admin/checksec/files/_checksec
@@ -0,0 +1,18 @@
+#compdef checksec
+_checksec_procname() {
+ compadd "$expl[@]" ${${${${(f)"$(_call_program processes-names ps ${${EUID/(#s)0(#e)/xa}//[0-9]#/}ho command 2> /dev/null)"//[][\(\)]/}:#(ps|COMMAND|-*)}%%\ *}:t}
+}
+_arguments : \
+'--help[print help]' \
+'--version[print version]' \
+'--file[FILE (check FILE)]:file to check:_files' \
+'--fortify-file[FILE (check FILE for fortify)]:file for fortify:_files' \
+'--fortify-proc[ID (check ID'\''s process for fortify)]:process ID for fortify: _pids' \
+'--proc[NAME (check process NAME)]:process name:_checksec_procname' \
+'--proc-all[check all procname]' \
+'--proc-libs[ID (check ID'\''s process libs)]:process ID to check: _pids' \
+'--kernel[check kernel]' \
+'--dir[DIR \[-v\] (check DIR)]:dir:_files -/'
+local stat=$?
+unset -f _checksec_procname
+return stat