Module Name: othersrc
Committed By: lukem
Date: Sun Jul 5 10:55:11 UTC 2020
Modified Files:
othersrc/usr.bin/tnftp: ChangeLog NEWS configure.ac
Log Message:
Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.
To generate a diff of this commit:
cvs rdiff -u -r1.71 -r1.72 othersrc/usr.bin/tnftp/ChangeLog
cvs rdiff -u -r1.13 -r1.14 othersrc/usr.bin/tnftp/NEWS
cvs rdiff -u -r1.35 -r1.36 othersrc/usr.bin/tnftp/configure.ac
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: othersrc/usr.bin/tnftp/ChangeLog
diff -u othersrc/usr.bin/tnftp/ChangeLog:1.71 othersrc/usr.bin/tnftp/ChangeLog:1.72
--- othersrc/usr.bin/tnftp/ChangeLog:1.71 Sun Jul 5 10:18:19 2020
+++ othersrc/usr.bin/tnftp/ChangeLog Sun Jul 5 10:55:11 2020
@@ -1,6 +1,8 @@
-$NetBSD: ChangeLog,v 1.71 2020/07/05 10:18:19 lukem Exp $
+$NetBSD: ChangeLog,v 1.72 2020/07/05 10:55:11 lukem Exp $
-Sun Jul 5 10:17:44 UTC 2020 lukem
+Sun Jul 5 10:51:50 UTC 2020 lukem
+
+ * Only replace glob if GLOB_BRACE and GLOB_TILDE aren't available.
* libnetbsd/snprintf.c: Rename static functions to avoid conflicts
with standard names.
Index: othersrc/usr.bin/tnftp/NEWS
diff -u othersrc/usr.bin/tnftp/NEWS:1.13 othersrc/usr.bin/tnftp/NEWS:1.14
--- othersrc/usr.bin/tnftp/NEWS:1.13 Sun Jul 5 10:29:08 2020
+++ othersrc/usr.bin/tnftp/NEWS Sun Jul 5 10:55:11 2020
@@ -1,4 +1,4 @@
-$NetBSD: NEWS,v 1.13 2020/07/05 10:29:08 lukem Exp $
+$NetBSD: NEWS,v 1.14 2020/07/05 10:55:11 lukem Exp $
This is tnftp version (unreleased).
@@ -21,6 +21,8 @@ Changes in tnftp 20151004 to (unreleased
Improve SSL error reporting, and IPv6 endpoint reporting.
+ Use the system glob() if required extensions are supported.
+
Use the system libedit library by default, instead of
the local (embedded) libedit.
Index: othersrc/usr.bin/tnftp/configure.ac
diff -u othersrc/usr.bin/tnftp/configure.ac:1.35 othersrc/usr.bin/tnftp/configure.ac:1.36
--- othersrc/usr.bin/tnftp/configure.ac:1.35 Sun Jul 5 09:37:53 2020
+++ othersrc/usr.bin/tnftp/configure.ac Sun Jul 5 10:55:11 2020
@@ -1,4 +1,4 @@
-# $NetBSD: configure.ac,v 1.35 2020/07/05 09:37:53 lukem Exp $
+# $NetBSD: configure.ac,v 1.36 2020/07/05 10:55:11 lukem Exp $
#
# Process this file with autoconf to produce a configure script.
@@ -9,7 +9,7 @@ AC_COPYRIGHT([
Copyright (c) 1999-2016 The NetBSD Foundation, Inc.
All rights reserved.
])
-AC_REVISION([$Revision: 1.35 $])
+AC_REVISION([$Revision: 1.36 $])
AS_SHELL_SANITIZE()
@@ -75,6 +75,8 @@ AH_TEMPLATE([HAVE___BUILTIN_VA_COPY],
[Define to 1 if the '__builtin_va_copy' function is supported.])
AH_TEMPLATE([NO_EDITCOMPLETE],
[Define if disabling command-line editing and completion.])
+AH_TEMPLATE([USE_GLOB_H],
+ [Define if using system <glob.h> instead of local glob.])
AH_TEMPLATE([USE_INET6],
[Define if using IPv6 support.])
AH_TEMPLATE([USE_SOCKS],
@@ -332,9 +334,22 @@ AC_CHECK_FUNCS([getcwd gethostbyaddr get
AS_IF([test "$ac_cv_func_getpgrp" = yes], [AC_FUNC_GETPGRP])
AS_IF([test "$ac_cv_func_strptime" = yes], [AC_CHECK_DECLS([strptime])])
-# Always replace glob(); the vendor's may not be secure.
+# Use system glob if GLOB_BRACE and GLOB_TILDE are available.
#
-AC_LIBOBJ([glob])
+use_local_glob=yes
+AC_CHECK_HEADER([glob.h],
+ [AC_MSG_CHECKING([glob supports required extensions])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <glob.h>]], [[
+int f = GLOB_BRACE | GLOB_TILDE;
+]])],
+ [AC_MSG_RESULT([yes])
+ use_local_glob=no],
+ [AC_MSG_RESULT([no - using local version])],
+ [AC_MSG_RESULT([unknown - cross-compiling])])])
+AS_IF([test "$use_local_glob" = yes],
+ [AC_LIBOBJ([glob])],
+ [AC_DEFINE([USE_GLOB_H], [1])])
# We assume that if sprintf() supports %lld or %qd,
# then all of *printf() does. If not, disable long long