aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh/bsd-compatible-realpath.patch
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-07-18 10:57:33 +0000
committerTimo Teräs <timo.teras@iki.fi>2016-07-18 11:00:27 +0000
commit756f181a56f8c7d4445ba4aacec5354e3bf9e051 (patch)
treee2d9b8f8c1f95c8eb4d7bfff9011dc602bd0a872 /main/openssh/bsd-compatible-realpath.patch
parent267b90c0703c128548dc22f6f116becdeee693c3 (diff)
downloadaports-756f181a56f8c7d4445ba4aacec5354e3bf9e051.tar.bz2
aports-756f181a56f8c7d4445ba4aacec5354e3bf9e051.tar.xz
main/openssh: support cross building and use default_prepare
Diffstat (limited to 'main/openssh/bsd-compatible-realpath.patch')
-rw-r--r--main/openssh/bsd-compatible-realpath.patch56
1 files changed, 35 insertions, 21 deletions
diff --git a/main/openssh/bsd-compatible-realpath.patch b/main/openssh/bsd-compatible-realpath.patch
index e3ed33ff7e..1cdb4f7c5d 100644
--- a/main/openssh/bsd-compatible-realpath.patch
+++ b/main/openssh/bsd-compatible-realpath.patch
@@ -1,30 +1,45 @@
fix issues with fortify-headers and the way openssh handles the needed
-BSD compatible realpath(3)
+BSD compatible realpath(3).
-diff --git a/openbsd-compat/openbsd-compat.h b/openbsd-compat/openbsd-compat.h
-index 1ff7114..e552a10 100644
---- a/openbsd-compat/openbsd-compat.h
-+++ b/openbsd-compat/openbsd-compat.h
-@@ -70,12 +70,8 @@ void *reallocarray(void *, size_t, size_t);
+unconditionally use the provided realpath() as otherwise cross-builds
+would try to use musl realpath() which is posix compliant and not
+working to openssh expectations.
+
+diff -ru openssh-7.2p2.orig/openbsd-compat/openbsd-compat.h openssh-7.2p2/openbsd-compat/openbsd-compat.h
+--- openssh-7.2p2.orig/openbsd-compat/openbsd-compat.h 2016-03-09 20:04:48.000000000 +0200
++++ openssh-7.2p2/openbsd-compat/openbsd-compat.h 2016-07-18 13:33:16.260357745 +0300
+@@ -68,17 +68,7 @@
+ void *reallocarray(void *, size_t, size_t);
#endif
- #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
+-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
-/*
- * glibc's FORTIFY_SOURCE can redefine this and prevent us picking up the
- * compat version.
- */
-# ifdef BROKEN_REALPATH
-# define realpath(x, y) _ssh_compat_realpath(x, y)
-+# if !defined(BROKEN_REALPATH)
-+# define ssh_realpath(x, y) realpath(x, y)
- # endif
+-# endif
+-
+-char *realpath(const char *path, char *resolved);
+-#endif
++char *ssh_realpath(const char *path, char *resolved);
+
+ #ifndef HAVE_RRESVPORT_AF
+ int rresvport_af(int *alport, sa_family_t af);
+diff -ru openssh-7.2p2.orig/openbsd-compat/realpath.c openssh-7.2p2/openbsd-compat/realpath.c
+--- openssh-7.2p2.orig/openbsd-compat/realpath.c 2016-03-09 20:04:48.000000000 +0200
++++ openssh-7.2p2/openbsd-compat/realpath.c 2016-07-18 13:33:45.420721690 +0300
+@@ -31,7 +31,7 @@
+
+ #include "includes.h"
+
+-#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
++#if 1
- char *realpath(const char *path, char *resolved);
-diff --git a/openbsd-compat/realpath.c b/openbsd-compat/realpath.c
-index ba4cea9..1e67ebc 100644
---- a/openbsd-compat/realpath.c
-+++ b/openbsd-compat/realpath.c
-@@ -51,7 +51,7 @@
+ #include <sys/types.h>
+ #include <sys/param.h>
+@@ -58,7 +58,7 @@
* in which case the path which caused trouble is left in (resolved).
*/
char *
@@ -33,11 +48,10 @@ index ba4cea9..1e67ebc 100644
{
struct stat sb;
char *p, *q, *s;
-diff --git a/sftp-server.c b/sftp-server.c
-index eac11d7..ac51ca3 100644
---- a/sftp-server.c
-+++ b/sftp-server.c
-@@ -1162,7 +1162,7 @@ process_realpath(u_int32_t id)
+diff -ru openssh-7.2p2.orig/sftp-server.c openssh-7.2p2/sftp-server.c
+--- openssh-7.2p2.orig/sftp-server.c 2016-03-09 20:04:48.000000000 +0200
++++ openssh-7.2p2/sftp-server.c 2016-07-18 13:34:29.131267241 +0300
+@@ -1162,7 +1162,7 @@
}
debug3("request %u: realpath", id);
verbose("realpath \"%s\"", path);