Bug 1634 - [PATCH] openbsd-compat/glob.h conflicts with system glob.h
Summary: [PATCH] openbsd-compat/glob.h conflicts with system glob.h
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 5.2p1
Hardware: All FreeBSD
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks: V_5_3
  Show dependency treegraph
 
Reported: 2009-08-20 13:54 AEST by Jonathan Chen
Modified: 2009-10-06 15:02 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Chen 2009-08-20 13:54:14 AEST
On FreeBSD, openbsd-compat's glob is supposed to be used used instead of the system glob, due to BROKEN_GLOB being set in configure.  However, includes.h pulls in the system glob.h nonetheless, resulting in divergent glob_t definitions within openssh.

On FreeBSD, this can manifest as sftp throwing a SIGBUS when a directory listing is requested.

The trivial patch below fixes the problem.


--- includes.h~ 2009-08-19 23:32:26.000000000 -0400
+++ includes.h  2009-08-19 23:32:53.000000000 -0400
@@ -31,7 +31,8 @@
 #endif
 #if defined(HAVE_GLOB_H) && defined(GLOB_HAS_ALTDIRFUNC) && \
     defined(GLOB_HAS_GL_MATCHC) && \
-    defined(HAVE_DECL_GLOB_NOMATCH) &&  HAVE_DECL_GLOB_NOMATCH != 0
+    defined(HAVE_DECL_GLOB_NOMATCH) &&  HAVE_DECL_GLOB_NOMATCH != 0 &&\
+    !defined(BROKEN_GLOB)
 # include <glob.h>
 #endif
 #ifdef HAVE_ENDIAN_H
Comment 1 Darren Tucker 2009-08-20 16:16:38 AEST
Applied, thanks.  This will be in the 5.3p1 release.
Comment 2 Damien Miller 2009-10-06 15:02:04 AEDT
Mass move of RESOLVED bugs to CLOSED now that 5.3 is out.