diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:42:04 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 07:42:04 +0000 |
commit | 0d47952611198ef6b1163f366dc03922d20b1475 (patch) | |
tree | 3d840a3b8c0daef0754707bfb9f5e873b6b1ac13 /zenmap/install_scripts/unix | |
parent | Initial commit. (diff) | |
download | nmap-0d47952611198ef6b1163f366dc03922d20b1475.tar.xz nmap-0d47952611198ef6b1163f366dc03922d20b1475.zip |
Adding upstream version 7.94+git20230807.3be01efb1+dfsg.upstream/7.94+git20230807.3be01efb1+dfsgupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'zenmap/install_scripts/unix')
-rwxr-xr-x | zenmap/install_scripts/unix/su-to-zenmap.sh | 57 | ||||
-rw-r--r-- | zenmap/install_scripts/unix/zenmap-root.desktop | 11 | ||||
-rw-r--r-- | zenmap/install_scripts/unix/zenmap.desktop | 11 |
3 files changed, 79 insertions, 0 deletions
diff --git a/zenmap/install_scripts/unix/su-to-zenmap.sh b/zenmap/install_scripts/unix/su-to-zenmap.sh new file mode 100755 index 0000000..9216a4e --- /dev/null +++ b/zenmap/install_scripts/unix/su-to-zenmap.sh @@ -0,0 +1,57 @@ +#!/bin/sh +#this code is bassed off of the debian su-to-root command +#Joost Witteveen <joostje@debian.org> +#Morten Brix Pedersen +#Bill Allombert <ballombe@debian.org> + +PRIV=root +COMMAND="zenmap" + +quote () { printf %s\\n "$1" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/'/" ; } + +for i in "$@"; do + COMMAND="$COMMAND $(quote "$i")" +done + +euid=$(id -u) +privid=$(id -u $PRIV) +if test "$euid" = "$privid"; then + $COMMAND +else + if test -z "$SU_TO_ROOT_X"; then + if which gksu >/dev/null 2>&1 ; then + SU_TO_ROOT_X=gksu + if test "X$KDE_FULL_SESSION" = "Xtrue" ; then + if which kdesu >/dev/null 2>&1 ; then + SU_TO_ROOT_X=kdesu + elif test -x /usr/lib/kde4/libexec/kdesu ; then + SU_TO_ROOT_X=kde4su + fi; + fi; + elif which kdesu >/dev/null 2>&1 ; then + SU_TO_ROOT_X=kdesu + elif test -x /usr/lib/kde4/libexec/kdesu ; then + SU_TO_ROOT_X=kde4su + elif which ktsuss >/dev/null 2>&1 ; then + SU_TO_ROOT_X=ktsuss + elif which xterm>/dev/null 2>&1 ;then + if which sudo>/dev/null 2>&1 ;then + SU_TO_ROOT_X=sdterm + else + SU_TO_ROOT_X=sterm + fi; + else + SU_TO_ROOT_X=su-to-root + fi + fi + case $SU_TO_ROOT_X in + gksu) gksu -u "$PRIV" "$COMMAND";; + kdesu) kdesu -u "$PRIV" -c "$COMMAND";; + kde4su) /usr/lib/kde4/libexec/kdesu -u "$PRIV" -c "$COMMAND";; + ktsuss) ktsuss -u "$PRIV" "$COMMAND";; + # As a last resort, open a new xterm use sudo/su + sdterm) xterm -e "sudo -u $PRIV $COMMAND";; + sterm) xterm -e "su -l $PRIV -c $COMMAND";; + esac; +fi + diff --git a/zenmap/install_scripts/unix/zenmap-root.desktop b/zenmap/install_scripts/unix/zenmap-root.desktop new file mode 100644 index 0000000..c5f4c10 --- /dev/null +++ b/zenmap/install_scripts/unix/zenmap-root.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Zenmap (as root) +GenericName=GUI Port Scanner +TryExec=su-to-zenmap.sh +Exec=su-to-zenmap.sh %F +Terminal=false +Icon=zenmap +Type=Application +Categories=Application;Network;Security; +Comment=A cross-platform GUI for the Nmap Security Scanner. +Keywords=network;scan;scanner;IP;security; diff --git a/zenmap/install_scripts/unix/zenmap.desktop b/zenmap/install_scripts/unix/zenmap.desktop new file mode 100644 index 0000000..b27d342 --- /dev/null +++ b/zenmap/install_scripts/unix/zenmap.desktop @@ -0,0 +1,11 @@ +[Desktop Entry] +Name=Zenmap +GenericName=GUI Port Scanner +TryExec=zenmap +Exec=zenmap %F +Terminal=false +Icon=zenmap +Type=Application +Categories=Application;Network;Security; +Comment=A cross-platform GUI for the Nmap Security Scanner. +Keywords=network;scan;scanner;IP;security; |