From huntting@glarp.com  Mon Mar 26 08:52:06 2007
Return-Path: <huntting@glarp.com>
Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52])
	by hub.freebsd.org (Postfix) with ESMTP id BBBE916A401
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2007 08:52:06 +0000 (UTC)
	(envelope-from huntting@glarp.com)
Received: from refuge.cryptolect.com (refuge.cryptolect.com [63.231.80.17])
	by mx1.freebsd.org (Postfix) with ESMTP id 659D613C469
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2007 08:52:06 +0000 (UTC)
	(envelope-from huntting@glarp.com)
Received: from antediluvian.glarp.com (71-212-186-241.hlrn.qwest.net [71.212.186.241])
	(using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by refuge.cryptolect.com (Postfix) with ESMTP id 9C2995088E
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2007 02:19:48 -0600 (MDT)
Received: from antediluvian.glarp.com (localhost [127.0.0.1])
	by antediluvian.glarp.com (8.14.0/8.13.6) with ESMTP id l2Q8Jj3d017408
	(version=TLSv1/SSLv3 cipher=DHE-DSS-AES256-SHA bits=256 verify=NOT)
	for <FreeBSD-gnats-submit@freebsd.org>; Mon, 26 Mar 2007 02:19:46 -0600 (MDT)
	(envelope-from huntting@antediluvian.glarp.com)
Received: (from huntting@localhost)
	by antediluvian.glarp.com (8.14.0/8.13.6/Submit) id l2Q8Ji2v017407;
	Mon, 26 Mar 2007 02:19:44 -0600 (MDT)
	(envelope-from huntting)
Message-Id: <200703260819.l2Q8Ji2v017407@antediluvian.glarp.com>
Date: Mon, 26 Mar 2007 02:19:44 -0600 (MDT)
From: Brad Huntting <huntting@glarp.com>
Reply-To: Brad Huntting <huntting@glarp.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: proposed patch for blocksshd port
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         110842
>Category:       ports
>Synopsis:       proposed patch for blocksshd port
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    clsung
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 26 09:00:15 GMT 2007
>Closed-Date:    Mon Apr 02 01:11:48 GMT 2007
>Last-Modified:  Mon Apr  2 01:20:03 GMT 2007
>Originator:     Brad Huntting
>Release:        FreeBSD 6.1-RELEASE i386
>Organization:
>Environment:
System: FreeBSD antediluvian.glarp.com 6.1-RELEASE FreeBSD 6.1-RELEASE #0: Sun May 7 04:32:43 UTC 2006 root@opus.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC i386

>Description:
	The security/blocksshd port install a perl script with
	DOS-like CRLF weirdness and fails to install an rc script.

>How-To-Repeat:
	install, observe

>Fix:

diff -Pru /usr/ports/security/blocksshd/Makefile /tmp/blocksshd/Makefile
--- /usr/ports/security/blocksshd/Makefile	Thu Dec 14 03:29:13 2006
+++ /tmp/blocksshd/Makefile	Mon Mar 26 02:09:03 2007
@@ -7,7 +7,7 @@
 
 PORTNAME=	blocksshd
 PORTVERSION=	1.0
-PORTREVISION=	2
+PORTREVISION=	3
 CATEGORIES=	security sysutils
 MASTER_SITES=	${MASTER_SITE_SOURCEFORGE}
 MASTER_SITE_SUBDIR=	blocksshd
@@ -22,8 +22,17 @@
 MAKE_ARGS=	PREFIX="${PREFIX}" SYSCONFDIR="${PREFIX}/etc"
 NO_BUILD=	yes
 USE_PERL5_RUN=	yes
+USE_RC_SUBR=	blocksshd
 
 MAN1=		blocksshd.1
+
+pre-patch:
+	cd ${WRKSRC} && \
+	for f in blocksshd blocksshd.conf blocksshd.man; \
+	do \
+		${MV} $${f} $${f}.bak && \
+		${TR} -d '\r' <$${f}.bak >$${f}; \
+	done
 
 post-patch:
 	@${CHMOD} 755 ${WRKSRC}/init
Binary files /usr/ports/security/blocksshd/blocksshd-1.0_3.tbz and /tmp/blocksshd/blocksshd-1.0_3.tbz differ
diff -Pru /usr/ports/security/blocksshd/files/blocksshd.in /tmp/blocksshd/files/blocksshd.in
--- /usr/ports/security/blocksshd/files/blocksshd.in	Wed Dec 31 17:00:00 1969
+++ /tmp/blocksshd/files/blocksshd.in	Mon Mar 26 01:40:13 2007
@@ -0,0 +1,24 @@
+#!/bin/sh
+#
+
+# PROVIDE: blocksshd
+# REQUIRE: NETWORKING 
+# BEFORE: securelevel
+# KEYWORD: shutdown
+
+. %%RC_SUBR%%
+
+name="blocksshd"
+rcvar="`set_rcvar`"
+command="%%PREFIX%%/bin/${name}"
+command_interpreter="/usr/bin/perl"
+pidfile="/var/run/${name}.pid"
+blocksshd_flags="--start"
+stop_precmd=blocksshd_stop
+
+blocksshd_stop () {
+	${command} --stop
+}
+
+load_rc_config $name
+run_rc_command "$1"
diff -Pru /usr/ports/security/blocksshd/files/patch-blocksshd.conf /tmp/blocksshd/files/patch-blocksshd.conf
--- /usr/ports/security/blocksshd/files/patch-blocksshd.conf	Thu Nov 23 03:17:51 2006
+++ /tmp/blocksshd/files/patch-blocksshd.conf	Mon Mar 26 02:02:09 2007
@@ -1,23 +1,23 @@
 --- blocksshd.conf.orig	Mon Nov 20 05:36:42 2006
 +++ blocksshd.conf	Thu Nov 23 13:12:35 2006
 @@ -1,9 +1,9 @@
- # vim: syntax=perl
- 
- $cfg = {
--    os              => 'linux',                       # Target OS - either linux or bsd
-+    os              => 'bsd',                       # Target OS - either linux or bsd
-     chain           => 'blocksshd',                   # Name of iptables or pf chain
--    logfile         => '/var/log/secure',             # Log file to monitor
-+    logfile         => '/var/log/auth.log',             # Log file to monitor
-     logcheck        => '10',                          # How often to check the log file
-     max_attempts    => '4',                           # Max number of failures
-     timeout         => '360',                         # Reset IP count if no activity after time out in seconds
+ # vim: syntax=perl
+ 
+ $cfg = {
+-    os              => 'linux',                       # Target OS - either linux or bsd
++    os              => 'bsd',                       # Target OS - either linux or bsd
+     chain           => 'blocksshd',                   # Name of iptables or pf chain
+-    logfile         => '/var/log/secure',             # Log file to monitor
++    logfile         => '/var/log/auth.log',             # Log file to monitor
+     logcheck        => '10',                          # How often to check the log file
+     max_attempts    => '4',                           # Max number of failures
+     timeout         => '360',                         # Reset IP count if no activity after time out in seconds
 @@ -14,7 +14,7 @@
-     pid_file        => '/var/run/blocksshd.pid',      # Location of PID file
-     send_email      => '1',                           # Enable the sending of email notifications
-     email           => 'root',                        # Email address to send notifications
--    mail            => '/bin/mail',                   # Location of mail binary    
-+    mail            => '/usr/bin/mail',                   # Location of mail binary    
-     iptables        => '/sbin/iptables',              # Location of iptables binary - only for Linux
-     pfctl           => '/sbin/pfctl',                 # Location of pfctl binary - only for BSD
-     whitelist       => [qw{
+     pid_file        => '/var/run/blocksshd.pid',      # Location of PID file
+     send_email      => '1',                           # Enable the sending of email notifications
+     email           => 'root',                        # Email address to send notifications
+-    mail            => '/bin/mail',                   # Location of mail binary    
++    mail            => '/usr/bin/mail',                   # Location of mail binary    
+     iptables        => '/sbin/iptables',              # Location of iptables binary - only for Linux
+     pfctl           => '/sbin/pfctl',                 # Location of pfctl binary - only for BSD
+     whitelist       => [qw{
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->clsung 
Responsible-Changed-By: clsung 
Responsible-Changed-When: Mon Mar 26 10:07:49 UTC 2007 
Responsible-Changed-Why:  
I'll take it. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110842 

From: "Eric P. Scott" <eps+pcmt0703@ana.com>
To: bug-followup@freebsd.org
Cc:  
Subject: Re: ports/110842: proposed patch for blocksshd port
Date: Tue, 27 Mar 2007 13:39:30 -0700 (PDT)

 I think you want this instead of your proposed pre-patch:
 
 USE_DOS2UNIX=	blocksshd blocksshd.conf
 
 (then it's OK to strip the CRs from files/patch-blocksshd.conf)
 
 and the post-patch is probably better as a post-extract:
 
 post-extract:
 	@${CHMOD} +x ${WRKSRC}/init
State-Changed-From-To: open->closed 
State-Changed-By: clsung 
State-Changed-When: Mon Apr 2 01:11:46 UTC 2007 
State-Changed-Why:  
Committed. Thank You. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=110842 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/110842: commit references a PR
Date: Mon,  2 Apr 2007 01:11:43 +0000 (UTC)

 clsung      2007-04-02 01:11:38 UTC
 
   FreeBSD ports repository
 
   Modified files:
     security/blocksshd   Makefile 
     security/blocksshd/files patch-blocksshd.conf 
   Added files:
     security/blocksshd/files blocksshd.in 
   Log:
   - add RC support
   - use USE_DOS2UNIX
   
   PR:             ports/110842
   Submitted by:   Brad Huntting <huntting_AT_glarp dot com>
   Reviewed by:    clsung
   
   Revision  Changes    Path
   1.7       +6 -1      ports/security/blocksshd/Makefile
   1.1       +24 -0     ports/security/blocksshd/files/blocksshd.in (new)
   1.3       +19 -19    ports/security/blocksshd/files/patch-blocksshd.conf
 _______________________________________________
 cvs-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/cvs-all
 To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
 
>Unformatted:
