aboutsummaryrefslogtreecommitdiffstats
path: root/main/openssh/bsd-compatible-realpath.patch
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2015-09-28 12:03:09 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2015-09-28 16:16:27 +0200
commit2845b3981db34eb94244dddcced718c7189bce95 (patch)
tree8d64d7b3272949918e9a46cd8ac166024ad0b469 /main/openssh/bsd-compatible-realpath.patch
parent912394b5680033130b22c9790c18b65d40d62af8 (diff)
downloadaports-2845b3981db34eb94244dddcced718c7189bce95.tar.bz2
aports-2845b3981db34eb94244dddcced718c7189bce95.tar.xz
main/openssh: upgrade to 7.1_p1
Diffstat (limited to 'main/openssh/bsd-compatible-realpath.patch')
-rw-r--r--main/openssh/bsd-compatible-realpath.patch48
1 files changed, 48 insertions, 0 deletions
diff --git a/main/openssh/bsd-compatible-realpath.patch b/main/openssh/bsd-compatible-realpath.patch
new file mode 100644
index 0000000000..6931143bb0
--- /dev/null
+++ b/main/openssh/bsd-compatible-realpath.patch
@@ -0,0 +1,48 @@
+fix issues with fortify-headers and the way openssh handles the needed
+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);
+ #endif
+
+ #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
+
+ 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 @@
+ * in which case the path which caused trouble is left in (resolved).
+ */
+ char *
+-realpath(const char *path, char resolved[PATH_MAX])
++ssh_realpath(const char *path, char resolved[PATH_MAX])
+ {
+ 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)
+ }
+ debug3("request %u: realpath", id);
+ verbose("realpath \"%s\"", path);
+- if (realpath(path, resolvedname) == NULL) {
++ if (ssh_realpath(path, resolvedname) == NULL) {
+ send_status(id, errno_to_portable(errno));
+ } else {
+ Stat s;