Update openssh 6.0p1 recipe and patch

* Back-port (and fix) the AuthorizedKeysFile change in sshd_config
  from 6.2p1.
* Declare login and passwd as requires and find them via the package
  links directory.
* configure.ac: Allow passing the path to passwd via the environment.
* Remove all but the ".ssh" dir related changes from the pathnames.h
  patch. The other paths can be specified/overridden via configure, so
  we don't need to patch them. Same for LOGIN_PROGRAM in sshd_config.
* Fix sysconfdir and libexecdir paths. The build system doesn't append
  a subdir path.
This commit is contained in:
Ingo Weinhold
2013-04-29 22:37:30 +02:00
parent 903e8fb7c6
commit 3a380a174f
2 changed files with 45 additions and 72 deletions

View File

@@ -4,7 +4,7 @@ LICENSE="OpenSSH"
COPYRIGHT="2005-2012 Tatu Ylonen et al."
SRC_URI="http://openbsd.mirrorcatalogs.com/pub/OpenBSD/OpenSSH/portable/openssh-6.0p1.tar.gz"
CHECKSUM_MD5="3c9347aa67862881c5da3f3b1c08da7b"
REVISION="2"
REVISION="3"
ARCHITECTURES="x86_gcc2 ?x86"
PATCHES="openssh-6.0p1.patch"
@@ -26,6 +26,8 @@ PROVIDES="
"
REQUIRES="
haiku >= $haikuVersion
cmd:login
cmd:passwd
lib:libcrypto
lib:libedit
lib:libssl
@@ -64,8 +66,16 @@ BUILD()
defaultPath+=":/boot/common/non-packaged/bin:/boot/common/bin:/bin"
defaultPath+=":/boot/common/apps:/boot/common/preferences:/boot/system/apps"
defaultPath+=":/boot/system/preferences"
# Note: override sysconfdir and libexecdir since ssh doesn't create
# subdirectories as it should.
PATH_PASSWD_PROG=$portPackageLinksDir/cmd:passwd/bin/passwd \
LOGIN_PROGRAM=$portPackageLinksDir/cmd:login/bin/login \
runConfigure ./configure \
--sysconfdir=$sysconfDir/openssh \
--libexecdir=$libExecDir/openssh \
--with-privsep-path=$dataDir/openssh/empty \
--with-pid-dir=$prefix/var/run \
--with-default-path="$defaultPath" \
--with-md5-passwords \
--disable-utmpx \

View File

@@ -1,7 +1,18 @@
diff -urN openssh-6.0p1/configure.ac openssh-6.0p1-haiku/configure.ac
--- openssh-6.0p1/configure.ac 2012-04-19 11:46:38.030408704 +0000
+++ openssh-6.0p1-haiku/configure.ac 2012-09-24 16:55:13.139198464 +0000
@@ -1432,7 +1432,7 @@
diff -ur orig/openssh-6.0p1/configure.ac openssh-6.0p1/configure.ac
--- orig/openssh-6.0p1/configure.ac 2012-04-19 13:46:38.045613056 +0200
+++ openssh-6.0p1/configure.ac 2013-04-29 21:27:34.023068672 +0200
@@ -92,7 +92,9 @@
fi
fi
-AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
+if test -z "$PATH_PASSWD_PROG" ; then
+ AC_PATH_PROG([PATH_PASSWD_PROG], [passwd])
+fi
if test ! -z "$PATH_PASSWD_PROG" ; then
AC_DEFINE_UNQUOTED([_PATH_PASSWD_PROG], ["$PATH_PASSWD_PROG"],
[Full path of your "passwd" program])
@@ -1432,7 +1434,7 @@
LIBEDIT=`$PKGCONFIG --libs-only-l libedit`
CPPFLAGS="$CPPFLAGS `$PKGCONFIG --cflags libedit`"
else
@@ -10,35 +21,10 @@ diff -urN openssh-6.0p1/configure.ac openssh-6.0p1-haiku/configure.ac
fi
OTHERLIBS=`echo $LIBEDIT | sed 's/-ledit//'`
AC_CHECK_LIB([edit], [el_init],
diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
--- openssh-6.0p1/pathnames.h 2011-05-29 11:39:38.039583744 +0000
+++ openssh-6.0p1-haiku/pathnames.h 2012-09-24 16:55:13.148373504 +0000
@@ -12,7 +12,14 @@
* called by a name other than "ssh" or "Secure Shell".
*/
-#define ETCDIR "/etc"
+#define HAIKU_USER_SETTINGS_DIRECTORY "~/config/settings"
+#define HAIKU_COMMON_SETTINGS_DIRECTORY "/boot/common/settings"
+#define HAIKU_COMMON_BIN_DIRECTORY "/boot/common/bin"
+#define HAIKU_COMMON_VAR_DIRECTORY "/boot/common/var"
+#define HAIKU_SYSTEM_BIN_DIRECTORY "/boot/system/bin"
+
+
+#define ETCDIR HAIKU_COMMON_SETTINGS_DIRECTORY
#ifndef SSHDIR
#define SSHDIR ETCDIR "/ssh"
@@ -45,7 +52,7 @@
#define _PATH_DH_PRIMES SSHDIR "/primes"
#ifndef _PATH_SSH_PROGRAM
-#define _PATH_SSH_PROGRAM "/usr/bin/ssh"
+#define _PATH_SSH_PROGRAM HAIKU_COMMON_BIN_DIRECTORY
#endif
/*
@@ -58,25 +65,25 @@
diff -ur orig/openssh-6.0p1/pathnames.h openssh-6.0p1/pathnames.h
--- orig/openssh-6.0p1/pathnames.h 2011-05-29 13:39:38.054788096 +0200
+++ openssh-6.0p1/pathnames.h 2013-04-29 21:29:17.578289664 +0200
@@ -58,25 +58,25 @@
* The directory in user's home directory in which the files reside. The
* directory should be world-readable (though not all files are).
*/
@@ -51,10 +37,10 @@ diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
* contain anything particularly secret.
*/
-#define _PATH_SSH_USER_HOSTFILE "~/.ssh/known_hosts"
+#define _PATH_SSH_USER_HOSTFILE "/boot/home/config/settings/ssh/known_hosts"
+#define _PATH_SSH_USER_HOSTFILE "~/" _PATH_SSH_USER_DIR "/known_hosts"
/* backward compat for protocol 2 */
-#define _PATH_SSH_USER_HOSTFILE2 "~/.ssh/known_hosts2"
+#define _PATH_SSH_USER_HOSTFILE2 "/boot/home/config/settings/ssh/known_hosts2"
+#define _PATH_SSH_USER_HOSTFILE2 "~/" _PATH_SSH_USER_DIR "/known_hosts2"
/*
* Name of the default file containing client-side authentication key. This
@@ -71,7 +57,7 @@ diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
/*
* Configuration file in user's home directory. This file need not be
@@ -84,7 +91,7 @@
@@ -84,7 +84,7 @@
* particularly secret. If the user's home directory resides on an NFS
* volume where root is mapped to nobody, this may need to be world-readable.
*/
@@ -80,7 +66,7 @@ diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
/*
* File containing a list of those rsa keys that permit logging in as this
@@ -94,10 +101,10 @@
@@ -94,10 +94,10 @@
* may need to be world-readable. (This file is read by the daemon which is
* running as root.)
*/
@@ -93,7 +79,7 @@ diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
/*
* Per-user and system-wide ssh "rc" files. These files are executed with
@@ -105,7 +112,7 @@
@@ -105,7 +105,7 @@
* passed "proto cookie" as arguments if X11 forwarding with spoofing is in
* use. xauth will be run if neither of these exists.
*/
@@ -102,38 +88,15 @@ diff -urN openssh-6.0p1/pathnames.h openssh-6.0p1-haiku/pathnames.h
#define _PATH_SSH_SYSTEM_RC SSHDIR "/sshrc"
/*
@@ -149,17 +156,16 @@
diff -ur orig/openssh-6.0p1/sshd_config openssh-6.0p1/sshd_config
--- orig/openssh-6.0p1/sshd_config 2011-05-29 13:39:39.064225280 +0200
+++ openssh-6.0p1/sshd_config 2013-04-29 12:51:20.314834944 +0200
@@ -47,7 +47,7 @@
/* for sftp */
#ifndef _PATH_SFTP_SERVER
-#define _PATH_SFTP_SERVER "/usr/libexec/sftp-server"
+#define _PATH_SFTP_SERVER HAIKU_COMMON_BIN_DIRECTORY"/sftp-server"
#endif
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
-AuthorizedKeysFile .ssh/authorized_keys
+AuthorizedKeysFile config/settings/ssh/authorized_keys
/* chroot directory for unprivileged user when UsePrivilegeSeparation=yes */
#ifndef _PATH_PRIVSEP_CHROOT_DIR
-#define _PATH_PRIVSEP_CHROOT_DIR "/var/empty"
+#define _PATH_PRIVSEP_CHROOT_DIR HAIKU_COMMON_VAR_DIRECTORY "/empty"
#endif
-
/* for passwd change */
#ifndef _PATH_PASSWD_PROG
-#define _PATH_PASSWD_PROG "/usr/bin/passwd"
+#define _PATH_PASSWD_PROG HAIKU_SYSTEM_BIN_DIRECTORY "/passwd"
#endif
#ifndef _PATH_LS
@@ -171,11 +177,11 @@
# ifdef LOGIN_PROGRAM_FALLBACK
# define LOGIN_PROGRAM LOGIN_PROGRAM_FALLBACK
# else
-# define LOGIN_PROGRAM "/usr/bin/login"
+# define LOGIN_PROGRAM HAIKU_SYSTEM_BIN_DIRECTORY "/login"
# endif
#endif /* LOGIN_PROGRAM */
/* Askpass program define */
#ifndef ASKPASS_PROGRAM
-#define ASKPASS_PROGRAM "/usr/lib/ssh/ssh-askpass"
+#define ASKPASS_PROGRAM HAIKU_COMMON_BIN_DIRECTORY "/ssh/ssh-askpass"
#endif /* ASKPASS_PROGRAM */
# For this to work you will also need host keys in /etc/ssh/ssh_known_hosts
#RhostsRSAAuthentication no