From 4816c4c209306535dc8263aaf0ce0dd6727d91e0 Mon Sep 17 00:00:00 2001
From: grant <grant>
Date: Thu, 27 Jun 2002 02:15:11 +0000
Subject: add POST-INSTALL warning if sshd configuration file is found in a
 previous configuration directory.

format MESSAGE consistently.
---
 security/openssh/INSTALL  | 37 +++++++++++++++++++++++++++++++++++++
 security/openssh/MESSAGE  |  6 +++---
 security/openssh/Makefile |  3 ++-
 3 files changed, 42 insertions(+), 4 deletions(-)
 create mode 100644 security/openssh/INSTALL

(limited to 'security')

diff --git a/security/openssh/INSTALL b/security/openssh/INSTALL
new file mode 100644
index 00000000000..7abf68b5269
--- /dev/null
+++ b/security/openssh/INSTALL
@@ -0,0 +1,37 @@
+# $NetBSD: INSTALL,v 1.3 2002/06/27 02:15:11 grant Exp $
+
+DIRS="/etc /etc/ssh /usr/pkg/etc"
+FILES="sshd.conf sshd_config"
+
+if [ "${STAGE}" != "POST-INSTALL" ]; then
+	exit 0
+fi
+
+for dir in $DIRS; do
+	if [ "${PKG_SYSCONFDIR}" != "$dir" ]; then
+		for file in $FILES; do
+			path=$dir/$file
+			if [ -f $path ]; then
+				cat <<EOF
+===========================================================================
+
+                           *===* NOTICE *===*
+
+WARNING: previous configuration file $path found.
+
+The config files for ${PKGNAME} must be located in:
+
+	${PKG_SYSCONFDIR}
+
+You will need to ensure your configuration files and/or keys are
+placed in the correct directory before using ${PKGNAME}.
+
+===========================================================================
+EOF
+
+				exit
+			fi
+		done
+	fi
+done
+
diff --git a/security/openssh/MESSAGE b/security/openssh/MESSAGE
index 5b9dfb11810..7ddb325d988 100644
--- a/security/openssh/MESSAGE
+++ b/security/openssh/MESSAGE
@@ -1,5 +1,5 @@
-==========================================================================
-$NetBSD: MESSAGE,v 1.6 2002/06/26 11:38:44 itojun Exp $
+===========================================================================
+$NetBSD: MESSAGE,v 1.7 2002/06/27 02:15:13 grant Exp $
 
                            *===* NOTICE *===*
 
@@ -16,4 +16,4 @@ For example, add the following into /etc/passwd and /etc/group:
 	sshd:*:16:16::0:0:sshd privsep:/var/chroot/sshd:/sbin/nologin
 	sshd:*:16:
 
-==========================================================================
+===========================================================================
diff --git a/security/openssh/Makefile b/security/openssh/Makefile
index 5289791e173..0334f2d4350 100644
--- a/security/openssh/Makefile
+++ b/security/openssh/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.78 2002/06/26 14:33:29 itojun Exp $
+# $NetBSD: Makefile,v 1.79 2002/06/27 02:15:14 grant Exp $
 
 DISTNAME=		openssh-3.4p1
 PKGNAME=		openssh-3.4.0.1
@@ -109,6 +109,7 @@ RCD_SCRIPTS=		sshd
 PLIST_SRC+=		${.CURDIR}/PLIST
 FILES_SUBST+=		SSH_PID_DIR=${SSH_PID_DIR}
 MESSAGE_SUBST+=		EGDIR=${EGDIR}
+INSTALL_EXTRA_TMPL=	${.CURDIR}/INSTALL
 
 post-build:
 	@${SED} ${FILES_SUBST_SED} ${FILESDIR}/sshd.sh > ${WRKDIR}/sshd
-- 
cgit v1.2.3