From 341c375ec65e8bee313de147242c76442c57b33b Mon Sep 17 00:00:00 2001 From: glarkin Date: Tue, 19 Jan 2010 14:52:14 +0000 Subject: Provide a fast way to delete entries from OpenSSH's known_hosts file. This is a simple automation of the things normally done by the user when having an "offending key" in his/her known_hosts file caused by a changing host key of the destination. WWW: http://unssh.sourceforge.net/ PR: ports/137254 Submitted by: Dax Labrador --- security/Makefile | 1 + security/unssh/Makefile | 35 ++++++++++++++++++++++++++++ security/unssh/distinfo | 3 +++ security/unssh/files/extra-patch-unssh.sh.in | 26 +++++++++++++++++++++ security/unssh/pkg-descr | 6 +++++ 5 files changed, 71 insertions(+) create mode 100644 security/unssh/Makefile create mode 100644 security/unssh/distinfo create mode 100644 security/unssh/files/extra-patch-unssh.sh.in create mode 100644 security/unssh/pkg-descr diff --git a/security/Makefile b/security/Makefile index d80fa5815285..2b0ccc431c09 100644 --- a/security/Makefile +++ b/security/Makefile @@ -840,6 +840,7 @@ SUBDIR += umit SUBDIR += unhide SUBDIR += unicornscan + SUBDIR += unssh SUBDIR += vida SUBDIR += vinetto SUBDIR += vlock diff --git a/security/unssh/Makefile b/security/unssh/Makefile new file mode 100644 index 000000000000..df012d93cc92 --- /dev/null +++ b/security/unssh/Makefile @@ -0,0 +1,35 @@ +# New ports collection makefile for: unssh +# Date created: 30 July 2009 +# Whom: Dax Labrador +# +# $FreeBSD$ +# + +PORTNAME= unssh +PORTVERSION= 1.4 +CATEGORIES= security +MASTER_SITES= SF +MASTER_SITE_SUBDIR= ${PORTNAME:L}/${PORTNAME:L}/${PORTNAME:L}-${PORTVERSION} + +MAINTAINER= semprix@bsdmail.org +COMMENT= Fast way to delete entries from OpenSSH known_hosts file + +RUN_DEPENDS= bash:${PORTSDIR}/shells/bash + +NO_BUILD= yes +PLIST_FILES= bin/unssh + +PATCH_LIST= extra-patch-unssh.sh +EXTRA_PATCHES= ${PATCH_LIST:C|^|${WRKDIR}/|g} + +pre-patch: +.for patch in ${PATCH_LIST} + @${SED} ${_SUB_LIST_TEMP} ${FILESDIR}/${patch}.in > ${WRKDIR}/${patch} +.endfor + +do-install: + @${INSTALL} -d ${PREFIX}/bin + @${CP} ${WRKSRC}/unssh.sh ${PREFIX}/bin/unssh + @${CHMOD} ${BINMODE} ${PREFIX}/bin/unssh + +.include diff --git a/security/unssh/distinfo b/security/unssh/distinfo new file mode 100644 index 000000000000..a6441c28f935 --- /dev/null +++ b/security/unssh/distinfo @@ -0,0 +1,3 @@ +MD5 (unssh-1.4.tar.gz) = c5045e0420a4ac81f53499f59e071915 +SHA256 (unssh-1.4.tar.gz) = 8252d0818d044452241a279031a903634b983cf94e4671e32f4df5a754f686f2 +SIZE (unssh-1.4.tar.gz) = 11381 diff --git a/security/unssh/files/extra-patch-unssh.sh.in b/security/unssh/files/extra-patch-unssh.sh.in new file mode 100644 index 000000000000..1fa941866a5e --- /dev/null +++ b/security/unssh/files/extra-patch-unssh.sh.in @@ -0,0 +1,26 @@ +--- ./unssh.sh.orig 2009-07-12 19:31:45.000000000 -0400 ++++ ./unssh.sh 2010-01-18 17:57:11.000000000 -0500 +@@ -1,4 +1,4 @@ +-#!/bin/bash ++#!%%LOCALBASE%%/bin/bash + # This simple script helps deleting hosts from the user's known_hosts + # file when their pubkey has changed. + # Copyright (C) 2006-2009 by Phil Sutter +@@ -52,7 +52,7 @@ + return $1 + } + search_in_sshcnf() { # (expr) +- grep -qi "^host $1$" $SSH_CNF || return 1 ++ grep -qi "^host $1$" $SSH_CNF >/dev/null 2>&1 || return 1 + # the code below calls awk in three steps: + # * filter empty and commented out lines + # * divide content into records containing a single "Host" definition +@@ -107,7 +107,7 @@ + name="$1" + fi + # does a host lookup to get the corresponding IP/hostname +- eval "$(hostx "$name" 2>&1 | \ ++ eval "$(nslookup "$name" 2>&1 | \ + awk '/exist/{exit 1} \ + /Name:/{print "LU_HOST="$2} \ + /Address:/{print "LU_IP="$2} \ diff --git a/security/unssh/pkg-descr b/security/unssh/pkg-descr new file mode 100644 index 000000000000..538d75f12adb --- /dev/null +++ b/security/unssh/pkg-descr @@ -0,0 +1,6 @@ +Provide a fast way to delete entries from OpenSSH's known_hosts +file. This is a simple automation of the things normally done by +the user when having an "offending key" in his/her known_hosts file +caused by a changing host key of the destination. + +WWW: http://unssh.sourceforge.net/ -- cgit