Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 08 Jan 2013 04:24:42 +0100
From:      nemysis <nemysis@gmx.ch>
To:        FreeBSD-gnats-submit@freebsd.org
Subject:   ports/175120: [MAINTAINER] security/zenmap: Fixed su-to-zenmap.sh and zenmap-root.desktop, removed PKGNAMEPREFIX
Message-ID:  <20130108032445.86D404F0@hub.freebsd.org>
Resent-Message-ID: <201301080330.r083U0ul065693@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         175120
>Category:       ports
>Synopsis:       [MAINTAINER] security/zenmap: Fixed su-to-zenmap.sh and zenmap-root.desktop, removed PKGNAMEPREFIX
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Tue Jan 08 03:30:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     nemysis
>Release:        FreeBSD 9.0-RELEASE amd64
>Organization:
>Environment:
System: FreeBSD FreeBSD_Ports 9.0-RELEASE FreeBSD 9.0-RELEASE #0: Tue Jan  3 07:46:30 UTC
>Description:

Added file(s):
- files/pc-su
Use excellent script from
    http://trac.pcbsd.org/browser/pcbsd/current/src-sh/pc-su
because old su-to-zenmap.sh is imported from Debian GNU/Linux very complicated,
and must be patched to works in KDE4.

Makefile changed:
Removed because isn't needed, and have had OptionsNG Problems are not changed
-PKGNAMEPREFIX=>${PYTHON_PKGNAMEPREFIX}

+post-extract:
+	@${RM} -f ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+	@${CP} -a ${FILESDIR}/pc-su ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh

 post-patch:
+	@${REINPLACE_CMD} -e 's|su-to-zenmap.sh %F|su-to-zenmap.sh ${PORTNAME}|' \
+		${WRKSRC}/install_scripts/unix/zenmap-root.desktop
Changed that PC-BSD script pc-su can works.

Generated and tested manually, tested with port test, sent with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)
>How-To-Repeat:

portlint -A
looks usual.

port test: clean

>Fix:

--- zenmap-6.25_1.patch begins here ---
diff -ruN --exclude=CVS /usr/ports/security/zenmap/Makefile ./Makefile
--- /usr/ports/security/zenmap/Makefile	2013-01-05 00:40:52.000000000 +0100
+++ ./Makefile	2013-01-08 04:13:03.000000000 +0100
@@ -3,9 +3,9 @@
 
 PORTNAME=	zenmap
 PORTVERSION=	6.25
+PORTREVISION=	1
 CATEGORIES=	security ipv6
 MASTER_SITES=	http://nmap.org/dist/
-PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 DISTNAME=	nmap-${PORTVERSION}
 
 MAINTAINER=	nemysis@gmx.ch
@@ -37,7 +37,13 @@
 PLIST_SUB+=	NLS="@comment "
 .endif
 
+post-extract:
+	@${RM} -f ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+	@${CP} -a ${FILESDIR}/pc-su ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+
 post-patch:
+	@${REINPLACE_CMD} -e 's|su-to-zenmap.sh %F|su-to-zenmap.sh ${PORTNAME}|' \
+		${WRKSRC}/install_scripts/unix/zenmap-root.desktop
 	@${REINPLACE_CMD} \
 		-e '/self.create_uninstaller/s|^|#|' ${WRKSRC}/setup.py
 	@${REINPLACE_CMD} \
diff -ruN --exclude=CVS /usr/ports/security/zenmap/files/pc-su ./files/pc-su
--- /usr/ports/security/zenmap/files/pc-su	1970-01-01 01:00:00.000000000 +0100
+++ ./files/pc-su	2012-12-03 17:03:57.000000000 +0100
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Wrapper script which finds the right "su" program
+# to use for graphical root execution
+
+if [ `id -r -u` != "0" ] ; then
+	VARS="`echo $@`"
+	
+	# Try qsu first, should always be the default
+        which qsu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           qsu $VARS
+           exit $? 
+        fi
+
+	# Now try gksu
+        which gksu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           gksu -a "$VARS"
+           exit $? 
+        fi
+
+	# Lastly we have kdesu
+        which kdesu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           kdesu -t -c "$VARS"
+           exit $? 
+        fi
+	
+	# If no utility could be found...
+	echo "No graphical switch-user utility found!"
+	exit 1
+else
+	${@}
+fi
--- zenmap-6.25_1.patch ends here ---

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20130108032445.86D404F0>