1
0
mirror of https://github.com/nmap/nmap.git synced 2025-12-09 06:01:28 +00:00
Files
nmap/zenmap/install_scripts/unix/su-to-zenmap.sh
david ed2ba4e168 Copy nping, nsock, nbase, zenmap, ncat from their homes in /.
If you have trouble updating after this revision you need to follow
these instructions. You have probably just seen an error like this:

svn: URL 'svn://svn.insecure.org/nping' of existing directory 'nping'
does not match expected URL 'svn://svn.insecure.org/nmap/nping'

This is caused by the replacement of SVN externals.

Here's what you need to do. First, save any local changes you might have
in the nping, nsock, nbase, ncat, and zenmap directories. (For example
by running "cd nping; svn diff > ../nping.diff".) If you don't have any
local changes you can skip this step.

Then run these commands:

rm -rf nping/ nsock/ nbase/ ncat/ zenmap/
svn update
svn cleanup

If all else fails, you can just delete your whole working directory and
check out anew:

svn co --username guest --password "" svn://svn.insecure.org/nmap

There may be further discussion in the mailing list thread at
http://seclists.org/nmap-dev/2011/q4/303.
2011-11-16 21:49:44 +00:00

52 lines
1.5 KiB
Bash
Executable File

#!/bin/bash
#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 $@"
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" "$COMMAND";;
kde4su) /usr/lib/kde4/libexec/kdesu -u "$PRIV" "$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