pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/libnbcompat/files always use local glob() as ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e2f1d3689d23
branches:  trunk
changeset: 464465:e2f1d3689d23
user:      grant <grant%pkgsrc.org@localhost>
date:      Wed Dec 10 07:21:20 2003 +0000

description:
always use local glob() as some glob() implementations have security
issues. suggested by lukem.

diffstat:

 pkgtools/libnbcompat/files/Makefile.in          |  13 +--
 pkgtools/libnbcompat/files/configure            |  73 +------------------------
 pkgtools/libnbcompat/files/configure.ac         |  22 +------
 pkgtools/libnbcompat/files/dummy.c              |   4 -
 pkgtools/libnbcompat/files/nbcompat.h           |  16 +---
 pkgtools/libnbcompat/files/nbcompat/config.h.in |   9 ---
 6 files changed, 15 insertions(+), 122 deletions(-)

diffs (247 lines):

diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/Makefile.in
--- a/pkgtools/libnbcompat/files/Makefile.in    Wed Dec 10 04:03:52 2003 +0000
+++ b/pkgtools/libnbcompat/files/Makefile.in    Wed Dec 10 07:21:20 2003 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.in,v 1.21 2003/12/08 15:28:54 grant Exp $
+# $NetBSD: Makefile.in,v 1.22 2003/12/10 07:21:20 grant Exp $
 #
 
 srcdir=                @srcdir@
@@ -24,7 +24,8 @@
                nbcompat/nbtypes.h nbcompat/poll.h nbcompat/rmd160.h \
                nbcompat/sha1.h nbcompat/statfs.h nbcompat/vis.h
 
-OBJS=          @LIBOBJS@
+# always use our local glob() implementation.
+OBJS=          glob.o @LIBOBJS@
 
 LINK=          $(CCLD) $(CFLAGS) $(LDFLAGS) -o $@
 COMPILE=       $(CC) $(CPPFLAGS) $(CFLAGS)
@@ -36,12 +37,8 @@
 .c.o: nbcompat/nbtypes.h
        $(COMPILE) $(DEFS) -c $<
 
-# Add dummy.o not to become totally empty, which some ld's don't like.
-$(LIB): $(OBJS) dummy.o
-       @set -x; case "$(OBJS)" in              \
-               *.*)    $(AR) cr $@ $(OBJS);;   \
-               *)      $(AR) cr $@ dummy.o;;   \
-               esac
+$(LIB): $(OBJS)
+       $(AR) cr $@ $(OBJS)
        $(RANLIB) $@
 
 nbcompat/nbconfig.h: nbcompat/config.h
diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/configure
--- a/pkgtools/libnbcompat/files/configure      Wed Dec 10 04:03:52 2003 +0000
+++ b/pkgtools/libnbcompat/files/configure      Wed Dec 10 07:21:20 2003 +0000
@@ -3167,9 +3167,8 @@
 
 
 
-
 for ac_header in arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
-       errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \
+       errno.h fcntl.h fts.h inttypes.h libutil.h limits.h \
        machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \
        paths.h poll.h pwd.h stdint.h stdlib.h stringlist.h strings.h \
        string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \
@@ -6321,8 +6320,7 @@
 
 
 
-
-for ac_func in err fgetln fparseln fseeko getenv glob inet_ntop \
+for ac_func in err fgetln fparseln fseeko getenv inet_ntop \
        inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
        poll setprogname snprintf strdup strerror strlcat strlcpy \
        strmode strptime strsep strtoll timegm usleep
@@ -8080,73 +8078,6 @@
        LIBOBJS="$LIBOBJS statfs.$ac_objext"
 fi
 
-pkg_use_nbcompat_glob=yes
-
-       echo "$as_me:$LINENO: checking if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h" >&5
-echo $ECHO_N "checking if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h... $ECHO_C" >&6
-if test "${pkg_cv_GLOB_NOMATCH_ABORTED+set}" = set; then
-  echo $ECHO_N "(cached) $ECHO_C" >&6
-else
-
-               cat >conftest.$ac_ext <<_ACEOF
-#line $LINENO "configure"
-/* confdefs.h.  */
-_ACEOF
-cat confdefs.h >>conftest.$ac_ext
-cat >>conftest.$ac_ext <<_ACEOF
-/* end confdefs.h.  */
-  #include <glob.h>
-int
-main ()
-{
-  int f = GLOB_NOMATCH + GLOB_ABORTED ;
-  ;
-  return 0;
-}
-_ACEOF
-rm -f conftest.$ac_objext
-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
-  (eval $ac_compile) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); } &&
-         { ac_try='test -s conftest.$ac_objext'
-  { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  echo "$as_me:$LINENO: \$? = $ac_status" >&5
-  (exit $ac_status); }; }; then
-   pkg_cv_GLOB_NOMATCH_ABORTED=yes
-else
-  echo "$as_me: failed program was:" >&5
-sed 's/^/| /' conftest.$ac_ext >&5
-
- pkg_cv_GLOB_NOMATCH_ABORTED=no
-fi
-rm -f conftest.$ac_objext conftest.$ac_ext
-
-fi
-echo "$as_me:$LINENO: result: $pkg_cv_GLOB_NOMATCH_ABORTED" >&5
-echo "${ECHO_T}$pkg_cv_GLOB_NOMATCH_ABORTED" >&6
-       if test "x$pkg_cv_GLOB_NOMATCH_ABORTED" = "xyes"; then
-                pkg_use_nbcompat_glob=no
-       else
-
-               :
-       fi
-
-
-if test $pkg_use_nbcompat_glob = yes; then
-       cat >>confdefs.h <<\_ACEOF
-#define HAVE_NBCOMPAT_GLOB 1
-_ACEOF
-
-
-
-       LIBOBJS="$LIBOBJS glob.$ac_objext"
-fi
-
-
 if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
 
 
diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/configure.ac
--- a/pkgtools/libnbcompat/files/configure.ac   Wed Dec 10 04:03:52 2003 +0000
+++ b/pkgtools/libnbcompat/files/configure.ac   Wed Dec 10 07:21:20 2003 +0000
@@ -1,4 +1,4 @@
-dnl $NetBSD: configure.ac,v 1.32 2003/12/08 14:52:02 grant Exp $
+dnl $NetBSD: configure.ac,v 1.33 2003/12/10 07:21:20 grant Exp $
 
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.52)
@@ -33,7 +33,7 @@
 AC_HEADER_TIME
 
 AC_CHECK_HEADERS([arpa/nameser.h assert.h bind/bitypes.h dirent.h err.h \
-       errno.h fcntl.h fts.h glob.h inttypes.h libutil.h limits.h \
+       errno.h fcntl.h fts.h inttypes.h libutil.h limits.h \
        machine/endian.h memory.h ndir.h netdb.h netinet/in6_machtypes.h \
        paths.h poll.h pwd.h stdint.h stdlib.h stringlist.h strings.h \
        string.h sys/bitypes.h sys/byteorder.h sys/cdefs.h sys/dir.h \
@@ -117,7 +117,7 @@
 AC_FUNC_STRERROR_R
 AC_FUNC_VPRINTF
 
-AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv glob inet_ntop \
+AC_REPLACE_FUNCS([err fgetln fparseln fseeko getenv inet_ntop \
        inet_pton isblank lchflags lchmod lchown lutimes mkstemp mkdtemp \
        poll setprogname snprintf strdup strerror strlcat strlcpy \
        strmode strptime strsep strtoll timegm usleep])
@@ -216,22 +216,6 @@
        AC_LIBOBJ(statfs)
 fi
 
-pkg_use_nbcompat_glob=yes
-AC_MSG_TRY_COMPILE([if GLOB_NOMATCH and GLOB_ABORTED are defined in glob.h],
-       pkg_cv_GLOB_NOMATCH_ABORTED,
-       [ #include <glob.h> ],
-       [ int f = GLOB_NOMATCH + GLOB_ABORTED ],
-       [ pkg_use_nbcompat_glob=no ])
-
-if test $pkg_use_nbcompat_glob = yes; then
-       AC_DEFINE(HAVE_NBCOMPAT_GLOB, 1)
-       AH_TEMPLATE([HAVE_NBCOMPAT_GLOB], [
-               Define to 1 if the `glob' function is built into the library.
-       ])
-       AC_LIBOBJ(glob)
-fi
-
-
 if test $ac_cv_type_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
 
 dnl            We assume that if sprintf() supports %lld or %qd,
diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/dummy.c
--- a/pkgtools/libnbcompat/files/dummy.c        Wed Dec 10 04:03:52 2003 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,4 +0,0 @@
-/*     $NetBSD: dummy.c,v 1.1 2003/09/14 07:38:13 itohy Exp $  */
-
-/* Written by ITOH Yasufumi in 2003.  Public domain. */
-static int nbcompat_dummy;
diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/nbcompat.h
--- a/pkgtools/libnbcompat/files/nbcompat.h     Wed Dec 10 04:03:52 2003 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat.h     Wed Dec 10 07:21:20 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nbcompat.h,v 1.28 2003/12/08 14:52:02 grant Exp $      */
+/*     $NetBSD: nbcompat.h,v 1.29 2003/12/10 07:21:20 grant Exp $      */
 
 /*-
  * Copyright (c) 2003 The NetBSD Foundation, Inc.
@@ -225,17 +225,11 @@
 # include <nbcompat/err.h>
 #endif
 
-#if HAVE_NBCOMPAT_GLOB
-# if HAVE_GLOB_H
-#  undef HAVE_GLOB_H
-# endif
+/* always use our glob.h */
+#if HAVE_GLOB_H
+# undef HAVE_GLOB_H
 #endif
-
-#if HAVE_GLOB_H
-# include <glob.h>
-#else
-# include <nbcompat/glob.h>
-#endif
+#include <nbcompat/glob.h>
 
 #if HAVE_SYS_MKDEV_H
 # include <sys/mkdev.h>
diff -r 3bbf86c8cbf1 -r e2f1d3689d23 pkgtools/libnbcompat/files/nbcompat/config.h.in
--- a/pkgtools/libnbcompat/files/nbcompat/config.h.in   Wed Dec 10 04:03:52 2003 +0000
+++ b/pkgtools/libnbcompat/files/nbcompat/config.h.in   Wed Dec 10 07:21:20 2003 +0000
@@ -70,12 +70,6 @@
 /* Define to 1 if you have the `gid_from_group' function. */
 #undef HAVE_GID_FROM_GROUP
 
-/* Define to 1 if you have the `glob' function. */
-#undef HAVE_GLOB
-
-/* Define to 1 if you have the <glob.h> header file. */
-#undef HAVE_GLOB_H
-
 /* Define to 1 if you have the `group_from_gid' function. */
 #undef HAVE_GROUP_FROM_GID
 
@@ -158,9 +152,6 @@
 /* Define to 1 if the `getopt_long' function is built into the library. */
 #undef HAVE_NBCOMPAT_GETOPT_LONG
 
-/* Define to 1 if the `glob' function is built into the library. */
-#undef HAVE_NBCOMPAT_GLOB
-
 /* Define to 1 if the `MD5Init' function is built into the library. */
 #undef HAVE_NBCOMPAT_MD5INIT
 



Home | Main Index | Thread Index | Old Index