Subject: pkg/22914: Portability fixes for security/crack
To: None <gnats-bugs@gnats.NetBSD.org>
From: None <jonathan@perkin.org.uk>
List: netbsd-bugs
Date: 09/23/2003 13:07:20
>Number:         22914
>Category:       pkg
>Synopsis:       Portability fixes for security/crack
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 23 13:08:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Jonathan Perkin
>Release:        N/A
>Organization:
British Broadcasting Corporation
>Environment:
SunOS build1 5.9 Generic_112233-01 sun4u sparc SUNW,UltraSPARC-IIi-cEngine
>Description:
1) Some versions of install(1) can only handle a single directory
   argument at a time with -d.  Explicitly do all the required creations
   in Makefile.
2) The "Crack" shell script needs a working (hi Solaris!) shell in order
   to function correctly.  Give it pkgsrc's known-working $(SH)
>How-To-Repeat:
1)

===> Installing for crack-5.0
usage: install [-cs] [-g group] [-m mode] [-o owner] file ...  destination
       install  -d   [-g group] [-m mode] [-o owner] dir
*** Error code 1

2)

[...]
Invoked: /home/jonp/bulk/pkg/sbin/Crack -makedict
Option: -makedict enabled
/home/jonp/bulk/pkg/sbin/Crack: !: not found
Crack: making dictionary groups, please be patient...
mkdir: cannot create directory `run/dict': No such file or directory
*** Error code 1
>Fix:
http://www.perkin.org.uk/projects/netbsd/crack.diff

Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/security/crack/Makefile,v
retrieving revision 1.14
diff -u -r1.14 Makefile
--- Makefile	2003/07/17 22:52:52	1.14
+++ Makefile	2003/09/23 13:06:02
@@ -21,7 +21,7 @@
 		${ECHO_MSG} "You may want to install the dict distribution into /usr/share/dict" ; \
 		${ECHO_MSG} "to increase the size of the cracking dictionary." ; \
 	fi)
-	@${SED} 's|@@PREFIX@@|${PREFIX}|g' < ${WRKSRC}/Crack > ${WRKSRC}/Crack.new
+	@${SED} 's|@@PREFIX@@|${PREFIX}|g;s|@@SH@@|${SH}|g' < ${WRKSRC}/Crack > ${WRKSRC}/Crack.new
 	@${RM} -f ${WRKSRC}/Crack && ${MV} ${WRKSRC}/Crack.new ${WRKSRC}/Crack
 	@${CHMOD} a+rx ${WRKSRC}/Crack
 
@@ -35,12 +35,12 @@
 	@${CHMOD} go-rwx ${PREFIX}/share/crack
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/dict
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/doc/crack
-	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/extra \
-			     ${PREFIX}/share/crack/run
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/extra
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/run
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/scripts
-	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/dict/1\
-			     ${PREFIX}/share/crack/dict/2 \
-		             ${PREFIX}/share/crack/dict/3
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/dict/1
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/dict/2
+	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/dict/3
 	@${INSTALL_DATA_DIR} ${PREFIX}/share/crack/run
 	@${INSTALL_DATA_DIR} ${PREFIX}/crack/run/dict
 	${INSTALL_SCRIPT} ${WRKSRC}/Crack ${PREFIX}/sbin
Index: distinfo
===================================================================
RCS file: /cvsroot/pkgsrc/security/crack/distinfo,v
retrieving revision 1.3
diff -u -r1.3 distinfo
--- distinfo	2003/07/02 17:33:17	1.3
+++ distinfo	2003/09/23 13:06:02
@@ -2,7 +2,7 @@
 
 SHA1 (crack5.0.tar.gz) = e5e59d1e5e9e42c816a4dbd3f24cc13e16a31365
 Size (crack5.0.tar.gz) = 2964507 bytes
-SHA1 (patch-aa) = 014a04ba7aa50f8514d5219a3269feeccc684708
+SHA1 (patch-aa) = 3f44f17fb6365c90fcb92390ae78cd88d46b52d3
 SHA1 (patch-ab) = a60df3b47288abf28e44400e4035580da765e279
 SHA1 (patch-ac) = efa6903c59be394db1282d0760d55953a955e1ee
 SHA1 (patch-ad) = 49387a2aa147ff543d57e660dbe0d8b2861d8f52
Index: patches/patch-aa
===================================================================
RCS file: /cvsroot/pkgsrc/security/crack/patches/patch-aa,v
retrieving revision 1.2
diff -u -r1.2 patch-aa
--- patches/patch-aa	2003/07/02 17:33:18	1.2
+++ patches/patch-aa	2003/09/23 13:06:02
@@ -1,7 +1,13 @@
 $NetBSD: patch-aa,v 1.2 2003/07/02 17:33:18 jmmv Exp $
 
---- Crack.orig	Sat Dec 21 02:09:41 1996
-+++ Crack	Sat Oct  2 19:53:07 1999
+--- Crack.orig	Sat Dec 21 01:09:41 1996
++++ Crack	Tue Sep 23 13:59:16 2003
+@@ -1,4 +1,4 @@
+-#!/bin/sh
++#!@@SH@@
+ ###
+ # This program was written by and is copyright Alec Muffett 1991,
+ # 1992, 1993, 1994, 1995, and 1996, and is provided as part of the
 @@ -12,8 +12,8 @@
  # User-configurable junk for Crack
  ###
@@ -13,7 +19,7 @@
  
  # compiler options for crack 5.0
  #
-@@ -108,41 +108,11 @@
+@@ -108,43 +108,13 @@
  # home base
  ###
  
@@ -45,8 +51,8 @@
 -	echo "Fatal Error: $CRACK_HOME: something weird going down" 1>&2
 -	exit 1
 -fi
--
--###
+ 
+ ###
 -# Hierarchy
 -###
 -
@@ -54,26 +60,28 @@
 -do
 -	test -d $dir || mkdir $dir || exit 1
 -done
- 
- ###
+-
+-###
  # Flagwaving
-@@ -279,110 +249,76 @@
+ ###
+ 
+@@ -279,57 +249,14 @@
  # Sanity test bindir - written in gruntscript for clarity.
  ###
  
 -bdname=`scripts/binstamp 2>/dev/null`
--
++bindir=${PREFIX}/libexec/crack
+ 
 -if [ "x$bdname" = "x" ]
 -then
 -	echo "Crack: error: cannot continue as binstamp returned empty string" 1>&2
 -	exit 0
 -fi
--
+ 
 -echo "Stamp: $bdname"
 -echo ""
-+bindir=${PREFIX}/libexec/crack
- 
- 
+-
+-
 -if [ "x$1" != "x" ]
 -then
 -	if [ "$1" = "-fmt" ]            # use generic name
@@ -117,6 +125,7 @@
  export PATH
  
  ###
+@@ -336,17 +263,6 @@
  # Make the binaries
  ###
  
@@ -134,6 +143,7 @@
  ###
  # Make Only ?
  ###
+@@ -353,11 +269,31 @@
  
  if [ "x$makeonlyflag" != "x" ]
  then
@@ -165,6 +175,7 @@
  # Make the dictionary passes
  ###
  
+@@ -364,19 +300,6 @@
  dp=run/dict
  dplf=$dp/.dictmade
  
@@ -184,6 +195,7 @@
  ###
  # Make Dict Only ?
  ###
+@@ -383,6 +306,19 @@
  
  if [ "x$makedictflag" != "x" ]
  then
>Release-Note:
>Audit-Trail:
>Unformatted: