summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@zip.com.au>2006-09-01 20:29:10 +1000
committerDarren Tucker <dtucker@zip.com.au>2006-09-01 20:29:10 +1000
commit096faecdea1e39ecace0b20f4e208bd7ec33f6d2 (patch)
tree7756d6d5fefe40aab00431d47075175a5641b9a1
parent0646ca6be81c4f0f619d92a4e5a041b58c79a221 (diff)
downloadopenssh-git-096faecdea1e39ecace0b20f4e208bd7ec33f6d2.tar.gz
- (dtucker) [configure.ac includes.h openbsd-compat/glob.{c,h}] Explicitly
test for GLOB_NOMATCH and use our glob functions if it's not found. Stops sftp from segfaulting when attempting to get a nonexistent file on Cygwin (previous versions of OpenSSH didn't use the native glob). Partly from and tested by Corinna Vinschen.
-rw-r--r--ChangeLog7
-rw-r--r--configure.ac6
-rw-r--r--includes.h3
-rw-r--r--openbsd-compat/glob.c3
-rw-r--r--openbsd-compat/glob.h3
5 files changed, 16 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index f10393f3..0cbd4b62 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -19,6 +19,11 @@
sys/socket.h and unistd.h in various places
- (dtucker) [openbsd-compat/bsd-cygwin_util.c] Fix implict declaration
warnings for binary_open and binary_close. Patch from Corinna Vinschen.
+ - (dtucker) [configure.ac includes.h openbsd-compat/glob.{c,h}] Explicitly
+ test for GLOB_NOMATCH and use our glob functions if it's not found.
+ Stops sftp from segfaulting when attempting to get a nonexistent file on
+ Cygwin (previous versions of OpenSSH didn't use the native glob). Partly
+ from and tested by Corinna Vinschen.
20060831
- (djm) [CREDITS LICENCE Makefile.in auth.c configure.ac includes.h ]
@@ -5370,4 +5375,4 @@
- (djm) Trim deprecated options from INSTALL. Mention UsePAM
- (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu
-$Id: ChangeLog,v 1.4523 2006/09/01 09:29:01 dtucker Exp $
+$Id: ChangeLog,v 1.4524 2006/09/01 10:29:10 dtucker Exp $
diff --git a/configure.ac b/configure.ac
index 3aba414a..c37d7f49 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.356 2006/08/30 17:24:41 djm Exp $
+# $Id: configure.ac,v 1.357 2006/09/01 10:29:11 dtucker Exp $
#
# Copyright (c) 1999-2004 Damien Miller
#
@@ -15,7 +15,7 @@
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
AC_INIT(OpenSSH, Portable, openssh-unix-dev@mindrot.org)
-AC_REVISION($Revision: 1.356 $)
+AC_REVISION($Revision: 1.357 $)
AC_CONFIG_SRCDIR([ssh.c])
AC_CONFIG_HEADER(config.h)
@@ -982,6 +982,8 @@ AC_TRY_COMPILE(
]
)
+AC_CHECK_DECLS(GLOB_NOMATCH, , , [#include <glob.h>])
+
AC_MSG_CHECKING([whether struct dirent allocates space for d_name])
AC_RUN_IFELSE(
[AC_LANG_SOURCE([[
diff --git a/includes.h b/includes.h
index 2101f13c..967fcc26 100644
--- a/includes.h
+++ b/includes.h
@@ -30,7 +30,8 @@
# include <bstring.h>
#endif
#if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
- defined(GLOB_HAS_GL_MATCHC)
+ defined(GLOB_HAS_GL_MATCHC) && \
+ defined(HAVE_DECL_GLOB_NOMATCH) && HAVE_DECL_GLOB_NOMATCH != 0
# include <glob.h>
#endif
#ifdef HAVE_ENDIAN_H
diff --git a/openbsd-compat/glob.c b/openbsd-compat/glob.c
index ec16b110..b3dd2b17 100644
--- a/openbsd-compat/glob.c
+++ b/openbsd-compat/glob.c
@@ -47,7 +47,8 @@
#include <unistd.h>
#if !defined(HAVE_GLOB) || !defined(GLOB_HAS_ALTDIRFUNC) || \
- !defined(GLOB_HAS_GL_MATCHC)
+ !defined(GLOB_HAS_GL_MATCHC) || \
+ !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0
static long
get_arg_max(void)
diff --git a/openbsd-compat/glob.h b/openbsd-compat/glob.h
index 4fdbfc1e..9ba07f76 100644
--- a/openbsd-compat/glob.h
+++ b/openbsd-compat/glob.h
@@ -38,7 +38,8 @@
/* OPENBSD ORIGINAL: include/glob.h */
#if !defined(HAVE_GLOB_H) || !defined(GLOB_HAS_ALTDIRFUNC) || \
- !defined(GLOB_HAS_GL_MATCHC)
+ !defined(GLOB_HAS_GL_MATCHC) || \
+ !defined(HAVE_DECL_GLOB_NOMATCH) || HAVE_DECL_GLOB_NOMATCH == 0
#ifndef _GLOB_H_
#define _GLOB_H_