View | Details | Raw Unified | Return to bug 2428 | Differences between
and this patch

Collapse All | Expand All

(-)a/configure.ac (-1 / +26 lines)
Lines 1674-1680 AC_CHECK_FUNCS([ \ Link Here
1674
	pstat \
1674
	pstat \
1675
	readpassphrase \
1675
	readpassphrase \
1676
	reallocarray \
1676
	reallocarray \
1677
	realpath \
1678
	recvmsg \
1677
	recvmsg \
1679
	rresvport_af \
1678
	rresvport_af \
1680
	sendmsg \
1679
	sendmsg \
Lines 1891-1896 AC_CHECK_FUNCS([setresgid], [ Link Here
1891
	)
1890
	)
1892
])
1891
])
1893
1892
1893
AC_CHECK_FUNCS([realpath], [
1894
	dnl the sftp v3 spec says SSH_FXP_REALPATH will "canonicalize any given
1895
	dnl path name", however some implementations of realpath (and some
1896
	dnl versions of the POSIX spec) do not work on non-existent files,
1897
	dnl so we use the OpenBSD implementation on those platforms.
1898
	AC_MSG_CHECKING([if realpath works with non-existent files])
1899
	AC_RUN_IFELSE(
1900
		[AC_LANG_PROGRAM([[
1901
#include <limits.h>
1902
#include <stdlib.h>
1903
#include <errno.h>
1904
		]], [[
1905
		char buf[PATH_MAX];
1906
		if (realpath("/opensshnonexistentfilename1234", buf) == NULL)
1907
			if (errno == ENOENT)
1908
				exit(1);
1909
		exit(0);
1910
		]])],
1911
		[AC_MSG_RESULT([yes])],
1912
		[AC_DEFINE([BROKEN_REALPATH], [1],
1913
			[realpath does not work with nonexistent files])
1914
		 AC_MSG_RESULT([no])],
1915
		[AC_MSG_WARN([cross compiling: assuming working])]
1916
	)
1917
])
1918
1894
dnl    Checks for time functions
1919
dnl    Checks for time functions
1895
AC_CHECK_FUNCS([gettimeofday time])
1920
AC_CHECK_FUNCS([gettimeofday time])
1896
dnl    Checks for utmp functions
1921
dnl    Checks for utmp functions
(-)a/openbsd-compat/openbsd-compat.h (-1 / +9 lines)
Lines 70-77 void *reallocarray(void *, size_t, size_t); Link Here
70
#endif
70
#endif
71
71
72
#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
72
#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
73
/*
74
 * glibc's FORTIFY_SOURCE can redefine this and prevent us picking up the
75
 * compat version.
76
 */
77
# ifdef BROKEN_REALPATH
78
#  define realpath(x, y) _ssh_compat_realpath(x, y)
79
# endif
80
73
char *realpath(const char *path, char *resolved);
81
char *realpath(const char *path, char *resolved);
74
#endif 
82
#endif
75
83
76
#ifndef HAVE_RRESVPORT_AF
84
#ifndef HAVE_RRESVPORT_AF
77
int rresvport_af(int *alport, sa_family_t af);
85
int rresvport_af(int *alport, sa_family_t af);

Return to bug 2428