Browse code

clamonacc - move and configure fts fix

Mickey Sola authored on 2019/04/15 23:29:20
Showing 36 changed files
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -37,17 +37,7 @@
37 37
 
38 38
 
39 39
 VPATH = @srcdir@
40
-am__is_gnu_make = { \
41
-  if test -z '$(MAKELEVEL)'; then \
42
-    false; \
43
-  elif test -n '$(MAKE_HOST)'; then \
44
-    true; \
45
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
46
-    true; \
47
-  else \
48
-    false; \
49
-  fi; \
50
-}
40
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
51 41
 am__make_running_with_option = \
52 42
   case $${target_option-} in \
53 43
       ?) ;; \
... ...
@@ -114,6 +104,35 @@ target_triplet = @target@
114 114
 @ENABLE_CLAMSUBMIT_TRUE@am__append_1 = clamsubmit
115 115
 @ENABLE_FUZZ_TRUE@am__append_2 = fuzz
116 116
 subdir = .
117
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
118
+	$(top_srcdir)/configure $(am__configure_deps) \
119
+	$(srcdir)/clamav-config.h.in \
120
+	$(top_srcdir)/libclammspack/config.h.in \
121
+	$(srcdir)/clamav-config.in $(srcdir)/libclamav.pc.in \
122
+	$(srcdir)/platform.h.in \
123
+	$(top_srcdir)/docs/man/clamav-milter.8.in \
124
+	$(top_srcdir)/docs/man/clamav-milter.conf.5.in \
125
+	$(top_srcdir)/docs/man/clambc.1.in \
126
+	$(top_srcdir)/docs/man/clamconf.1.in \
127
+	$(top_srcdir)/docs/man/clamd.8.in \
128
+	$(top_srcdir)/docs/man/clamd.conf.5.in \
129
+	$(top_srcdir)/docs/man/clamdscan.1.in \
130
+	$(top_srcdir)/docs/man/clamscan.1.in \
131
+	$(top_srcdir)/docs/man/freshclam.1.in \
132
+	$(top_srcdir)/docs/man/freshclam.conf.5.in \
133
+	$(top_srcdir)/docs/man/sigtool.1.in \
134
+	$(top_srcdir)/docs/man/clamdtop.1.in \
135
+	$(top_srcdir)/docs/man/clamsubmit.1.in \
136
+	$(srcdir)/clamav-types.h.in COPYING config/ar-lib \
137
+	config/compile config/config.guess config/config.rpath \
138
+	config/config.sub config/depcomp config/install-sh \
139
+	config/missing config/ylwrap config/ltmain.sh \
140
+	$(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
141
+	$(top_srcdir)/config/config.guess \
142
+	$(top_srcdir)/config/config.rpath \
143
+	$(top_srcdir)/config/config.sub \
144
+	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
145
+	$(top_srcdir)/config/missing
117 146
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
118 147
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
119 148
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -192,8 +211,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
192 192
 	$(top_srcdir)/configure.ac
193 193
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
194 194
 	$(ACLOCAL_M4)
195
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
196
-	$(am__configure_deps) $(am__DIST_COMMON)
197 195
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
198 196
  configure.lineno config.status.lineno
199 197
 mkinstalldirs = $(install_sh) -d
... ...
@@ -297,32 +314,6 @@ CSCOPE = cscope
297 297
 DIST_SUBDIRS = libltdl libclamav libfreshclam clamscan clamd clamdscan clamonacc \
298 298
 	freshclam sigtool clamconf database docs etc clamav-milter \
299 299
 	test clamdtop clambc unit_tests clamsubmit libfreshclam
300
-am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/clamav-config.h.in \
301
-	$(srcdir)/clamav-config.in $(srcdir)/clamav-types.h.in \
302
-	$(srcdir)/libclamav.pc.in $(srcdir)/platform.h.in \
303
-	$(top_srcdir)/config/ar-lib $(top_srcdir)/config/compile \
304
-	$(top_srcdir)/config/config.guess \
305
-	$(top_srcdir)/config/config.rpath \
306
-	$(top_srcdir)/config/config.sub \
307
-	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
308
-	$(top_srcdir)/config/missing \
309
-	$(top_srcdir)/docs/man/clamav-milter.8.in \
310
-	$(top_srcdir)/docs/man/clamav-milter.conf.5.in \
311
-	$(top_srcdir)/docs/man/clambc.1.in \
312
-	$(top_srcdir)/docs/man/clamconf.1.in \
313
-	$(top_srcdir)/docs/man/clamd.8.in \
314
-	$(top_srcdir)/docs/man/clamd.conf.5.in \
315
-	$(top_srcdir)/docs/man/clamdscan.1.in \
316
-	$(top_srcdir)/docs/man/clamdtop.1.in \
317
-	$(top_srcdir)/docs/man/clamscan.1.in \
318
-	$(top_srcdir)/docs/man/clamsubmit.1.in \
319
-	$(top_srcdir)/docs/man/freshclam.1.in \
320
-	$(top_srcdir)/docs/man/freshclam.conf.5.in \
321
-	$(top_srcdir)/docs/man/sigtool.1.in \
322
-	$(top_srcdir)/libclammspack/config.h.in COPYING config/ar-lib \
323
-	config/compile config/config.guess config/config.rpath \
324
-	config/config.sub config/depcomp config/install-sh \
325
-	config/ltmain.sh config/missing config/ylwrap
326 300
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
327 301
 distdir = $(PACKAGE)-$(VERSION)
328 302
 top_distdir = $(distdir)
... ...
@@ -598,7 +589,6 @@ pdfdir = @pdfdir@
598 598
 prefix = @prefix@
599 599
 program_transform_name = @program_transform_name@
600 600
 psdir = @psdir@
601
-runstatedir = @runstatedir@
602 601
 sbindir = @sbindir@
603 602
 sharedstatedir = @sharedstatedir@
604 603
 srcdir = @srcdir@
... ...
@@ -648,6 +638,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
648 648
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
649 649
 	$(am__cd) $(top_srcdir) && \
650 650
 	  $(AUTOMAKE) --foreign Makefile
651
+.PRECIOUS: Makefile
651 652
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
652 653
 	@case '$?' in \
653 654
 	  *config.status*) \
... ...
@@ -999,7 +990,7 @@ distdir: $(DISTFILES)
999 999
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
1000 1000
 	|| chmod -R a+r "$(distdir)"
1001 1001
 dist-gzip: distdir
1002
-	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
1002
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
1003 1003
 	$(am__post_remove_distdir)
1004 1004
 dist-bzip2: distdir
1005 1005
 	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
... ...
@@ -1014,17 +1005,17 @@ dist-xz: distdir
1014 1014
 	$(am__post_remove_distdir)
1015 1015
 
1016 1016
 dist-tarZ: distdir
1017
-	@echo WARNING: "Support for distribution archives compressed with" \
1018
-		       "legacy program 'compress' is deprecated." >&2
1017
+	@echo WARNING: "Support for shar distribution archives is" \
1018
+	               "deprecated." >&2
1019 1019
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
1020 1020
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
1021 1021
 	$(am__post_remove_distdir)
1022 1022
 
1023 1023
 dist-shar: distdir
1024
-	@echo WARNING: "Support for shar distribution archives is" \
1025
-	               "deprecated." >&2
1024
+	@echo WARNING: "Support for distribution archives compressed with" \
1025
+		       "legacy program 'compress' is deprecated." >&2
1026 1026
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
1027
-	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
1027
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
1028 1028
 	$(am__post_remove_distdir)
1029 1029
 
1030 1030
 dist-zip: distdir
... ...
@@ -1042,7 +1033,7 @@ dist dist-all:
1042 1042
 distcheck: dist
1043 1043
 	case '$(DIST_ARCHIVES)' in \
1044 1044
 	*.tar.gz*) \
1045
-	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
1045
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
1046 1046
 	*.tar.bz2*) \
1047 1047
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
1048 1048
 	*.tar.lz*) \
... ...
@@ -1052,23 +1043,23 @@ distcheck: dist
1052 1052
 	*.tar.Z*) \
1053 1053
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
1054 1054
 	*.shar.gz*) \
1055
-	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
1055
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
1056 1056
 	*.zip*) \
1057 1057
 	  unzip $(distdir).zip ;;\
1058 1058
 	esac
1059 1059
 	chmod -R a-w $(distdir)
1060 1060
 	chmod u+w $(distdir)
1061
-	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
1061
+	mkdir $(distdir)/_build $(distdir)/_inst
1062 1062
 	chmod a-w $(distdir)
1063 1063
 	test -d $(distdir)/_build || exit 0; \
1064 1064
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
1065 1065
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
1066 1066
 	  && am__cwd=`pwd` \
1067
-	  && $(am__cd) $(distdir)/_build/sub \
1068
-	  && ../../configure \
1067
+	  && $(am__cd) $(distdir)/_build \
1068
+	  && ../configure \
1069 1069
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
1070 1070
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
1071
-	    --srcdir=../.. --prefix="$$dc_install_base" \
1071
+	    --srcdir=.. --prefix="$$dc_install_base" \
1072 1072
 	  && $(MAKE) $(AM_MAKEFLAGS) \
1073 1073
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
1074 1074
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
... ...
@@ -1253,8 +1244,6 @@ uninstall-am: uninstall-binSCRIPTS uninstall-nodist_includeHEADERS \
1253 1253
 	uninstall-am uninstall-binSCRIPTS \
1254 1254
 	uninstall-nodist_includeHEADERS uninstall-pkgconfigDATA
1255 1255
 
1256
-.PRECIOUS: Makefile
1257
-
1258 1256
 lcov:
1259 1257
 	($(MAKE); cd unit_tests; $(MAKE) lcov)
1260 1258
 quick-check:
... ...
@@ -1,6 +1,6 @@
1
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
1
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2 2
 
3
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
3
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4 4
 
5 5
 # This file is free software; the Free Software Foundation
6 6
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -20,63 +20,32 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
20 20
 If you have problems, you may need to regenerate the build system entirely.
21 21
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22 22
 
23
-dnl pkg.m4 - Macros to locate and utilise pkg-config.   -*- Autoconf -*-
24
-dnl serial 11 (pkg-config-0.29.1)
25
-dnl
26
-dnl Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27
-dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists@gmail.com>
28
-dnl
29
-dnl This program is free software; you can redistribute it and/or modify
30
-dnl it under the terms of the GNU General Public License as published by
31
-dnl the Free Software Foundation; either version 2 of the License, or
32
-dnl (at your option) any later version.
33
-dnl
34
-dnl This program is distributed in the hope that it will be useful, but
35
-dnl WITHOUT ANY WARRANTY; without even the implied warranty of
36
-dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
37
-dnl General Public License for more details.
38
-dnl
39
-dnl You should have received a copy of the GNU General Public License
40
-dnl along with this program; if not, write to the Free Software
41
-dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
42
-dnl 02111-1307, USA.
43
-dnl
44
-dnl As a special exception to the GNU General Public License, if you
45
-dnl distribute this file as part of a program that contains a
46
-dnl configuration script generated by Autoconf, you may include it under
47
-dnl the same distribution terms that you use for the rest of that
48
-dnl program.
49
-
50
-dnl PKG_PREREQ(MIN-VERSION)
51
-dnl -----------------------
52
-dnl Since: 0.29
53
-dnl
54
-dnl Verify that the version of the pkg-config macros are at least
55
-dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
56
-dnl installed version of pkg-config, this checks the developer's version
57
-dnl of pkg.m4 when generating configure.
58
-dnl
59
-dnl To ensure that this macro is defined, also add:
60
-dnl m4_ifndef([PKG_PREREQ],
61
-dnl     [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
62
-dnl
63
-dnl See the "Since" comment for each macro you use to see what version
64
-dnl of the macros you require.
65
-m4_defun([PKG_PREREQ],
66
-[m4_define([PKG_MACROS_VERSION], [0.29.1])
67
-m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
68
-    [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
69
-])dnl PKG_PREREQ
70
-
71
-dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
72
-dnl ----------------------------------
73
-dnl Since: 0.16
74
-dnl
75
-dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
76
-dnl first found in the path. Checks that the version of pkg-config found
77
-dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
78
-dnl used since that's the first version where most current features of
79
-dnl pkg-config existed.
23
+# pkg.m4 - Macros to locate and utilise pkg-config.            -*- Autoconf -*-
24
+# serial 1 (pkg-config-0.24)
25
+# 
26
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
27
+#
28
+# This program is free software; you can redistribute it and/or modify
29
+# it under the terms of the GNU General Public License as published by
30
+# the Free Software Foundation; either version 2 of the License, or
31
+# (at your option) any later version.
32
+#
33
+# This program is distributed in the hope that it will be useful, but
34
+# WITHOUT ANY WARRANTY; without even the implied warranty of
35
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
36
+# General Public License for more details.
37
+#
38
+# You should have received a copy of the GNU General Public License
39
+# along with this program; if not, write to the Free Software
40
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
41
+#
42
+# As a special exception to the GNU General Public License, if you
43
+# distribute this file as part of a program that contains a
44
+# configuration script generated by Autoconf, you may include it under
45
+# the same distribution terms that you use for the rest of that program.
46
+
47
+# PKG_PROG_PKG_CONFIG([MIN-VERSION])
48
+# ----------------------------------
80 49
 AC_DEFUN([PKG_PROG_PKG_CONFIG],
81 50
 [m4_pattern_forbid([^_?PKG_[A-Z_]+$])
82 51
 m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
... ...
@@ -98,19 +67,18 @@ if test -n "$PKG_CONFIG"; then
98 98
 		PKG_CONFIG=""
99 99
 	fi
100 100
 fi[]dnl
101
-])dnl PKG_PROG_PKG_CONFIG
101
+])# PKG_PROG_PKG_CONFIG
102 102
 
103
-dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
104
-dnl -------------------------------------------------------------------
105
-dnl Since: 0.18
106
-dnl
107
-dnl Check to see whether a particular set of modules exists. Similar to
108
-dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
109
-dnl
110
-dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
111
-dnl only at the first occurence in configure.ac, so if the first place
112
-dnl it's called might be skipped (such as if it is within an "if", you
113
-dnl have to call PKG_CHECK_EXISTS manually
103
+# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
104
+#
105
+# Check to see whether a particular set of modules exists.  Similar
106
+# to PKG_CHECK_MODULES(), but does not set variables or print errors.
107
+#
108
+# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
109
+# only at the first occurence in configure.ac, so if the first place
110
+# it's called might be skipped (such as if it is within an "if", you
111
+# have to call PKG_CHECK_EXISTS manually
112
+# --------------------------------------------------------------
114 113
 AC_DEFUN([PKG_CHECK_EXISTS],
115 114
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
116 115
 if test -n "$PKG_CONFIG" && \
... ...
@@ -120,10 +88,8 @@ m4_ifvaln([$3], [else
120 120
   $3])dnl
121 121
 fi])
122 122
 
123
-dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
124
-dnl ---------------------------------------------
125
-dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
126
-dnl pkg_failed based on the result.
123
+# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
124
+# ---------------------------------------------
127 125
 m4_define([_PKG_CONFIG],
128 126
 [if test -n "$$1"; then
129 127
     pkg_cv_[]$1="$$1"
... ...
@@ -135,11 +101,10 @@ m4_define([_PKG_CONFIG],
135 135
  else
136 136
     pkg_failed=untried
137 137
 fi[]dnl
138
-])dnl _PKG_CONFIG
138
+])# _PKG_CONFIG
139 139
 
140
-dnl _PKG_SHORT_ERRORS_SUPPORTED
141
-dnl ---------------------------
142
-dnl Internal check to see if pkg-config supports short errors.
140
+# _PKG_SHORT_ERRORS_SUPPORTED
141
+# -----------------------------
143 142
 AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
144 143
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])
145 144
 if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
... ...
@@ -147,17 +112,19 @@ if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
147 147
 else
148 148
         _pkg_short_errors_supported=no
149 149
 fi[]dnl
150
-])dnl _PKG_SHORT_ERRORS_SUPPORTED
150
+])# _PKG_SHORT_ERRORS_SUPPORTED
151 151
 
152 152
 
153
-dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
154
-dnl   [ACTION-IF-NOT-FOUND])
155
-dnl --------------------------------------------------------------
156
-dnl Since: 0.4.0
157
-dnl
158
-dnl Note that if there is a possibility the first call to
159
-dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
160
-dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
153
+# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
154
+# [ACTION-IF-NOT-FOUND])
155
+#
156
+#
157
+# Note that if there is a possibility the first call to
158
+# PKG_CHECK_MODULES might not happen, you should be sure to include an
159
+# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
160
+#
161
+#
162
+# --------------------------------------------------------------
161 163
 AC_DEFUN([PKG_CHECK_MODULES],
162 164
 [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
163 165
 AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
... ...
@@ -211,92 +178,9 @@ else
211 211
         AC_MSG_RESULT([yes])
212 212
 	$3
213 213
 fi[]dnl
214
-])dnl PKG_CHECK_MODULES
215
-
216
-
217
-dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
218
-dnl   [ACTION-IF-NOT-FOUND])
219
-dnl ---------------------------------------------------------------------
220
-dnl Since: 0.29
221
-dnl
222
-dnl Checks for existence of MODULES and gathers its build flags with
223
-dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
224
-dnl and VARIABLE-PREFIX_LIBS from --libs.
225
-dnl
226
-dnl Note that if there is a possibility the first call to
227
-dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
228
-dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
229
-dnl configure.ac.
230
-AC_DEFUN([PKG_CHECK_MODULES_STATIC],
231
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
232
-_save_PKG_CONFIG=$PKG_CONFIG
233
-PKG_CONFIG="$PKG_CONFIG --static"
234
-PKG_CHECK_MODULES($@)
235
-PKG_CONFIG=$_save_PKG_CONFIG[]dnl
236
-])dnl PKG_CHECK_MODULES_STATIC
237
-
214
+])# PKG_CHECK_MODULES
238 215
 
239
-dnl PKG_INSTALLDIR([DIRECTORY])
240
-dnl -------------------------
241
-dnl Since: 0.27
242
-dnl
243
-dnl Substitutes the variable pkgconfigdir as the location where a module
244
-dnl should install pkg-config .pc files. By default the directory is
245
-dnl $libdir/pkgconfig, but the default can be changed by passing
246
-dnl DIRECTORY. The user can override through the --with-pkgconfigdir
247
-dnl parameter.
248
-AC_DEFUN([PKG_INSTALLDIR],
249
-[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
250
-m4_pushdef([pkg_description],
251
-    [pkg-config installation directory @<:@]pkg_default[@:>@])
252
-AC_ARG_WITH([pkgconfigdir],
253
-    [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],,
254
-    [with_pkgconfigdir=]pkg_default)
255
-AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
256
-m4_popdef([pkg_default])
257
-m4_popdef([pkg_description])
258
-])dnl PKG_INSTALLDIR
259
-
260
-
261
-dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
262
-dnl --------------------------------
263
-dnl Since: 0.27
264
-dnl
265
-dnl Substitutes the variable noarch_pkgconfigdir as the location where a
266
-dnl module should install arch-independent pkg-config .pc files. By
267
-dnl default the directory is $datadir/pkgconfig, but the default can be
268
-dnl changed by passing DIRECTORY. The user can override through the
269
-dnl --with-noarch-pkgconfigdir parameter.
270
-AC_DEFUN([PKG_NOARCH_INSTALLDIR],
271
-[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
272
-m4_pushdef([pkg_description],
273
-    [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@])
274
-AC_ARG_WITH([noarch-pkgconfigdir],
275
-    [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],,
276
-    [with_noarch_pkgconfigdir=]pkg_default)
277
-AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
278
-m4_popdef([pkg_default])
279
-m4_popdef([pkg_description])
280
-])dnl PKG_NOARCH_INSTALLDIR
281
-
282
-
283
-dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
284
-dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
285
-dnl -------------------------------------------
286
-dnl Since: 0.28
287
-dnl
288
-dnl Retrieves the value of the pkg-config variable for the given module.
289
-AC_DEFUN([PKG_CHECK_VAR],
290
-[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
291
-AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
292
-
293
-_PKG_CONFIG([$1], [variable="][$3]["], [$2])
294
-AS_VAR_COPY([$1], [pkg_cv_][$1])
295
-
296
-AS_VAR_IF([$1], [""], [$5], [$4])dnl
297
-])dnl PKG_CHECK_VAR
298
-
299
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
216
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
300 217
 #
301 218
 # This file is free software; the Free Software Foundation
302 219
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -308,10 +192,10 @@ AS_VAR_IF([$1], [""], [$5], [$4])dnl
308 308
 # generated from the m4 files accompanying Automake X.Y.
309 309
 # (This private macro should not be called outside this file.)
310 310
 AC_DEFUN([AM_AUTOMAKE_VERSION],
311
-[am__api_version='1.15'
311
+[am__api_version='1.14'
312 312
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
313 313
 dnl require some minimum version.  Point them to the right macro.
314
-m4_if([$1], [1.15.1], [],
314
+m4_if([$1], [1.14.1], [],
315 315
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
316 316
 ])
317 317
 
... ...
@@ -327,12 +211,12 @@ m4_define([_AM_AUTOCONF_VERSION], [])
327 327
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
328 328
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
329 329
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
330
-[AM_AUTOMAKE_VERSION([1.15.1])dnl
330
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
331 331
 m4_ifndef([AC_AUTOCONF_VERSION],
332 332
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
333 333
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
334 334
 
335
-# Copyright (C) 2011-2017 Free Software Foundation, Inc.
335
+# Copyright (C) 2011-2013 Free Software Foundation, Inc.
336 336
 #
337 337
 # This file is free software; the Free Software Foundation
338 338
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -394,7 +278,7 @@ AC_SUBST([AR])dnl
394 394
 
395 395
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
396 396
 
397
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
397
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
398 398
 #
399 399
 # This file is free software; the Free Software Foundation
400 400
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -439,14 +323,15 @@ AC_SUBST([AR])dnl
439 439
 # configured tree to be moved without reconfiguration.
440 440
 
441 441
 AC_DEFUN([AM_AUX_DIR_EXPAND],
442
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
443
-# Expand $ac_aux_dir to an absolute path.
444
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
442
+[dnl Rely on autoconf to set up CDPATH properly.
443
+AC_PREREQ([2.50])dnl
444
+# expand $ac_aux_dir to an absolute path
445
+am_aux_dir=`cd $ac_aux_dir && pwd`
445 446
 ])
446 447
 
447 448
 # AM_CONDITIONAL                                            -*- Autoconf -*-
448 449
 
449
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
450
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
450 451
 #
451 452
 # This file is free software; the Free Software Foundation
452 453
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -477,7 +362,7 @@ AC_CONFIG_COMMANDS_PRE(
477 477
 Usually this means the macro was only invoked conditionally.]])
478 478
 fi])])
479 479
 
480
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
480
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
481 481
 #
482 482
 # This file is free software; the Free Software Foundation
483 483
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -668,7 +553,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
668 668
 
669 669
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
670 670
 
671
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
671
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
672 672
 #
673 673
 # This file is free software; the Free Software Foundation
674 674
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -744,7 +629,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
744 744
 
745 745
 # Do all the work for Automake.                             -*- Autoconf -*-
746 746
 
747
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
747
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
748 748
 #
749 749
 # This file is free software; the Free Software Foundation
750 750
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -834,8 +719,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
834 834
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
835 835
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
836 836
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
837
-# We need awk for the "check" target (and possibly the TAP driver).  The
838
-# system "awk" is bad on some platforms.
837
+# We need awk for the "check" target.  The system "awk" is bad on
838
+# some platforms.
839 839
 AC_REQUIRE([AC_PROG_AWK])dnl
840 840
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
841 841
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
... ...
@@ -908,11 +793,7 @@ to "yes", and re-run configure.
908 908
 END
909 909
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
910 910
   fi
911
-fi
912
-dnl The trailing newline in this macro's definition is deliberate, for
913
-dnl backward compatibility and to allow trailing 'dnl'-style comments
914
-dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
915
-])
911
+fi])
916 912
 
917 913
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
918 914
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
... ...
@@ -941,7 +822,7 @@ for _am_header in $config_headers :; do
941 941
 done
942 942
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
943 943
 
944
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
944
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
945 945
 #
946 946
 # This file is free software; the Free Software Foundation
947 947
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -952,7 +833,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
952 952
 # Define $install_sh.
953 953
 AC_DEFUN([AM_PROG_INSTALL_SH],
954 954
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
955
-if test x"${install_sh+set}" != xset; then
955
+if test x"${install_sh}" != xset; then
956 956
   case $am_aux_dir in
957 957
   *\ * | *\	*)
958 958
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
... ...
@@ -962,7 +843,7 @@ if test x"${install_sh+set}" != xset; then
962 962
 fi
963 963
 AC_SUBST([install_sh])])
964 964
 
965
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
965
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
966 966
 #
967 967
 # This file is free software; the Free Software Foundation
968 968
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -981,7 +862,7 @@ fi
981 981
 rmdir .tst 2>/dev/null
982 982
 AC_SUBST([am__leading_dot])])
983 983
 
984
-# Copyright (C) 1998-2017 Free Software Foundation, Inc.
984
+# Copyright (C) 1998-2013 Free Software Foundation, Inc.
985 985
 #
986 986
 # This file is free software; the Free Software Foundation
987 987
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1001,7 +882,7 @@ fi])
1001 1001
 
1002 1002
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
1003 1003
 
1004
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1004
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1005 1005
 #
1006 1006
 # This file is free software; the Free Software Foundation
1007 1007
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1051,7 +932,7 @@ rm -f confinc confmf
1051 1051
 
1052 1052
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
1053 1053
 
1054
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
1054
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
1055 1055
 #
1056 1056
 # This file is free software; the Free Software Foundation
1057 1057
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1090,7 +971,7 @@ fi
1090 1090
 
1091 1091
 # Helper functions for option handling.                     -*- Autoconf -*-
1092 1092
 
1093
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1093
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1094 1094
 #
1095 1095
 # This file is free software; the Free Software Foundation
1096 1096
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1119,7 +1000,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
1119 1119
 AC_DEFUN([_AM_IF_OPTION],
1120 1120
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
1121 1121
 
1122
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
1122
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
1123 1123
 #
1124 1124
 # This file is free software; the Free Software Foundation
1125 1125
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1166,7 +1047,7 @@ AC_LANG_POP([C])])
1166 1166
 # For backward compatibility.
1167 1167
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
1168 1168
 
1169
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1169
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1170 1170
 #
1171 1171
 # This file is free software; the Free Software Foundation
1172 1172
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1185,7 +1066,7 @@ AC_DEFUN([AM_RUN_LOG],
1185 1185
 
1186 1186
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
1187 1187
 
1188
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
1188
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
1189 1189
 #
1190 1190
 # This file is free software; the Free Software Foundation
1191 1191
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1266,7 +1147,7 @@ AC_CONFIG_COMMANDS_PRE(
1266 1266
 rm -f conftest.file
1267 1267
 ])
1268 1268
 
1269
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
1269
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
1270 1270
 #
1271 1271
 # This file is free software; the Free Software Foundation
1272 1272
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1326,7 +1207,7 @@ AC_SUBST([AM_BACKSLASH])dnl
1326 1326
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1327 1327
 ])
1328 1328
 
1329
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1329
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1330 1330
 #
1331 1331
 # This file is free software; the Free Software Foundation
1332 1332
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1354,7 +1235,7 @@ fi
1354 1354
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1355 1355
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1356 1356
 
1357
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
1357
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1358 1358
 #
1359 1359
 # This file is free software; the Free Software Foundation
1360 1360
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1373,7 +1254,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1373 1373
 
1374 1374
 # Check how to create a tarball.                            -*- Autoconf -*-
1375 1375
 
1376
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
1376
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1377 1377
 #
1378 1378
 # This file is free software; the Free Software Foundation
1379 1379
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -112,6 +102,8 @@ target_triplet = @target@
112 112
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@sbin_PROGRAMS =  \
113 113
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@	clamav-milter$(EXEEXT)
114 114
 subdir = clamav-milter
115
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
116
+	$(top_srcdir)/config/depcomp
115 117
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
116 118
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
117 119
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -190,7 +182,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
190 190
 	$(top_srcdir)/configure.ac
191 191
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
192 192
 	$(ACLOCAL_M4)
193
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
194 193
 mkinstalldirs = $(install_sh) -d
195 194
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
196 195
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -311,7 +302,6 @@ am__define_uniq_tagged_files = \
311 311
   done | $(am__uniquify_input)`
312 312
 ETAGS = etags
313 313
 CTAGS = ctags
314
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
315 314
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
316 315
 ACLOCAL = @ACLOCAL@
317 316
 AMTAR = @AMTAR@
... ...
@@ -547,7 +537,6 @@ pdfdir = @pdfdir@
547 547
 prefix = @prefix@
548 548
 program_transform_name = @program_transform_name@
549 549
 psdir = @psdir@
550
-runstatedir = @runstatedir@
551 550
 sbindir = @sbindir@
552 551
 sharedstatedir = @sharedstatedir@
553 552
 srcdir = @srcdir@
... ...
@@ -602,6 +591,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
602 602
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamav-milter/Makefile'; \
603 603
 	$(am__cd) $(top_srcdir) && \
604 604
 	  $(AUTOMAKE) --foreign clamav-milter/Makefile
605
+.PRECIOUS: Makefile
605 606
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
606 607
 	@case '$?' in \
607 608
 	  *config.status*) \
... ...
@@ -1042,8 +1032,6 @@ uninstall-man: uninstall-man8
1042 1042
 	tags tags-am uninstall uninstall-am uninstall-man \
1043 1043
 	uninstall-man8 uninstall-sbinPROGRAMS
1044 1044
 
1045
-.PRECIOUS: Makefile
1046
-
1047 1045
 
1048 1046
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1049 1047
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -15,17 +15,7 @@
15 15
 @SET_MAKE@
16 16
 
17 17
 VPATH = @srcdir@
18
-am__is_gnu_make = { \
19
-  if test -z '$(MAKELEVEL)'; then \
20
-    false; \
21
-  elif test -n '$(MAKE_HOST)'; then \
22
-    true; \
23
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
24
-    true; \
25
-  else \
26
-    false; \
27
-  fi; \
28
-}
18
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
29 19
 am__make_running_with_option = \
30 20
   case $${target_option-} in \
31 21
       ?) ;; \
... ...
@@ -91,6 +81,8 @@ host_triplet = @host@
91 91
 target_triplet = @target@
92 92
 bin_PROGRAMS = clambc$(EXEEXT)
93 93
 subdir = clambc
94
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
95
+	$(top_srcdir)/config/depcomp
94 96
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
95 97
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
96 98
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -169,7 +161,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
169 169
 	$(top_srcdir)/configure.ac
170 170
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
171 171
 	$(ACLOCAL_M4)
172
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
173 172
 mkinstalldirs = $(install_sh) -d
174 173
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
175 174
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -245,7 +236,6 @@ am__define_uniq_tagged_files = \
245 245
   done | $(am__uniquify_input)`
246 246
 ETAGS = etags
247 247
 CTAGS = ctags
248
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
249 248
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
250 249
 ACLOCAL = @ACLOCAL@
251 250
 AMTAR = @AMTAR@
... ...
@@ -481,7 +471,6 @@ pdfdir = @pdfdir@
481 481
 prefix = @prefix@
482 482
 program_transform_name = @program_transform_name@
483 483
 psdir = @psdir@
484
-runstatedir = @runstatedir@
485 484
 sbindir = @sbindir@
486 485
 sharedstatedir = @sharedstatedir@
487 486
 srcdir = @srcdir@
... ...
@@ -525,6 +514,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
525 525
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clambc/Makefile'; \
526 526
 	$(am__cd) $(top_srcdir) && \
527 527
 	  $(AUTOMAKE) --foreign clambc/Makefile
528
+.PRECIOUS: Makefile
528 529
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
529 530
 	@case '$?' in \
530 531
 	  *config.status*) \
... ...
@@ -899,8 +889,6 @@ uninstall-am: uninstall-binPROGRAMS
899 899
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
900 900
 	uninstall-am uninstall-binPROGRAMS
901 901
 
902
-.PRECIOUS: Makefile
903
-
904 902
 
905 903
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
906 904
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -111,6 +101,8 @@ host_triplet = @host@
111 111
 target_triplet = @target@
112 112
 bin_PROGRAMS = clamconf$(EXEEXT)
113 113
 subdir = clamconf
114
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
115
+	$(top_srcdir)/config/depcomp
114 116
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115 117
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
116 118
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -189,7 +181,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
189 189
 	$(top_srcdir)/configure.ac
190 190
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
191 191
 	$(ACLOCAL_M4)
192
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
193 192
 mkinstalldirs = $(install_sh) -d
194 193
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
195 194
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -265,7 +256,6 @@ am__define_uniq_tagged_files = \
265 265
   done | $(am__uniquify_input)`
266 266
 ETAGS = etags
267 267
 CTAGS = ctags
268
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
269 268
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
270 269
 ACLOCAL = @ACLOCAL@
271 270
 AMTAR = @AMTAR@
... ...
@@ -501,7 +491,6 @@ pdfdir = @pdfdir@
501 501
 prefix = @prefix@
502 502
 program_transform_name = @program_transform_name@
503 503
 psdir = @psdir@
504
-runstatedir = @runstatedir@
505 504
 sbindir = @sbindir@
506 505
 sharedstatedir = @sharedstatedir@
507 506
 srcdir = @srcdir@
... ...
@@ -550,6 +539,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
550 550
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamconf/Makefile'; \
551 551
 	$(am__cd) $(top_srcdir) && \
552 552
 	  $(AUTOMAKE) --foreign clamconf/Makefile
553
+.PRECIOUS: Makefile
553 554
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
554 555
 	@case '$?' in \
555 556
 	  *config.status*) \
... ...
@@ -924,8 +914,6 @@ uninstall-am: uninstall-binPROGRAMS
924 924
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
925 925
 	uninstall-am uninstall-binPROGRAMS
926 926
 
927
-.PRECIOUS: Makefile
928
-
929 927
 
930 928
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
931 929
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -48,12 +48,7 @@ clamd_SOURCES = \
48 48
     scanner.h \
49 49
     others.c \
50 50
     others.h \
51
-    shared.h \
52
-    priv_fts.h
53
-
54
-if !SYSTEM_LFS_FTS
55
-clamd_SOURCES += fts.c
56
-endif
51
+    shared.h
57 52
 
58 53
 AM_CFLAGS=@WERR_CFLAGS@
59 54
 
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -36,17 +36,7 @@
36 36
 
37 37
 
38 38
 VPATH = @srcdir@
39
-am__is_gnu_make = { \
40
-  if test -z '$(MAKELEVEL)'; then \
41
-    false; \
42
-  elif test -n '$(MAKE_HOST)'; then \
43
-    true; \
44
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
45
-    true; \
46
-  else \
47
-    false; \
48
-  fi; \
49
-}
39
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
50 40
 am__make_running_with_option = \
51 41
   case $${target_option-} in \
52 42
       ?) ;; \
... ...
@@ -111,8 +101,10 @@ build_triplet = @build@
111 111
 host_triplet = @host@
112 112
 target_triplet = @target@
113 113
 @BUILD_CLAMD_TRUE@sbin_PROGRAMS = clamd$(EXEEXT)
114
-@BUILD_CLAMD_TRUE@@SYSTEM_LFS_FTS_FALSE@am__append_1 = fts.c
115 114
 subdir = clamd
115
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
116
+	$(srcdir)/clamav-daemon.service.in \
117
+	$(srcdir)/clamav-daemon.socket.in $(top_srcdir)/config/depcomp
116 118
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
117 119
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
118 120
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -191,7 +183,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
191 191
 	$(top_srcdir)/configure.ac
192 192
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
193 193
 	$(ACLOCAL_M4)
194
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
195 194
 mkinstalldirs = $(install_sh) -d
196 195
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
197 196
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -210,16 +201,14 @@ am__clamd_SOURCES_DIST = $(top_srcdir)/shared/output.c \
210 210
 	$(top_srcdir)/shared/misc.h clamd.c tcpserver.c tcpserver.h \
211 211
 	localserver.c localserver.h session.c session.h thrmgr.c \
212 212
 	thrmgr.h server-th.c server.h scanner.c scanner.h others.c \
213
-	others.h shared.h priv_fts.h fts.c
214
-@BUILD_CLAMD_TRUE@@SYSTEM_LFS_FTS_FALSE@am__objects_1 = fts.$(OBJEXT)
213
+	others.h shared.h
215 214
 @BUILD_CLAMD_TRUE@am_clamd_OBJECTS = output.$(OBJEXT) \
216 215
 @BUILD_CLAMD_TRUE@	idmef_logging.$(OBJEXT) optparser.$(OBJEXT) \
217 216
 @BUILD_CLAMD_TRUE@	getopt.$(OBJEXT) misc.$(OBJEXT) \
218 217
 @BUILD_CLAMD_TRUE@	clamd.$(OBJEXT) tcpserver.$(OBJEXT) \
219 218
 @BUILD_CLAMD_TRUE@	localserver.$(OBJEXT) session.$(OBJEXT) \
220 219
 @BUILD_CLAMD_TRUE@	thrmgr.$(OBJEXT) server-th.$(OBJEXT) \
221
-@BUILD_CLAMD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT) \
222
-@BUILD_CLAMD_TRUE@	$(am__objects_1)
220
+@BUILD_CLAMD_TRUE@	scanner.$(OBJEXT) others.$(OBJEXT)
223 221
 clamd_OBJECTS = $(am_clamd_OBJECTS)
224 222
 clamd_LDADD = $(LDADD)
225 223
 AM_V_lt = $(am__v_lt_@AM_V@)
... ...
@@ -314,9 +303,6 @@ am__define_uniq_tagged_files = \
314 314
   done | $(am__uniquify_input)`
315 315
 ETAGS = etags
316 316
 CTAGS = ctags
317
-am__DIST_COMMON = $(srcdir)/Makefile.in \
318
-	$(srcdir)/clamav-daemon.service.in \
319
-	$(srcdir)/clamav-daemon.socket.in $(top_srcdir)/config/depcomp
320 317
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
321 318
 ACLOCAL = @ACLOCAL@
322 319
 AMTAR = @AMTAR@
... ...
@@ -552,7 +538,6 @@ pdfdir = @pdfdir@
552 552
 prefix = @prefix@
553 553
 program_transform_name = @program_transform_name@
554 554
 psdir = @psdir@
555
-runstatedir = @runstatedir@
556 555
 sbindir = @sbindir@
557 556
 sharedstatedir = @sharedstatedir@
558 557
 srcdir = @srcdir@
... ...
@@ -568,7 +553,8 @@ target_vendor = @target_vendor@
568 568
 top_build_prefix = @top_build_prefix@
569 569
 top_builddir = @top_builddir@
570 570
 top_srcdir = @top_srcdir@
571
-@BUILD_CLAMD_TRUE@clamd_SOURCES = $(top_srcdir)/shared/output.c \
571
+@BUILD_CLAMD_TRUE@clamd_SOURCES = \
572
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/output.c \
572 573
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/output.h \
573 574
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/idmef_logging.c \
574 575
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/idmef_logging.h \
... ...
@@ -577,12 +563,24 @@ top_srcdir = @top_srcdir@
577 577
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/getopt.c \
578 578
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/getopt.h \
579 579
 @BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/misc.c \
580
-@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/misc.h clamd.c \
581
-@BUILD_CLAMD_TRUE@	tcpserver.c tcpserver.h localserver.c \
582
-@BUILD_CLAMD_TRUE@	localserver.h session.c session.h thrmgr.c \
583
-@BUILD_CLAMD_TRUE@	thrmgr.h server-th.c server.h scanner.c \
584
-@BUILD_CLAMD_TRUE@	scanner.h others.c others.h shared.h \
585
-@BUILD_CLAMD_TRUE@	priv_fts.h $(am__append_1)
580
+@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.h \
581
+@BUILD_CLAMD_TRUE@    clamd.c \
582
+@BUILD_CLAMD_TRUE@    tcpserver.c \
583
+@BUILD_CLAMD_TRUE@    tcpserver.h \
584
+@BUILD_CLAMD_TRUE@    localserver.c \
585
+@BUILD_CLAMD_TRUE@    localserver.h \
586
+@BUILD_CLAMD_TRUE@    session.c \
587
+@BUILD_CLAMD_TRUE@    session.h \
588
+@BUILD_CLAMD_TRUE@    thrmgr.c \
589
+@BUILD_CLAMD_TRUE@    thrmgr.h \
590
+@BUILD_CLAMD_TRUE@    server-th.c \
591
+@BUILD_CLAMD_TRUE@    server.h \
592
+@BUILD_CLAMD_TRUE@    scanner.c \
593
+@BUILD_CLAMD_TRUE@    scanner.h \
594
+@BUILD_CLAMD_TRUE@    others.c \
595
+@BUILD_CLAMD_TRUE@    others.h \
596
+@BUILD_CLAMD_TRUE@    shared.h
597
+
586 598
 @BUILD_CLAMD_TRUE@AM_CFLAGS = @WERR_CFLAGS@
587 599
 @BUILD_CLAMD_TRUE@@INSTALL_SYSTEMD_UNITS_TRUE@systemdsystemunit_DATA = clamav-daemon.socket clamav-daemon.service
588 600
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav @SSL_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
... ...
@@ -607,6 +605,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
607 607
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamd/Makefile'; \
608 608
 	$(am__cd) $(top_srcdir) && \
609 609
 	  $(AUTOMAKE) --foreign clamd/Makefile
610
+.PRECIOUS: Makefile
610 611
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
611 612
 	@case '$?' in \
612 613
 	  *config.status*) \
... ...
@@ -705,7 +704,6 @@ distclean-compile:
705 705
 	-rm -f *.tab.c
706 706
 
707 707
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamd.Po@am__quote@
708
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/fts.Po@am__quote@
709 708
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/getopt.Po@am__quote@
710 709
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/idmef_logging.Po@am__quote@
711 710
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/localserver.Po@am__quote@
... ...
@@ -1046,8 +1044,6 @@ uninstall-am: uninstall-sbinPROGRAMS uninstall-systemdsystemunitDATA
1046 1046
 	tags tags-am uninstall uninstall-am uninstall-sbinPROGRAMS \
1047 1047
 	uninstall-systemdsystemunitDATA
1048 1048
 
1049
-.PRECIOUS: Makefile
1050
-
1051 1049
 
1052 1050
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1053 1051
 # Otherwise a system limit (for SysV at least) may be exceeded.
1054 1052
deleted file mode 100644
... ...
@@ -1,1165 +0,0 @@
1
-/* File tree traversal functions.
2
-   Copyright (C) 1994-2015 Free Software Foundation, Inc.
3
-   This file is part of the GNU C Library.
4
-
5
-   The GNU C Library is free software; you can redistribute it and/or
6
-   modify it under the terms of the GNU Lesser General Public
7
-   License as published by the Free Software Foundation; either
8
-   version 2.1 of the License, or (at your option) any later version.
9
-
10
-   The GNU C Library is distributed in the hope that it will be useful,
11
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13
-   Lesser General Public License for more details.
14
-
15
-   You should have received a copy of the GNU Lesser General Public
16
-   License along with the GNU C Library; if not, see
17
-   <http://www.gnu.org/licenses/>.  */
18
-
19
-/*-
20
- * Copyright (c) 1990, 1993, 1994
21
- *	The Regents of the University of California.  All rights reserved.
22
- *
23
- * Redistribution and use in source and binary forms, with or without
24
- * modification, are permitted provided that the following conditions
25
- * are met:
26
- * 1. Redistributions of source code must retain the above copyright
27
- *    notice, this list of conditions and the following disclaimer.
28
- * 2. Redistributions in binary form must reproduce the above copyright
29
- *    notice, this list of conditions and the following disclaimer in the
30
- *    documentation and/or other materials provided with the distribution.
31
- * 4. Neither the name of the University nor the names of its contributors
32
- *    may be used to endorse or promote products derived from this software
33
- *    without specific prior written permission.
34
- *
35
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
36
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
37
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
38
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
39
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
40
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
41
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
42
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
43
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
44
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
45
- * SUCH DAMAGE.
46
- */
47
-
48
-#if defined(LIBC_SCCS) && !defined(lint)
49
-static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
50
-#endif /* LIBC_SCCS and not lint */
51
-
52
-#if HAVE_CONFIG_H
53
-#include "clamav-config.h"
54
-#endif
55
-
56
-#if defined(FANOTIFY) && defined(C_LINUX)
57
-
58
-#include <sys/param.h>
59
-#include <sys/stat.h>
60
-#include <fcntl.h>
61
-#include <dirent.h>
62
-#include <errno.h>
63
-#include "priv_fts.h"
64
-#include <stdlib.h>
65
-#include <string.h>
66
-#include <unistd.h>
67
-
68
-#define FTS_OPEN _priv_fts_open
69
-#define FTS_CLOSE _priv_fts_close
70
-#define FTS_READ _priv_fts_read
71
-#define FTS_SET _priv_fts_set
72
-#define FTS_CHILDREN _priv_fts_children
73
-#define FTSOBJ FTS
74
-#define FTSENTRY FTSENT
75
-#define INO_T ino_t
76
-#define STAT stat
77
-#define LSTAT lstat
78
-
79
-#define internal_function
80
-# define __set_errno(val) (errno = (val))
81
-
82
-/* Largest alignment size needed, minus one.
83
-   Usually long double is the worst case.  */
84
-#ifndef ALIGNBYTES
85
-#define ALIGNBYTES	(__alignof__ (long double) - 1)
86
-#endif
87
-/* Align P to that size.  */
88
-#ifndef ALIGN
89
-#define	ALIGN(p)	(((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
90
-#endif
91
-
92
-/* Support for the LFS API version.  */
93
-#ifndef FTS_OPEN
94
-#define FTS_OPEN fts_open
95
-#define FTS_CLOSE fts_close
96
-#define FTS_READ fts_read
97
-#define FTS_SET fts_set
98
-#define FTS_CHILDREN fts_children
99
-# define FTSOBJ FTS
100
-# define FTSENTRY FTSENT
101
-# define INO_T ino_t
102
-# define STAT stat
103
-# define LSTAT lstat
104
-#endif
105
-
106
-static FTSENTRY	*fts_alloc (FTSOBJ *, const char *, size_t) internal_function;
107
-static FTSENTRY	*fts_build (FTSOBJ *, int) internal_function;
108
-static void	 fts_lfree (FTSENTRY *) internal_function;
109
-static void	 fts_load (FTSOBJ *, FTSENTRY *) internal_function;
110
-static size_t	 fts_maxarglen (char * const *) internal_function;
111
-static void	 fts_padjust (FTSOBJ *, FTSENTRY *) internal_function;
112
-static int	 fts_palloc (FTSOBJ *, size_t) internal_function;
113
-static FTSENTRY	*fts_sort (FTSOBJ *, FTSENTRY *, int) internal_function;
114
-static u_short	 fts_stat (FTSOBJ *, FTSENTRY *, int) internal_function;
115
-static int      fts_safe_changedir (FTSOBJ *, FTSENTRY *, int, const char *)
116
-     internal_function;
117
-
118
-#ifndef MAX
119
-#define MAX(a, b)	({ __typeof__ (a) _a = (a); \
120
-			   __typeof__ (b) _b = (b); \
121
-			   _a > _b ? _a : _b; })
122
-#endif
123
-
124
-#define	ISDOT(a)	(a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
125
-
126
-#define CLR(opt)	(sp->fts_options &= ~(opt))
127
-#define	ISSET(opt)	(sp->fts_options & (opt))
128
-#define	SET(opt)	(sp->fts_options |= (opt))
129
-
130
-#define	FCHDIR(sp, fd)	(!ISSET(FTS_NOCHDIR) && fchdir(fd))
131
-
132
-/* fts_build flags */
133
-#define	BCHILD		1		/* fts_children */
134
-#define	BNAMES		2		/* fts_children, names only */
135
-#define	BREAD		3		/* fts_read */
136
-
137
-FTSOBJ *
138
-FTS_OPEN (char * const *argv, int options,
139
-	  int (*compar) (const FTSENTRY **, const FTSENTRY **))
140
-{
141
-	FTSOBJ *sp;
142
-	FTSENTRY *p, *root;
143
-	int nitems;
144
-	FTSENTRY *parent = NULL;
145
-	FTSENTRY *tmp;
146
-
147
-	/* Options check. */
148
-	if (options & ~FTS_OPTIONMASK) {
149
-		__set_errno (EINVAL);
150
-		return (NULL);
151
-	}
152
-
153
-	/* Allocate/initialize the stream */
154
-	if ((sp = malloc((u_int)sizeof(FTSOBJ))) == NULL)
155
-		return (NULL);
156
-	memset(sp, 0, sizeof(FTSOBJ));
157
-	sp->fts_compar = (int (*) (const void *, const void *)) compar;
158
-	sp->fts_options = options;
159
-
160
-	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
161
-	if (ISSET(FTS_LOGICAL))
162
-		SET(FTS_NOCHDIR);
163
-
164
-	/*
165
-	 * Start out with 1K of path space, and enough, in any case,
166
-	 * to hold the user's paths.
167
-	 */
168
-#ifndef MAXPATHLEN
169
-#define MAXPATHLEN 1024
170
-#endif
171
-	size_t maxarglen = fts_maxarglen(argv);
172
-	if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
173
-		goto mem1;
174
-
175
-	/* Allocate/initialize root's parent. */
176
-	if (*argv != NULL) {
177
-		if ((parent = fts_alloc(sp, "", 0)) == NULL)
178
-			goto mem2;
179
-		parent->fts_level = FTS_ROOTPARENTLEVEL;
180
-	  }
181
-
182
-	/* Allocate/initialize root(s). */
183
-	for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
184
-		/* Don't allow zero-length paths. */
185
-		size_t len = strlen(*argv);
186
-		if (len == 0) {
187
-			__set_errno (ENOENT);
188
-			goto mem3;
189
-		}
190
-
191
-		p = fts_alloc(sp, *argv, len);
192
-		p->fts_level = FTS_ROOTLEVEL;
193
-		p->fts_parent = parent;
194
-		p->fts_accpath = p->fts_name;
195
-		p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
196
-
197
-		/* Command-line "." and ".." are real directories. */
198
-		if (p->fts_info == FTS_DOT)
199
-			p->fts_info = FTS_D;
200
-
201
-		/*
202
-		 * If comparison routine supplied, traverse in sorted
203
-		 * order; otherwise traverse in the order specified.
204
-		 */
205
-		if (compar) {
206
-			p->fts_link = root;
207
-			root = p;
208
-		} else {
209
-			p->fts_link = NULL;
210
-			if (root == NULL)
211
-				tmp = root = p;
212
-			else {
213
-				tmp->fts_link = p;
214
-				tmp = p;
215
-			}
216
-		}
217
-	}
218
-	if (compar && nitems > 1)
219
-		root = fts_sort(sp, root, nitems);
220
-
221
-	/*
222
-	 * Allocate a dummy pointer and make fts_read think that we've just
223
-	 * finished the node before the root(s); set p->fts_info to FTS_INIT
224
-	 * so that everything about the "current" node is ignored.
225
-	 */
226
-	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
227
-		goto mem3;
228
-	sp->fts_cur->fts_link = root;
229
-	sp->fts_cur->fts_info = FTS_INIT;
230
-
231
-	/*
232
-	 * If using chdir(2), grab a file descriptor pointing to dot to ensure
233
-	 * that we can get back here; this could be avoided for some paths,
234
-	 * but almost certainly not worth the effort.  Slashes, symbolic links,
235
-	 * and ".." are all fairly nasty problems.  Note, if we can't get the
236
-	 * descriptor we run anyway, just more slowly.
237
-	 */
238
-	if (!ISSET(FTS_NOCHDIR)
239
-	    && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
240
-		SET(FTS_NOCHDIR);
241
-
242
-	return (sp);
243
-
244
-mem3:	fts_lfree(root);
245
-	free(parent);
246
-mem2:	free(sp->fts_path);
247
-mem1:	free(sp);
248
-	return (NULL);
249
-}
250
-
251
-static void
252
-internal_function
253
-fts_load (FTSOBJ *sp, FTSENTRY *p)
254
-{
255
-	int len;
256
-	char *cp;
257
-
258
-	/*
259
-	 * Load the stream structure for the next traversal.  Since we don't
260
-	 * actually enter the directory until after the preorder visit, set
261
-	 * the fts_accpath field specially so the chdir gets done to the right
262
-	 * place and the user can access the first node.  From fts_open it's
263
-	 * known that the path will fit.
264
-	 */
265
-	len = p->fts_pathlen = p->fts_namelen;
266
-	memmove(sp->fts_path, p->fts_name, len + 1);
267
-	if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
268
-		len = strlen(++cp);
269
-		memmove(p->fts_name, cp, len + 1);
270
-		p->fts_namelen = len;
271
-	}
272
-	p->fts_accpath = p->fts_path = sp->fts_path;
273
-	sp->fts_dev = p->fts_dev;
274
-}
275
-
276
-int
277
-FTS_CLOSE (FTSOBJ *sp)
278
-{
279
-	FTSENTRY *freep, *p;
280
-	int saved_errno;
281
-
282
-	/*
283
-	 * This still works if we haven't read anything -- the dummy structure
284
-	 * points to the root list, so we step through to the end of the root
285
-	 * list which has a valid parent pointer.
286
-	 */
287
-	if (sp->fts_cur) {
288
-		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
289
-			freep = p;
290
-			p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
291
-			free(freep);
292
-		}
293
-		free(p);
294
-	}
295
-
296
-	/* Free up child linked list, sort array, path buffer. */
297
-	if (sp->fts_child)
298
-		fts_lfree(sp->fts_child);
299
-	free(sp->fts_array);
300
-	free(sp->fts_path);
301
-
302
-	/* Return to original directory, save errno if necessary. */
303
-	if (!ISSET(FTS_NOCHDIR)) {
304
-		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
305
-		(void)close(sp->fts_rfd);
306
-
307
-		/* Set errno and return. */
308
-		if (saved_errno != 0) {
309
-			/* Free up the stream pointer. */
310
-			free(sp);
311
-			__set_errno (saved_errno);
312
-			return (-1);
313
-		}
314
-	}
315
-
316
-	/* Free up the stream pointer. */
317
-	free(sp);
318
-	return (0);
319
-}
320
-
321
-/*
322
- * Special case of "/" at the end of the path so that slashes aren't
323
- * appended which would cause paths to be written as "....//foo".
324
- */
325
-#define	NAPPEND(p)							\
326
-	(p->fts_path[p->fts_pathlen - 1] == '/'				\
327
-	    ? p->fts_pathlen - 1 : p->fts_pathlen)
328
-
329
-FTSENTRY *
330
-FTS_READ (FTSOBJ *sp)
331
-{
332
-	FTSENTRY *p, *tmp;
333
-	int instr;
334
-	char *t;
335
-	int saved_errno;
336
-
337
-	/* If finished or unrecoverable error, return NULL. */
338
-	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
339
-		return (NULL);
340
-
341
-	/* Set current node pointer. */
342
-	p = sp->fts_cur;
343
-
344
-	/* Save and zero out user instructions. */
345
-	instr = p->fts_instr;
346
-	p->fts_instr = FTS_NOINSTR;
347
-
348
-	/* Any type of file may be re-visited; re-stat and re-turn. */
349
-	if (instr == FTS_AGAIN) {
350
-		p->fts_info = fts_stat(sp, p, 0);
351
-		return (p);
352
-	}
353
-
354
-	/*
355
-	 * Following a symlink -- SLNONE test allows application to see
356
-	 * SLNONE and recover.  If indirecting through a symlink, have
357
-	 * keep a pointer to current location.  If unable to get that
358
-	 * pointer, follow fails.
359
-	 */
360
-	if (instr == FTS_FOLLOW &&
361
-	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
362
-		p->fts_info = fts_stat(sp, p, 1);
363
-		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
364
-			if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
365
-				p->fts_errno = errno;
366
-				p->fts_info = FTS_ERR;
367
-			} else
368
-				p->fts_flags |= FTS_SYMFOLLOW;
369
-		}
370
-		return (p);
371
-	}
372
-
373
-	/* Directory in pre-order. */
374
-	if (p->fts_info == FTS_D) {
375
-		/* If skipped or crossed mount point, do post-order visit. */
376
-		if (instr == FTS_SKIP ||
377
-		    (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
378
-			if (p->fts_flags & FTS_SYMFOLLOW)
379
-				(void)close(p->fts_symfd);
380
-			if (sp->fts_child) {
381
-				fts_lfree(sp->fts_child);
382
-				sp->fts_child = NULL;
383
-			}
384
-			p->fts_info = FTS_DP;
385
-			return (p);
386
-		}
387
-
388
-		/* Rebuild if only read the names and now traversing. */
389
-		if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
390
-			CLR(FTS_NAMEONLY);
391
-			fts_lfree(sp->fts_child);
392
-			sp->fts_child = NULL;
393
-		}
394
-
395
-		/*
396
-		 * Cd to the subdirectory.
397
-		 *
398
-		 * If have already read and now fail to chdir, whack the list
399
-		 * to make the names come out right, and set the parent errno
400
-		 * so the application will eventually get an error condition.
401
-		 * Set the FTS_DONTCHDIR flag so that when we logically change
402
-		 * directories back to the parent we don't do a chdir.
403
-		 *
404
-		 * If haven't read do so.  If the read fails, fts_build sets
405
-		 * FTS_STOP or the fts_info field of the node.
406
-		 */
407
-		if (sp->fts_child != NULL) {
408
-			if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
409
-				p->fts_errno = errno;
410
-				p->fts_flags |= FTS_DONTCHDIR;
411
-				for (p = sp->fts_child; p != NULL;
412
-				     p = p->fts_link)
413
-					p->fts_accpath =
414
-					    p->fts_parent->fts_accpath;
415
-			}
416
-		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
417
-			if (ISSET(FTS_STOP))
418
-				return (NULL);
419
-			return (p);
420
-		}
421
-		p = sp->fts_child;
422
-		sp->fts_child = NULL;
423
-		sp->fts_cur = p;
424
-		goto name;
425
-	}
426
-
427
-	/* Move to the next node on this level. */
428
-next:	tmp = p;
429
-	if ((p = p->fts_link) != NULL) {
430
-		sp->fts_cur = p;
431
-		free(tmp);
432
-
433
-		/*
434
-		 * If reached the top, return to the original directory (or
435
-		 * the root of the tree), and load the paths for the next root.
436
-		 */
437
-		if (p->fts_level == FTS_ROOTLEVEL) {
438
-			if (FCHDIR(sp, sp->fts_rfd)) {
439
-				SET(FTS_STOP);
440
-				return (NULL);
441
-			}
442
-			fts_load(sp, p);
443
-			return p;
444
-		}
445
-
446
-		/*
447
-		 * User may have called fts_set on the node.  If skipped,
448
-		 * ignore.  If followed, get a file descriptor so we can
449
-		 * get back if necessary.
450
-		 */
451
-		if (p->fts_instr == FTS_SKIP)
452
-			goto next;
453
-		if (p->fts_instr == FTS_FOLLOW) {
454
-			p->fts_info = fts_stat(sp, p, 1);
455
-			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
456
-				if ((p->fts_symfd =
457
-				    open(".", O_RDONLY, 0)) < 0) {
458
-					p->fts_errno = errno;
459
-					p->fts_info = FTS_ERR;
460
-				} else
461
-					p->fts_flags |= FTS_SYMFOLLOW;
462
-			}
463
-			p->fts_instr = FTS_NOINSTR;
464
-		}
465
-
466
-name:		t = sp->fts_path + NAPPEND(p->fts_parent);
467
-		*t++ = '/';
468
-		memmove(t, p->fts_name, p->fts_namelen + 1);
469
-		return p;
470
-	}
471
-
472
-	/* Move up to the parent node. */
473
-	p = tmp->fts_parent;
474
-	sp->fts_cur = p;
475
-	free(tmp);
476
-
477
-	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
478
-		/*
479
-		 * Done; free everything up and set errno to 0 so the user
480
-		 * can distinguish between error and EOF.
481
-		 */
482
-		free(p);
483
-		__set_errno (0);
484
-		return (sp->fts_cur = NULL);
485
-	}
486
-
487
-	/* NUL terminate the pathname. */
488
-	sp->fts_path[p->fts_pathlen] = '\0';
489
-
490
-	/*
491
-	 * Return to the parent directory.  If at a root node or came through
492
-	 * a symlink, go back through the file descriptor.  Otherwise, cd up
493
-	 * one directory.
494
-	 */
495
-	if (p->fts_level == FTS_ROOTLEVEL) {
496
-		if (FCHDIR(sp, sp->fts_rfd)) {
497
-			SET(FTS_STOP);
498
-			return (NULL);
499
-		}
500
-	} else if (p->fts_flags & FTS_SYMFOLLOW) {
501
-		if (FCHDIR(sp, p->fts_symfd)) {
502
-			saved_errno = errno;
503
-			(void)close(p->fts_symfd);
504
-			__set_errno (saved_errno);
505
-			SET(FTS_STOP);
506
-			return (NULL);
507
-		}
508
-		(void)close(p->fts_symfd);
509
-	} else if (!(p->fts_flags & FTS_DONTCHDIR) &&
510
-		   fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
511
-		SET(FTS_STOP);
512
-		return (NULL);
513
-	}
514
-	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
515
-	return p;
516
-}
517
-
518
-/*
519
- * Fts_set takes the stream as an argument although it's not used in this
520
- * implementation; it would be necessary if anyone wanted to add global
521
- * semantics to fts using fts_set.  An error return is allowed for similar
522
- * reasons.
523
- */
524
-/* ARGSUSED */
525
-int
526
-FTS_SET (FTSOBJ *sp, FTSENTRY *p, int instr)
527
-{
528
-	if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
529
-	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
530
-		__set_errno (EINVAL);
531
-		return (1);
532
-	}
533
-	p->fts_instr = instr;
534
-	return (0);
535
-}
536
-
537
-FTSENTRY *
538
-FTS_CHILDREN(FTSOBJ *sp, int instr)
539
-{
540
-	FTSENTRY *p;
541
-	int fd;
542
-
543
-	if (instr != 0 && instr != FTS_NAMEONLY) {
544
-		__set_errno (EINVAL);
545
-		return (NULL);
546
-	}
547
-
548
-	/* Set current node pointer. */
549
-	p = sp->fts_cur;
550
-
551
-	/*
552
-	 * Errno set to 0 so user can distinguish empty directory from
553
-	 * an error.
554
-	 */
555
-	__set_errno (0);
556
-
557
-	/* Fatal errors stop here. */
558
-	if (ISSET(FTS_STOP))
559
-		return (NULL);
560
-
561
-	/* Return logical hierarchy of user's arguments. */
562
-	if (p->fts_info == FTS_INIT)
563
-		return (p->fts_link);
564
-
565
-	/*
566
-	 * If not a directory being visited in pre-order, stop here.  Could
567
-	 * allow FTS_DNR, assuming the user has fixed the problem, but the
568
-	 * same effect is available with FTS_AGAIN.
569
-	 */
570
-	if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
571
-		return (NULL);
572
-
573
-	/* Free up any previous child list. */
574
-	if (sp->fts_child != NULL)
575
-		fts_lfree(sp->fts_child);
576
-
577
-	if (instr == FTS_NAMEONLY) {
578
-		SET(FTS_NAMEONLY);
579
-		instr = BNAMES;
580
-	} else
581
-		instr = BCHILD;
582
-
583
-	/*
584
-	 * If using chdir on a relative path and called BEFORE fts_read does
585
-	 * its chdir to the root of a traversal, we can lose -- we need to
586
-	 * chdir into the subdirectory, and we don't know where the current
587
-	 * directory is, so we can't get back so that the upcoming chdir by
588
-	 * fts_read will work.
589
-	 */
590
-	if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
591
-	    ISSET(FTS_NOCHDIR))
592
-		return (sp->fts_child = fts_build(sp, instr));
593
-
594
-	if ((fd = open(".", O_RDONLY, 0)) < 0)
595
-		return (NULL);
596
-	sp->fts_child = fts_build(sp, instr);
597
-	if (fchdir(fd))
598
-		return (NULL);
599
-	(void)close(fd);
600
-	return (sp->fts_child);
601
-}
602
-
603
-static inline int
604
-dirent_not_directory(const struct dirent *dp)
605
-{
606
-#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
607
-        return dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN;
608
-#else
609
-        return 0;
610
-#endif
611
-}
612
-
613
-/*
614
- * This is the tricky part -- do not casually change *anything* in here.  The
615
- * idea is to build the linked list of entries that are used by fts_children
616
- * and fts_read.  There are lots of special cases.
617
- *
618
- * The real slowdown in walking the tree is the stat calls.  If FTS_NOSTAT is
619
- * set and it's a physical walk (so that symbolic links can't be directories),
620
- * we can do things quickly.  First, if it's a 4.4BSD file system, the type
621
- * of the file is in the directory entry.  Otherwise, we assume that the number
622
- * of subdirectories in a node is equal to the number of links to the parent.
623
- * The former skips all stat calls.  The latter skips stat calls in any leaf
624
- * directories and for any files after the subdirectories in the directory have
625
- * been found, cutting the stat calls by about 2/3.
626
- */
627
-static FTSENTRY *
628
-internal_function
629
-fts_build (FTSOBJ *sp, int type)
630
-{
631
-	struct dirent *dp;
632
-	FTSENTRY *p, *head;
633
-	int nitems;
634
-	FTSENTRY *cur, *tail;
635
-	DIR *dirp;
636
-	void *oldaddr;
637
-	int cderrno, descend, len, level, nlinks, saved_errno,
638
-	    nostat, doadjust;
639
-	size_t maxlen;
640
-	char *cp;
641
-
642
-	/* Set current node pointer. */
643
-	cur = sp->fts_cur;
644
-
645
-	/*
646
-	 * Open the directory for reading.  If this fails, we're done.
647
-	 * If being called from fts_read, set the fts_info field.
648
-	 */
649
-#if defined FTS_WHITEOUT && 0
650
-	if (ISSET(FTS_WHITEOUT))
651
-		oflag = DTF_NODUP|DTF_REWIND;
652
-	else
653
-		oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND;
654
-#else
655
-# define __opendir2(path, flag) opendir(path)
656
-#endif
657
-       if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
658
-		if (type == BREAD) {
659
-			cur->fts_info = FTS_DNR;
660
-			cur->fts_errno = errno;
661
-		}
662
-		return (NULL);
663
-	}
664
-
665
-	/*
666
-	 * Nlinks is the number of possible entries of type directory in the
667
-	 * directory if we're cheating on stat calls, 0 if we're not doing
668
-	 * any stat calls at all, -1 if we're doing stats on everything.
669
-	 */
670
-	if (type == BNAMES) {
671
-		nlinks = 0;
672
-		/* Be quiet about nostat, GCC. */
673
-		nostat = 0;
674
-	} else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
675
-		nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
676
-		nostat = 1;
677
-	} else {
678
-		nlinks = -1;
679
-		nostat = 0;
680
-	}
681
-
682
-#ifdef notdef
683
-	(void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
684
-	(void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
685
-	    ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
686
-#endif
687
-	/*
688
-	 * If we're going to need to stat anything or we want to descend
689
-	 * and stay in the directory, chdir.  If this fails we keep going,
690
-	 * but set a flag so we don't chdir after the post-order visit.
691
-	 * We won't be able to stat anything, but we can still return the
692
-	 * names themselves.  Note, that since fts_read won't be able to
693
-	 * chdir into the directory, it will have to return different path
694
-	 * names than before, i.e. "a/b" instead of "b".  Since the node
695
-	 * has already been visited in pre-order, have to wait until the
696
-	 * post-order visit to return the error.  There is a special case
697
-	 * here, if there was nothing to stat then it's not an error to
698
-	 * not be able to stat.  This is all fairly nasty.  If a program
699
-	 * needed sorted entries or stat information, they had better be
700
-	 * checking FTS_NS on the returned nodes.
701
-	 */
702
-	cderrno = 0;
703
-	if (nlinks || type == BREAD) {
704
-		if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
705
-			if (nlinks && type == BREAD)
706
-				cur->fts_errno = errno;
707
-			cur->fts_flags |= FTS_DONTCHDIR;
708
-			descend = 0;
709
-			cderrno = errno;
710
-			(void)closedir(dirp);
711
-			dirp = NULL;
712
-		} else
713
-			descend = 1;
714
-	} else
715
-		descend = 0;
716
-
717
-	/*
718
-	 * Figure out the max file name length that can be stored in the
719
-	 * current path -- the inner loop allocates more path as necessary.
720
-	 * We really wouldn't have to do the maxlen calculations here, we
721
-	 * could do them in fts_read before returning the path, but it's a
722
-	 * lot easier here since the length is part of the dirent structure.
723
-	 *
724
-	 * If not changing directories set a pointer so that can just append
725
-	 * each new name into the path.
726
-	 */
727
-	len = NAPPEND(cur);
728
-	if (ISSET(FTS_NOCHDIR)) {
729
-		cp = sp->fts_path + len;
730
-		*cp++ = '/';
731
-	} else {
732
-		/* GCC, you're too verbose. */
733
-		cp = NULL;
734
-	}
735
-	len++;
736
-	maxlen = sp->fts_pathlen - len;
737
-
738
-	level = cur->fts_level + 1;
739
-
740
-	/* Read the directory, attaching each entry to the `link' pointer. */
741
-	doadjust = 0;
742
-	for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
743
-		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
744
-			continue;
745
-
746
-		if ((p = fts_alloc(sp, dp->d_name, _D_EXACT_NAMLEN (dp))) == NULL)
747
-			goto mem1;
748
-		if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
749
-			oldaddr = sp->fts_path;
750
-			if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
751
-				/*
752
-				 * No more memory for path or structures.  Save
753
-				 * errno, free up the current structure and the
754
-				 * structures already allocated.
755
-				 */
756
-mem1:				saved_errno = errno;
757
-				free(p);
758
-				fts_lfree(head);
759
-				(void)closedir(dirp);
760
-				cur->fts_info = FTS_ERR;
761
-				SET(FTS_STOP);
762
-				__set_errno (saved_errno);
763
-				return (NULL);
764
-			}
765
-			/* Did realloc() change the pointer? */
766
-			if (oldaddr != sp->fts_path) {
767
-				doadjust = 1;
768
-				if (ISSET(FTS_NOCHDIR))
769
-					cp = sp->fts_path + len;
770
-			}
771
-			maxlen = sp->fts_pathlen - len;
772
-		}
773
-
774
-		if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
775
-			/*
776
-			 * In an FTSENT, fts_pathlen is a u_short so it is
777
-			 * possible to wraparound here.  If we do, free up
778
-			 * the current structure and the structures already
779
-			 * allocated, then error out with ENAMETOOLONG.
780
-			 */
781
-			free(p);
782
-			fts_lfree(head);
783
-			(void)closedir(dirp);
784
-			cur->fts_info = FTS_ERR;
785
-			SET(FTS_STOP);
786
-			__set_errno (ENAMETOOLONG);
787
-			return (NULL);
788
-		}
789
-		p->fts_level = level;
790
-		p->fts_parent = sp->fts_cur;
791
-		p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
792
-
793
-#if defined FTS_WHITEOUT && 0
794
-		if (dp->d_type == DT_WHT)
795
-			p->fts_flags |= FTS_ISW;
796
-#endif
797
-
798
-		/* Unreachable code.  cderrno is only ever set to a nonnull
799
-		   value if dirp is closed at the same time.  But then we
800
-		   cannot enter this loop.  */
801
-		if (0 && cderrno) {
802
-			if (nlinks) {
803
-				p->fts_info = FTS_NS;
804
-				p->fts_errno = cderrno;
805
-			} else
806
-				p->fts_info = FTS_NSOK;
807
-			p->fts_accpath = cur->fts_accpath;
808
-		} else if (nlinks == 0
809
-                           || (nostat && dirent_not_directory(dp))) {
810
-			p->fts_accpath =
811
-			    ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
812
-			p->fts_info = FTS_NSOK;
813
-		} else {
814
-			/* Build a file name for fts_stat to stat. */
815
-			if (ISSET(FTS_NOCHDIR)) {
816
-				p->fts_accpath = p->fts_path;
817
-				memmove(cp, p->fts_name, p->fts_namelen + 1);
818
-			} else
819
-				p->fts_accpath = p->fts_name;
820
-			/* Stat it. */
821
-			p->fts_info = fts_stat(sp, p, 0);
822
-
823
-			/* Decrement link count if applicable. */
824
-			if (nlinks > 0 && (p->fts_info == FTS_D ||
825
-			    p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
826
-				--nlinks;
827
-		}
828
-
829
-		/* We walk in directory order so "ls -f" doesn't get upset. */
830
-		p->fts_link = NULL;
831
-		if (head == NULL)
832
-			head = tail = p;
833
-		else {
834
-			tail->fts_link = p;
835
-			tail = p;
836
-		}
837
-		++nitems;
838
-	}
839
-	if (dirp)
840
-		(void)closedir(dirp);
841
-
842
-	/*
843
-	 * If realloc() changed the address of the path, adjust the
844
-	 * addresses for the rest of the tree and the dir list.
845
-	 */
846
-	if (doadjust)
847
-		fts_padjust(sp, head);
848
-
849
-	/*
850
-	 * If not changing directories, reset the path back to original
851
-	 * state.
852
-	 */
853
-	if (ISSET(FTS_NOCHDIR)) {
854
-		if (len == sp->fts_pathlen || nitems == 0)
855
-			--cp;
856
-		*cp = '\0';
857
-	}
858
-
859
-	/*
860
-	 * If descended after called from fts_children or after called from
861
-	 * fts_read and nothing found, get back.  At the root level we use
862
-	 * the saved fd; if one of fts_open()'s arguments is a relative path
863
-	 * to an empty directory, we wind up here with no other way back.  If
864
-	 * can't get back, we're done.
865
-	 */
866
-	if (descend && (type == BCHILD || !nitems) &&
867
-	    (cur->fts_level == FTS_ROOTLEVEL ?
868
-	     FCHDIR(sp, sp->fts_rfd) :
869
-	     fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
870
-		cur->fts_info = FTS_ERR;
871
-		SET(FTS_STOP);
872
-		fts_lfree(head);
873
-		return (NULL);
874
-	}
875
-
876
-	/* If didn't find anything, return NULL. */
877
-	if (!nitems) {
878
-		if (type == BREAD)
879
-			cur->fts_info = FTS_DP;
880
-		fts_lfree(head);
881
-		return (NULL);
882
-	}
883
-
884
-	/* Sort the entries. */
885
-	if (sp->fts_compar && nitems > 1)
886
-		head = fts_sort(sp, head, nitems);
887
-	return (head);
888
-}
889
-
890
-static u_short
891
-internal_function
892
-fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow)
893
-{
894
-	FTSENTRY *t;
895
-	dev_t dev;
896
-	INO_T ino;
897
-	struct STAT *sbp, sb;
898
-	int saved_errno;
899
-
900
-	/* If user needs stat info, stat buffer already allocated. */
901
-	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
902
-
903
-#if defined FTS_WHITEOUT && 0
904
-	/* check for whiteout */
905
-	if (p->fts_flags & FTS_ISW) {
906
-		if (sbp != &sb) {
907
-			memset(sbp, '\0', sizeof (*sbp));
908
-			sbp->st_mode = S_IFWHT;
909
-		}
910
-		return (FTS_W);
911
-       }
912
-#endif
913
-
914
-	/*
915
-	 * If doing a logical walk, or application requested FTS_FOLLOW, do
916
-	 * a stat(2).  If that fails, check for a non-existent symlink.  If
917
-	 * fail, set the errno from the stat call.
918
-	 */
919
-	if (ISSET(FTS_LOGICAL) || follow) {
920
-		if (STAT(p->fts_accpath, sbp)) {
921
-			saved_errno = errno;
922
-			if (!LSTAT(p->fts_accpath, sbp)) {
923
-				__set_errno (0);
924
-				return (FTS_SLNONE);
925
-			}
926
-			p->fts_errno = saved_errno;
927
-			goto err;
928
-		}
929
-	} else if (LSTAT(p->fts_accpath, sbp)) {
930
-		p->fts_errno = errno;
931
-err:		memset(sbp, 0, sizeof(struct STAT));
932
-		return (FTS_NS);
933
-	}
934
-
935
-	if (S_ISDIR(sbp->st_mode)) {
936
-		/*
937
-		 * Set the device/inode.  Used to find cycles and check for
938
-		 * crossing mount points.  Also remember the link count, used
939
-		 * in fts_build to limit the number of stat calls.  It is
940
-		 * understood that these fields are only referenced if fts_info
941
-		 * is set to FTS_D.
942
-		 */
943
-		dev = p->fts_dev = sbp->st_dev;
944
-		ino = p->fts_ino = sbp->st_ino;
945
-		p->fts_nlink = sbp->st_nlink;
946
-
947
-		if (ISDOT(p->fts_name))
948
-			return (FTS_DOT);
949
-
950
-		/*
951
-		 * Cycle detection is done by brute force when the directory
952
-		 * is first encountered.  If the tree gets deep enough or the
953
-		 * number of symbolic links to directories is high enough,
954
-		 * something faster might be worthwhile.
955
-		 */
956
-		for (t = p->fts_parent;
957
-		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
958
-			if (ino == t->fts_ino && dev == t->fts_dev) {
959
-				p->fts_cycle = t;
960
-				return (FTS_DC);
961
-			}
962
-		return (FTS_D);
963
-	}
964
-	if (S_ISLNK(sbp->st_mode))
965
-		return (FTS_SL);
966
-	if (S_ISREG(sbp->st_mode))
967
-		return (FTS_F);
968
-	return (FTS_DEFAULT);
969
-}
970
-
971
-static FTSENTRY *
972
-internal_function
973
-fts_sort (FTSOBJ *sp, FTSENTRY *head, int nitems)
974
-{
975
-	FTSENTRY **ap, *p;
976
-
977
-	/*
978
-	 * Construct an array of pointers to the structures and call qsort(3).
979
-	 * Reassemble the array in the order returned by qsort.  If unable to
980
-	 * sort for memory reasons, return the directory entries in their
981
-	 * current order.  Allocate enough space for the current needs plus
982
-	 * 40 so don't realloc one entry at a time.
983
-	 */
984
-	if (nitems > sp->fts_nitems) {
985
-		FTSENTRY **a;
986
-
987
-		sp->fts_nitems = nitems + 40;
988
-		if ((a = realloc(sp->fts_array,
989
-		    (size_t)(sp->fts_nitems * sizeof(FTSENTRY *)))) == NULL) {
990
-			free(sp->fts_array);
991
-			sp->fts_array = NULL;
992
-			sp->fts_nitems = 0;
993
-			return (head);
994
-		}
995
-		sp->fts_array = a;
996
-	}
997
-	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
998
-		*ap++ = p;
999
-	qsort((void *)sp->fts_array, nitems, sizeof(FTSENTRY *), sp->fts_compar);
1000
-	for (head = *(ap = sp->fts_array); --nitems; ++ap)
1001
-		ap[0]->fts_link = ap[1];
1002
-	ap[0]->fts_link = NULL;
1003
-	return (head);
1004
-}
1005
-
1006
-static FTSENTRY *
1007
-internal_function
1008
-fts_alloc (FTSOBJ *sp, const char *name, size_t namelen)
1009
-{
1010
-	FTSENTRY *p;
1011
-	size_t len;
1012
-
1013
-	/*
1014
-	 * The file name is a variable length array and no stat structure is
1015
-	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
1016
-	 * structure, the file name and the stat structure in one chunk, but
1017
-	 * be careful that the stat structure is reasonably aligned.  Since the
1018
-	 * fts_name field is declared to be of size 1, the fts_name pointer is
1019
-	 * namelen + 2 before the first possible address of the stat structure.
1020
-	 */
1021
-	len = sizeof(FTSENTRY) + namelen;
1022
-	if (!ISSET(FTS_NOSTAT))
1023
-		len += sizeof(struct STAT) + ALIGNBYTES;
1024
-	if ((p = malloc(len)) == NULL)
1025
-		return (NULL);
1026
-
1027
-	/* Copy the name and guarantee NUL termination. */
1028
-	memmove(p->fts_name, name, namelen);
1029
-	p->fts_name[namelen] = '\0';
1030
-
1031
-	if (!ISSET(FTS_NOSTAT))
1032
-		p->fts_statp = (struct STAT *)ALIGN(p->fts_name + namelen + 2);
1033
-	p->fts_namelen = namelen;
1034
-	p->fts_path = sp->fts_path;
1035
-	p->fts_errno = 0;
1036
-	p->fts_flags = 0;
1037
-	p->fts_instr = FTS_NOINSTR;
1038
-	p->fts_number = 0;
1039
-	p->fts_pointer = NULL;
1040
-	return (p);
1041
-}
1042
-
1043
-static void
1044
-internal_function
1045
-fts_lfree (FTSENTRY *head)
1046
-{
1047
-	FTSENTRY *p;
1048
-
1049
-	/* Free a linked list of structures. */
1050
-	while ((p = head)) {
1051
-		head = head->fts_link;
1052
-		free(p);
1053
-	}
1054
-}
1055
-
1056
-/*
1057
- * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
1058
- * Most systems will allow creation of paths much longer than MAXPATHLEN, even
1059
- * though the kernel won't resolve them.  Add the size (not just what's needed)
1060
- * plus 256 bytes so don't realloc the path 2 bytes at a time.
1061
- */
1062
-static int
1063
-internal_function
1064
-fts_palloc (FTSOBJ *sp, size_t more)
1065
-{
1066
-	char *p;
1067
-
1068
-	sp->fts_pathlen += more + 256;
1069
-	/*
1070
-	 * Check for possible wraparound.  In an FTS, fts_pathlen is
1071
-	 * a signed int but in an FTSENT it is an unsigned short.
1072
-	 * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
1073
-	 */
1074
-	if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
1075
-		free(sp->fts_path);
1076
-		sp->fts_path = NULL;
1077
-		__set_errno (ENAMETOOLONG);
1078
-		return (1);
1079
-	}
1080
-	p = realloc(sp->fts_path, sp->fts_pathlen);
1081
-	if (p == NULL) {
1082
-		free(sp->fts_path);
1083
-		sp->fts_path = NULL;
1084
-		return 1;
1085
-	}
1086
-	sp->fts_path = p;
1087
-	return 0;
1088
-}
1089
-
1090
-/*
1091
- * When the path is realloc'd, have to fix all of the pointers in structures
1092
- * already returned.
1093
- */
1094
-static void
1095
-internal_function
1096
-fts_padjust (FTSOBJ *sp, FTSENTRY *head)
1097
-{
1098
-	FTSENTRY *p;
1099
-	char *addr = sp->fts_path;
1100
-
1101
-#define	ADJUST(p) do {							\
1102
-	if ((p)->fts_accpath != (p)->fts_name) {			\
1103
-		(p)->fts_accpath =					\
1104
-		    (char *)addr + ((p)->fts_accpath - (p)->fts_path);	\
1105
-	}								\
1106
-	(p)->fts_path = addr;						\
1107
-} while (0)
1108
-	/* Adjust the current set of children. */
1109
-	for (p = sp->fts_child; p; p = p->fts_link)
1110
-		ADJUST(p);
1111
-
1112
-	/* Adjust the rest of the tree, including the current level. */
1113
-	for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
1114
-		ADJUST(p);
1115
-		p = p->fts_link ? p->fts_link : p->fts_parent;
1116
-	}
1117
-}
1118
-
1119
-static size_t
1120
-internal_function
1121
-fts_maxarglen (char * const *argv)
1122
-{
1123
-	size_t len, max;
1124
-
1125
-	for (max = 0; *argv; ++argv)
1126
-		if ((len = strlen(*argv)) > max)
1127
-			max = len;
1128
-	return (max + 1);
1129
-}
1130
-
1131
-/*
1132
- * Change to dir specified by fd or p->fts_accpath without getting
1133
- * tricked by someone changing the world out from underneath us.
1134
- * Assumes p->fts_dev and p->fts_ino are filled in.
1135
- */
1136
-static int
1137
-internal_function
1138
-fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, int fd, const char *path)
1139
-{
1140
-	int ret, oerrno, newfd;
1141
-	struct stat sb;
1142
-
1143
-	newfd = fd;
1144
-	if (ISSET(FTS_NOCHDIR))
1145
-		return (0);
1146
-	if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
1147
-		return (-1);
1148
-	if (fstat(newfd, &sb)) {
1149
-		ret = -1;
1150
-		goto bail;
1151
-	}
1152
-	if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
1153
-		__set_errno (ENOENT);		/* disinformation */
1154
-		ret = -1;
1155
-		goto bail;
1156
-	}
1157
-	ret = fchdir(newfd);
1158
-bail:
1159
-	oerrno = errno;
1160
-	if (fd < 0)
1161
-		(void)close(newfd);
1162
-	__set_errno (oerrno);
1163
-	return (ret);
1164
-}
1165
-#endif
1166 1
deleted file mode 100644
... ...
@@ -1,221 +0,0 @@
1
-#include "clamav-config.h"
2
-
3
-#if HAVE_SYSTEM_LFS_FTS
4
-#include <fts.h>
5
-
6
-static inline FTSENT *_priv_fts_children(FTS *ftsp, int options)
7
-{
8
-	return fts_children(ftsp, options);
9
-}
10
-
11
-static inline int _priv_fts_close(FTS *ftsp)
12
-{
13
-	return fts_close(ftsp);
14
-}
15
-
16
-static inline FTS *_priv_fts_open (char * const *path_argv, int options,
17
-		   int (*compar)(const FTSENT **, const FTSENT **))
18
-{
19
-	return fts_open(path_argv, options, compar);
20
-}
21
-
22
-static inline FTSENT *_priv_fts_read (FTS *ftsp)
23
-{
24
-	return fts_read(ftsp);
25
-}
26
-
27
-static inline int _priv_fts_set (FTS *ftsp, FTSENT *f, int options)
28
-{
29
-	return fts_set(ftsp, f, options);
30
-}
31
-
32
-#else
33
-/* File tree traversal functions declarations.
34
-   Copyright (C) 1994-2015 Free Software Foundation, Inc.
35
-   This file is part of the GNU C Library.
36
-
37
-   The GNU C Library is free software; you can redistribute it and/or
38
-   modify it under the terms of the GNU Lesser General Public
39
-   License as published by the Free Software Foundation; either
40
-   version 2.1 of the License, or (at your option) any later version.
41
-
42
-   The GNU C Library is distributed in the hope that it will be useful,
43
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
44
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
45
-   Lesser General Public License for more details.
46
-
47
-   You should have received a copy of the GNU Lesser General Public
48
-   License along with the GNU C Library; if not, see
49
-   <http://www.gnu.org/licenses/>.  */
50
-
51
-/*
52
- * Copyright (c) 1989, 1993
53
- *	The Regents of the University of California.  All rights reserved.
54
- *
55
- * Redistribution and use in source and binary forms, with or without
56
- * modification, are permitted provided that the following conditions
57
- * are met:
58
- * 1. Redistributions of source code must retain the above copyright
59
- *    notice, this list of conditions and the following disclaimer.
60
- * 2. Redistributions in binary form must reproduce the above copyright
61
- *    notice, this list of conditions and the following disclaimer in the
62
- *    documentation and/or other materials provided with the distribution.
63
- * 4. Neither the name of the University nor the names of its contributors
64
- *    may be used to endorse or promote products derived from this software
65
- *    without specific prior written permission.
66
- *
67
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
68
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
69
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
70
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
71
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
72
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
73
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
74
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
75
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
76
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
77
- * SUCH DAMAGE.
78
- *
79
- *	@(#)fts.h	8.3 (Berkeley) 8/14/94
80
- */
81
-
82
-#ifndef	_FTS_H
83
-#define	_FTS_H 1
84
-
85
-#include <sys/types.h>
86
-
87
-
88
-typedef struct {
89
-	struct _ftsent *fts_cur;	/* current node */
90
-	struct _ftsent *fts_child;	/* linked list of children */
91
-	struct _ftsent **fts_array;	/* sort array */
92
-	dev_t fts_dev;			/* starting device # */
93
-	char *fts_path;			/* path for this descent */
94
-	int fts_rfd;			/* fd for root */
95
-	int fts_pathlen;		/* sizeof(path) */
96
-	int fts_nitems;			/* elements in the sort array */
97
-	int (*fts_compar) (const void *, const void *); /* compare fn */
98
-
99
-#define	FTS_COMFOLLOW	0x0001		/* follow command line symlinks */
100
-#define	FTS_LOGICAL	0x0002		/* logical walk */
101
-#define	FTS_NOCHDIR	0x0004		/* don't change directories */
102
-#define	FTS_NOSTAT	0x0008		/* don't get stat info */
103
-#define	FTS_PHYSICAL	0x0010		/* physical walk */
104
-#define	FTS_SEEDOT	0x0020		/* return dot and dot-dot */
105
-#define	FTS_XDEV	0x0040		/* don't cross devices */
106
-#define FTS_WHITEOUT	0x0080		/* return whiteout information */
107
-#define	FTS_OPTIONMASK	0x00ff		/* valid user option mask */
108
-
109
-#define	FTS_NAMEONLY	0x0100		/* (private) child names only */
110
-#define	FTS_STOP	0x0200		/* (private) unrecoverable error */
111
-	int fts_options;		/* fts_open options, global flags */
112
-} FTS;
113
-
114
-#ifdef __USE_LARGEFILE64
115
-typedef struct {
116
-	struct _ftsent64 *fts_cur;	/* current node */
117
-	struct _ftsent64 *fts_child;	/* linked list of children */
118
-	struct _ftsent64 **fts_array;	/* sort array */
119
-	dev_t fts_dev;			/* starting device # */
120
-	char *fts_path;			/* path for this descent */
121
-	int fts_rfd;			/* fd for root */
122
-	int fts_pathlen;		/* sizeof(path) */
123
-	int fts_nitems;			/* elements in the sort array */
124
-	int (*fts_compar) (const void *, const void *); /* compare fn */
125
-	int fts_options;		/* fts_open options, global flags */
126
-} FTS64;
127
-#endif
128
-
129
-typedef struct _ftsent {
130
-	struct _ftsent *fts_cycle;	/* cycle node */
131
-	struct _ftsent *fts_parent;	/* parent directory */
132
-	struct _ftsent *fts_link;	/* next file in directory */
133
-	long fts_number;	        /* local numeric value */
134
-	void *fts_pointer;	        /* local address value */
135
-	char *fts_accpath;		/* access path */
136
-	char *fts_path;			/* root path */
137
-	int fts_errno;			/* errno for this node */
138
-	int fts_symfd;			/* fd for symlink */
139
-	u_short fts_pathlen;		/* strlen(fts_path) */
140
-	u_short fts_namelen;		/* strlen(fts_name) */
141
-
142
-	ino_t fts_ino;			/* inode */
143
-	dev_t fts_dev;			/* device */
144
-	nlink_t fts_nlink;		/* link count */
145
-
146
-#define	FTS_ROOTPARENTLEVEL	-1
147
-#define	FTS_ROOTLEVEL		 0
148
-	short fts_level;		/* depth (-1 to N) */
149
-
150
-#define	FTS_D		 1		/* preorder directory */
151
-#define	FTS_DC		 2		/* directory that causes cycles */
152
-#define	FTS_DEFAULT	 3		/* none of the above */
153
-#define	FTS_DNR		 4		/* unreadable directory */
154
-#define	FTS_DOT		 5		/* dot or dot-dot */
155
-#define	FTS_DP		 6		/* postorder directory */
156
-#define	FTS_ERR		 7		/* error; errno is set */
157
-#define	FTS_F		 8		/* regular file */
158
-#define	FTS_INIT	 9		/* initialized only */
159
-#define	FTS_NS		10		/* stat(2) failed */
160
-#define	FTS_NSOK	11		/* no stat(2) requested */
161
-#define	FTS_SL		12		/* symbolic link */
162
-#define	FTS_SLNONE	13		/* symbolic link without target */
163
-#define FTS_W		14		/* whiteout object */
164
-	u_short fts_info;		/* user flags for FTSENT structure */
165
-
166
-#define	FTS_DONTCHDIR	 0x01		/* don't chdir .. to the parent */
167
-#define	FTS_SYMFOLLOW	 0x02		/* followed a symlink to get here */
168
-	u_short fts_flags;		/* private flags for FTSENT structure */
169
-
170
-#define	FTS_AGAIN	 1		/* read node again */
171
-#define	FTS_FOLLOW	 2		/* follow symbolic link */
172
-#define	FTS_NOINSTR	 3		/* no instructions */
173
-#define	FTS_SKIP	 4		/* discard node */
174
-	u_short fts_instr;		/* fts_set() instructions */
175
-
176
-	struct stat *fts_statp;		/* stat(2) information */
177
-	char fts_name[1];		/* file name */
178
-} FTSENT;
179
-
180
-#ifdef __USE_LARGEFILE64
181
-typedef struct _ftsent64 {
182
-	struct _ftsent64 *fts_cycle;	/* cycle node */
183
-	struct _ftsent64 *fts_parent;	/* parent directory */
184
-	struct _ftsent64 *fts_link;	/* next file in directory */
185
-	long fts_number;	        /* local numeric value */
186
-	void *fts_pointer;	        /* local address value */
187
-	char *fts_accpath;		/* access path */
188
-	char *fts_path;			/* root path */
189
-	int fts_errno;			/* errno for this node */
190
-	int fts_symfd;			/* fd for symlink */
191
-	u_short fts_pathlen;		/* strlen(fts_path) */
192
-	u_short fts_namelen;		/* strlen(fts_name) */
193
-
194
-	ino64_t fts_ino;		/* inode */
195
-	dev_t fts_dev;			/* device */
196
-	nlink_t fts_nlink;		/* link count */
197
-
198
-	short fts_level;		/* depth (-1 to N) */
199
-
200
-	u_short fts_info;		/* user flags for FTSENT structure */
201
-
202
-	u_short fts_flags;		/* private flags for FTSENT structure */
203
-
204
-	u_short fts_instr;		/* fts_set() instructions */
205
-
206
-	struct stat64 *fts_statp;	/* stat(2) information */
207
-	char fts_name[1];		/* file name */
208
-} FTSENT64;
209
-#endif
210
-
211
-__BEGIN_DECLS
212
-FTSENT	*_priv_fts_children (FTS *, int);
213
-int	 _priv_fts_close (FTS *);
214
-FTS	*_priv_fts_open (char * const *, int,
215
-		   int (*)(const FTSENT **, const FTSENT **));
216
-FTSENT	*_priv_fts_read (FTS *);
217
-int	 _priv_fts_set (FTS *, FTSENT *, int) __THROW;
218
-__END_DECLS
219
-
220
-#endif /* fts.h */
221
-#endif
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -34,17 +34,7 @@
34 34
 #  MA 02110-1301, USA.
35 35
 
36 36
 VPATH = @srcdir@
37
-am__is_gnu_make = { \
38
-  if test -z '$(MAKELEVEL)'; then \
39
-    false; \
40
-  elif test -n '$(MAKE_HOST)'; then \
41
-    true; \
42
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
43
-    true; \
44
-  else \
45
-    false; \
46
-  fi; \
47
-}
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
48 38
 am__make_running_with_option = \
49 39
   case $${target_option-} in \
50 40
       ?) ;; \
... ...
@@ -110,6 +100,8 @@ host_triplet = @host@
110 110
 target_triplet = @target@
111 111
 @BUILD_CLAMD_TRUE@bin_PROGRAMS = clamdscan$(EXEEXT)
112 112
 subdir = clamdscan
113
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
114
+	$(top_srcdir)/config/depcomp
113 115
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
114 116
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
115 117
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -188,7 +180,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
188 188
 	$(top_srcdir)/configure.ac
189 189
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
190 190
 	$(ACLOCAL_M4)
191
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
192 191
 mkinstalldirs = $(install_sh) -d
193 192
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
194 193
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -275,7 +266,6 @@ am__define_uniq_tagged_files = \
275 275
   done | $(am__uniquify_input)`
276 276
 ETAGS = etags
277 277
 CTAGS = ctags
278
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
279 278
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
280 279
 ACLOCAL = @ACLOCAL@
281 280
 AMTAR = @AMTAR@
... ...
@@ -511,7 +501,6 @@ pdfdir = @pdfdir@
511 511
 prefix = @prefix@
512 512
 program_transform_name = @program_transform_name@
513 513
 psdir = @psdir@
514
-runstatedir = @runstatedir@
515 514
 sbindir = @sbindir@
516 515
 sharedstatedir = @sharedstatedir@
517 516
 srcdir = @srcdir@
... ...
@@ -566,6 +555,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
566 566
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamdscan/Makefile'; \
567 567
 	$(am__cd) $(top_srcdir) && \
568 568
 	  $(AUTOMAKE) --foreign clamdscan/Makefile
569
+.PRECIOUS: Makefile
569 570
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
570 571
 	@case '$?' in \
571 572
 	  *config.status*) \
... ...
@@ -987,8 +977,6 @@ uninstall-am: uninstall-binPROGRAMS
987 987
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
988 988
 	uninstall-am uninstall-binPROGRAMS
989 989
 
990
-.PRECIOUS: Makefile
991
-
992 990
 
993 991
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
994 992
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -15,17 +15,7 @@
15 15
 @SET_MAKE@
16 16
 
17 17
 VPATH = @srcdir@
18
-am__is_gnu_make = { \
19
-  if test -z '$(MAKELEVEL)'; then \
20
-    false; \
21
-  elif test -n '$(MAKE_HOST)'; then \
22
-    true; \
23
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
24
-    true; \
25
-  else \
26
-    false; \
27
-  fi; \
28
-}
18
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
29 19
 am__make_running_with_option = \
30 20
   case $${target_option-} in \
31 21
       ?) ;; \
... ...
@@ -91,6 +81,8 @@ host_triplet = @host@
91 91
 target_triplet = @target@
92 92
 @HAVE_CURSES_TRUE@bin_PROGRAMS = clamdtop$(EXEEXT)
93 93
 subdir = clamdtop
94
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
95
+	$(top_srcdir)/config/depcomp
94 96
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
95 97
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
96 98
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -169,7 +161,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
169 169
 	$(top_srcdir)/configure.ac
170 170
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
171 171
 	$(ACLOCAL_M4)
172
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
173 172
 mkinstalldirs = $(install_sh) -d
174 173
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
175 174
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -280,7 +271,6 @@ am__define_uniq_tagged_files = \
280 280
   done | $(am__uniquify_input)`
281 281
 ETAGS = etags
282 282
 CTAGS = ctags
283
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
284 283
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
285 284
 ACLOCAL = @ACLOCAL@
286 285
 AMTAR = @AMTAR@
... ...
@@ -516,7 +506,6 @@ pdfdir = @pdfdir@
516 516
 prefix = @prefix@
517 517
 program_transform_name = @program_transform_name@
518 518
 psdir = @psdir@
519
-runstatedir = @runstatedir@
520 519
 sbindir = @sbindir@
521 520
 sharedstatedir = @sharedstatedir@
522 521
 srcdir = @srcdir@
... ...
@@ -562,6 +551,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
562 562
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamdtop/Makefile'; \
563 563
 	$(am__cd) $(top_srcdir) && \
564 564
 	  $(AUTOMAKE) --foreign clamdtop/Makefile
565
+.PRECIOUS: Makefile
565 566
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
566 567
 	@case '$?' in \
567 568
 	  *config.status*) \
... ...
@@ -981,8 +971,6 @@ uninstall-man: uninstall-man1
981 981
 	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
982 982
 	uninstall-man uninstall-man1
983 983
 
984
-.PRECIOUS: Makefile
985
-
986 984
 
987 985
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
988 986
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -38,6 +38,7 @@ clamonacc_SOURCES = \
38 38
     $(top_srcdir)/shared/actions.h \
39 39
     $(top_srcdir)/shared/clamdcom.c \
40 40
     $(top_srcdir)/shared/clamdcom.h \
41
+    $(top_srcdir)/shared/priv-fts.h \
41 42
     clamonacc.c \
42 43
     ./client/onaccess_client.c \
43 44
     ./client/onaccess_client.h \
... ...
@@ -51,12 +52,16 @@ clamonacc_SOURCES = \
51 51
     ./inotif/onaccess_hash.h \
52 52
     ./misc/onaccess_others.c \
53 53
     ./misc/onaccess_others.h \
54
+    ./misc/priv_fts.h \
54 55
     ./scan/onaccess_scth.c \
55 56
     ./scan/onaccess_scth.h
56 57
 
57
-AM_CFLAGS=@WERR_CFLAGS@
58
+if !SYSTEM_LFS_FTS
59
+clamonacc_SOURCES += ./misc/fts.c
58 60
 endif
59 61
 
62
+AM_CFLAGS=@WERR_CFLAGS@
63
+endif
60 64
 
61 65
 DEFS = @DEFS@ -DCL_NOLIBCLAMAV
62 66
 LIBS = $(top_builddir)/libclamav/libclamav_internal_utils.la  @CLAMONACC_LIBS@ @THREAD_LIBS@
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -110,7 +100,10 @@ build_triplet = @build@
110 110
 host_triplet = @host@
111 111
 target_triplet = @target@
112 112
 @BUILD_CLAMD_TRUE@bin_PROGRAMS = clamonacc$(EXEEXT)
113
+@BUILD_CLAMD_TRUE@@SYSTEM_LFS_FTS_FALSE@am__append_1 = ./misc/fts.c
113 114
 subdir = clamonacc
115
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
116
+	$(top_srcdir)/config/depcomp
114 117
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115 118
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
116 119
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -190,7 +183,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
190 190
 	$(top_srcdir)/configure.ac
191 191
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
192 192
 	$(ACLOCAL_M4)
193
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
194 193
 mkinstalldirs = $(install_sh) -d
195 194
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
196 195
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -204,14 +196,17 @@ am__clamonacc_SOURCES_DIST = $(top_srcdir)/shared/output.c \
204 204
 	$(top_srcdir)/shared/misc.h $(top_srcdir)/shared/getopt.c \
205 205
 	$(top_srcdir)/shared/getopt.h $(top_srcdir)/shared/actions.c \
206 206
 	$(top_srcdir)/shared/actions.h $(top_srcdir)/shared/clamdcom.c \
207
-	$(top_srcdir)/shared/clamdcom.h clamonacc.c \
207
+	$(top_srcdir)/shared/clamdcom.h \
208
+	$(top_srcdir)/shared/priv-fts.h clamonacc.c \
208 209
 	./client/onaccess_client.c ./client/onaccess_client.h \
209 210
 	./client/onaccess_proto.c ./client/onaccess_proto.h \
210 211
 	./inotif/onaccess_ddd.c ./inotif/onaccess_ddd.h \
211 212
 	./fanotif/onaccess_fan.c ./fanotif/onaccess_fan.h \
212 213
 	./inotif/onaccess_hash.c ./inotif/onaccess_hash.h \
213 214
 	./misc/onaccess_others.c ./misc/onaccess_others.h \
214
-	./scan/onaccess_scth.c ./scan/onaccess_scth.h
215
+	./misc/priv_fts.h ./scan/onaccess_scth.c \
216
+	./scan/onaccess_scth.h ./misc/fts.c
217
+@BUILD_CLAMD_TRUE@@SYSTEM_LFS_FTS_FALSE@am__objects_1 = clamonacc-fts.$(OBJEXT)
215 218
 @BUILD_CLAMD_TRUE@am_clamonacc_OBJECTS = clamonacc-output.$(OBJEXT) \
216 219
 @BUILD_CLAMD_TRUE@	clamonacc-optparser.$(OBJEXT) \
217 220
 @BUILD_CLAMD_TRUE@	clamonacc-misc.$(OBJEXT) \
... ...
@@ -225,7 +220,8 @@ am__clamonacc_SOURCES_DIST = $(top_srcdir)/shared/output.c \
225 225
 @BUILD_CLAMD_TRUE@	clamonacc-onaccess_fan.$(OBJEXT) \
226 226
 @BUILD_CLAMD_TRUE@	clamonacc-onaccess_hash.$(OBJEXT) \
227 227
 @BUILD_CLAMD_TRUE@	clamonacc-onaccess_others.$(OBJEXT) \
228
-@BUILD_CLAMD_TRUE@	clamonacc-onaccess_scth.$(OBJEXT)
228
+@BUILD_CLAMD_TRUE@	clamonacc-onaccess_scth.$(OBJEXT) \
229
+@BUILD_CLAMD_TRUE@	$(am__objects_1)
229 230
 clamonacc_OBJECTS = $(am_clamonacc_OBJECTS)
230 231
 clamonacc_LDADD = $(LDADD)
231 232
 AM_V_lt = $(am__v_lt_@AM_V@)
... ...
@@ -295,7 +291,6 @@ am__define_uniq_tagged_files = \
295 295
   done | $(am__uniquify_input)`
296 296
 ETAGS = etags
297 297
 CTAGS = ctags
298
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
299 298
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
300 299
 ACLOCAL = @ACLOCAL@
301 300
 AMTAR = @AMTAR@
... ...
@@ -523,7 +518,6 @@ pdfdir = @pdfdir@
523 523
 prefix = @prefix@
524 524
 program_transform_name = @program_transform_name@
525 525
 psdir = @psdir@
526
-runstatedir = @runstatedir@
527 526
 sbindir = @sbindir@
528 527
 sharedstatedir = @sharedstatedir@
529 528
 srcdir = @srcdir@
... ...
@@ -541,35 +535,33 @@ top_builddir = @top_builddir@
541 541
 top_srcdir = @top_srcdir@
542 542
 @BUILD_CLAMD_TRUE@clamonacc_CPPFLAGS = "-g"
543 543
 @BUILD_CLAMD_TRUE@clamonacc_CFLAGS = "-g"
544
-@BUILD_CLAMD_TRUE@clamonacc_SOURCES = \
545
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/output.c \
546
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/output.h \
547
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/optparser.c \
548
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/optparser.h \
549
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.c \
550
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/misc.h \
551
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/getopt.c \
552
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/getopt.h \
553
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/actions.c \
554
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/actions.h \
555
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/clamdcom.c \
556
-@BUILD_CLAMD_TRUE@    $(top_srcdir)/shared/clamdcom.h \
557
-@BUILD_CLAMD_TRUE@    clamonacc.c \
558
-@BUILD_CLAMD_TRUE@    ./client/onaccess_client.c \
559
-@BUILD_CLAMD_TRUE@    ./client/onaccess_client.h \
560
-@BUILD_CLAMD_TRUE@    ./client/onaccess_proto.c \
561
-@BUILD_CLAMD_TRUE@    ./client/onaccess_proto.h \
562
-@BUILD_CLAMD_TRUE@    ./inotif/onaccess_ddd.c \
563
-@BUILD_CLAMD_TRUE@    ./inotif/onaccess_ddd.h \
564
-@BUILD_CLAMD_TRUE@    ./fanotif/onaccess_fan.c \
565
-@BUILD_CLAMD_TRUE@    ./fanotif/onaccess_fan.h \
566
-@BUILD_CLAMD_TRUE@    ./inotif/onaccess_hash.c \
567
-@BUILD_CLAMD_TRUE@    ./inotif/onaccess_hash.h \
568
-@BUILD_CLAMD_TRUE@    ./misc/onaccess_others.c \
569
-@BUILD_CLAMD_TRUE@    ./misc/onaccess_others.h \
570
-@BUILD_CLAMD_TRUE@    ./scan/onaccess_scth.c \
571
-@BUILD_CLAMD_TRUE@    ./scan/onaccess_scth.h
572
-
544
+@BUILD_CLAMD_TRUE@clamonacc_SOURCES = $(top_srcdir)/shared/output.c \
545
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/output.h \
546
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/optparser.c \
547
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/optparser.h \
548
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/misc.c \
549
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/misc.h \
550
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/getopt.c \
551
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/getopt.h \
552
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/actions.c \
553
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/actions.h \
554
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/clamdcom.c \
555
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/clamdcom.h \
556
+@BUILD_CLAMD_TRUE@	$(top_srcdir)/shared/priv-fts.h clamonacc.c \
557
+@BUILD_CLAMD_TRUE@	./client/onaccess_client.c \
558
+@BUILD_CLAMD_TRUE@	./client/onaccess_client.h \
559
+@BUILD_CLAMD_TRUE@	./client/onaccess_proto.c \
560
+@BUILD_CLAMD_TRUE@	./client/onaccess_proto.h \
561
+@BUILD_CLAMD_TRUE@	./inotif/onaccess_ddd.c \
562
+@BUILD_CLAMD_TRUE@	./inotif/onaccess_ddd.h \
563
+@BUILD_CLAMD_TRUE@	./fanotif/onaccess_fan.c \
564
+@BUILD_CLAMD_TRUE@	./fanotif/onaccess_fan.h \
565
+@BUILD_CLAMD_TRUE@	./inotif/onaccess_hash.c \
566
+@BUILD_CLAMD_TRUE@	./inotif/onaccess_hash.h \
567
+@BUILD_CLAMD_TRUE@	./misc/onaccess_others.c \
568
+@BUILD_CLAMD_TRUE@	./misc/onaccess_others.h ./misc/priv_fts.h \
569
+@BUILD_CLAMD_TRUE@	./scan/onaccess_scth.c \
570
+@BUILD_CLAMD_TRUE@	./scan/onaccess_scth.h $(am__append_1)
573 571
 @BUILD_CLAMD_TRUE@AM_CFLAGS = @WERR_CFLAGS@
574 572
 AM_CPPFLAGS = -I$(top_srcdir) -I$(top_srcdir)/clamd -I$(top_srcdir)/shared -I$(top_srcdir)/libclamav @SSL_CPPFLAGS@ @CLAMONACC_CPPFLAGS@ @JSON_CPPFLAGS@ @PCRE_CPPFLAGS@
575 573
 AM_INSTALLCHECK_STD_OPTIONS_EXEMPT = clamonacc$(EXEEXT)
... ...
@@ -590,6 +582,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
590 590
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamonacc/Makefile'; \
591 591
 	$(am__cd) $(top_srcdir) && \
592 592
 	  $(AUTOMAKE) --foreign clamonacc/Makefile
593
+.PRECIOUS: Makefile
593 594
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
594 595
 	@case '$?' in \
595 596
 	  *config.status*) \
... ...
@@ -686,6 +679,7 @@ distclean-compile:
686 686
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-actions.Po@am__quote@
687 687
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-clamdcom.Po@am__quote@
688 688
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-clamonacc.Po@am__quote@
689
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-fts.Po@am__quote@
689 690
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-getopt.Po@am__quote@
690 691
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-misc.Po@am__quote@
691 692
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/clamonacc-onaccess_client.Po@am__quote@
... ...
@@ -915,6 +909,20 @@ clamonacc-onaccess_scth.obj: ./scan/onaccess_scth.c
915 915
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
916 916
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(clamonacc_CPPFLAGS) $(CPPFLAGS) $(clamonacc_CFLAGS) $(CFLAGS) -c -o clamonacc-onaccess_scth.obj `if test -f './scan/onaccess_scth.c'; then $(CYGPATH_W) './scan/onaccess_scth.c'; else $(CYGPATH_W) '$(srcdir)/./scan/onaccess_scth.c'; fi`
917 917
 
918
+clamonacc-fts.o: ./misc/fts.c
919
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(clamonacc_CPPFLAGS) $(CPPFLAGS) $(clamonacc_CFLAGS) $(CFLAGS) -MT clamonacc-fts.o -MD -MP -MF $(DEPDIR)/clamonacc-fts.Tpo -c -o clamonacc-fts.o `test -f './misc/fts.c' || echo '$(srcdir)/'`./misc/fts.c
920
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/clamonacc-fts.Tpo $(DEPDIR)/clamonacc-fts.Po
921
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='./misc/fts.c' object='clamonacc-fts.o' libtool=no @AMDEPBACKSLASH@
922
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
923
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(clamonacc_CPPFLAGS) $(CPPFLAGS) $(clamonacc_CFLAGS) $(CFLAGS) -c -o clamonacc-fts.o `test -f './misc/fts.c' || echo '$(srcdir)/'`./misc/fts.c
924
+
925
+clamonacc-fts.obj: ./misc/fts.c
926
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(clamonacc_CPPFLAGS) $(CPPFLAGS) $(clamonacc_CFLAGS) $(CFLAGS) -MT clamonacc-fts.obj -MD -MP -MF $(DEPDIR)/clamonacc-fts.Tpo -c -o clamonacc-fts.obj `if test -f './misc/fts.c'; then $(CYGPATH_W) './misc/fts.c'; else $(CYGPATH_W) '$(srcdir)/./misc/fts.c'; fi`
927
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/clamonacc-fts.Tpo $(DEPDIR)/clamonacc-fts.Po
928
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='./misc/fts.c' object='clamonacc-fts.obj' libtool=no @AMDEPBACKSLASH@
929
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
930
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(clamonacc_CPPFLAGS) $(CPPFLAGS) $(clamonacc_CFLAGS) $(CFLAGS) -c -o clamonacc-fts.obj `if test -f './misc/fts.c'; then $(CYGPATH_W) './misc/fts.c'; else $(CYGPATH_W) '$(srcdir)/./misc/fts.c'; fi`
931
+
918 932
 mostlyclean-libtool:
919 933
 	-rm -f *.lo
920 934
 
... ...
@@ -1128,8 +1136,6 @@ uninstall-am: uninstall-binPROGRAMS
1128 1128
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
1129 1129
 	uninstall-am uninstall-binPROGRAMS
1130 1130
 
1131
-.PRECIOUS: Makefile
1132
-
1133 1131
 
1134 1132
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1135 1133
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -49,7 +49,6 @@
49 49
 #include "./inotif/onaccess_ddd.h"
50 50
 
51 51
 
52
-int reload = 0;
53 52
 pthread_t ddd_pid = 0;
54 53
 
55 54
 int main(int argc, char **argv)
... ...
@@ -319,7 +319,7 @@ int onas_client_scan(struct onas_context **ctx, const char *fname, STATBUF sb, i
319 319
 	if((sockd = onas_dconnect(ctx)) >= 0 && (ret = onas_dsresult(ctx, sockd, scantype, fname, &ret, err, ret_code)) >= 0) {
320 320
 		*infected = ret;
321 321
 	} else {
322
-		logg("*ClamClient: connection could not be established ... return code %d\n", ret);
322
+		logg("*ClamClient: connection could not be established ... return code %d\n", *ret_code);
323 323
 		errors = 1;
324 324
 	}
325 325
 	if(sockd >= 0) {
... ...
@@ -54,7 +54,6 @@
54 54
 #include "../client/onaccess_client.h"
55 55
 
56 56
 extern pthread_t ddd_pid;
57
-extern int reload;
58 57
 
59 58
 /*static void onas_fan_exit(int sig)
60 59
 {
... ...
@@ -139,7 +138,7 @@ cl_error_t onas_setup_fanotif(struct onas_context **ctx) {
139 139
 
140 140
 	if (optget((*ctx)->clamdopts, "OnAccessPrevention")->enabled && !optget((*ctx)->clamdopts, "OnAccessMountPath")->enabled) {
141 141
 		logg("*ClamFanotif: kernel-level blocking feature enabled ... preventing malicious files access attempts\n");
142
-		(*ctx)->fan_mask |= FAN_ACCESS_PERM | FAN_OPEN_PERM;
142
+		(*ctx)->fan_mask |= FAN_ACCESS_PERM | FAN_OPEN_PERM | FAN_NONBLOCK;
143 143
     } else {
144 144
 		logg("*ClamFanotif: kernel-level blocking feature disabled ...\n");
145 145
 		if (optget((*ctx)->clamdopts, "OnAccessPrevention")->enabled && optget((*ctx)->clamdopts, "OnAccessMountPath")->enabled) {
... ...
@@ -206,9 +205,8 @@ int onas_fan_eloop(struct onas_context **ctx) {
206 206
     FD_ZERO(&rfds);
207 207
 	FD_SET((*ctx)->fan_fd, &rfds);
208 208
     do {
209
-        if (reload) sleep(1);
210 209
 		ret = select((*ctx)->fan_fd + 1, &rfds, NULL, NULL, NULL);
211
-    } while ((ret == -1 && errno == EINTR) || reload);
210
+	} while((ret == -1 && errno == EINTR));
212 211
 
213 212
     time_t start = time(NULL) - 30;
214 213
 	while(((bread = read((*ctx)->fan_fd, buf, sizeof(buf))) > 0) || errno == EOVERFLOW) {
... ...
@@ -271,9 +269,8 @@ int onas_fan_eloop(struct onas_context **ctx) {
271 271
         fmd = FAN_EVENT_NEXT(fmd, bread);
272 272
     }
273 273
     do {
274
-        if (reload) sleep(1);
275 274
 				ret = select((*ctx)->fan_fd + 1, &rfds, NULL, NULL, NULL);
276
-    } while ((ret == -1 && errno == EINTR) || reload);
275
+		} while((ret == -1 && errno == EINTR));
277 276
 }
278 277
 
279 278
 		if(bread < 0) {
... ...
@@ -50,7 +50,7 @@
50 50
 #include "clamd/server.h"
51 51
 #include "clamd/others.h"
52 52
 #include "clamd/scanner.h"
53
-#include "clamd/priv_fts.h"
53
+#include "../misc/priv_fts.h"
54 54
 
55 55
 static struct onas_bucket *onas_bucket_init();
56 56
 static void onas_free_bucket(struct onas_bucket *bckt);
57 57
new file mode 100644
... ...
@@ -0,0 +1,1165 @@
0
+/* File tree traversal functions.
1
+   Copyright (C) 1994-2015 Free Software Foundation, Inc.
2
+   This file is part of the GNU C Library.
3
+
4
+   The GNU C Library is free software; you can redistribute it and/or
5
+   modify it under the terms of the GNU Lesser General Public
6
+   License as published by the Free Software Foundation; either
7
+   version 2.1 of the License, or (at your option) any later version.
8
+
9
+   The GNU C Library is distributed in the hope that it will be useful,
10
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
11
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12
+   Lesser General Public License for more details.
13
+
14
+   You should have received a copy of the GNU Lesser General Public
15
+   License along with the GNU C Library; if not, see
16
+   <http://www.gnu.org/licenses/>.  */
17
+
18
+/*-
19
+ * Copyright (c) 1990, 1993, 1994
20
+ *	The Regents of the University of California.  All rights reserved.
21
+ *
22
+ * Redistribution and use in source and binary forms, with or without
23
+ * modification, are permitted provided that the following conditions
24
+ * are met:
25
+ * 1. Redistributions of source code must retain the above copyright
26
+ *    notice, this list of conditions and the following disclaimer.
27
+ * 2. Redistributions in binary form must reproduce the above copyright
28
+ *    notice, this list of conditions and the following disclaimer in the
29
+ *    documentation and/or other materials provided with the distribution.
30
+ * 4. Neither the name of the University nor the names of its contributors
31
+ *    may be used to endorse or promote products derived from this software
32
+ *    without specific prior written permission.
33
+ *
34
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
35
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
36
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
37
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
38
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
39
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
40
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
41
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
42
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
43
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
44
+ * SUCH DAMAGE.
45
+ */
46
+
47
+#if defined(LIBC_SCCS) && !defined(lint)
48
+static char sccsid[] = "@(#)fts.c	8.6 (Berkeley) 8/14/94";
49
+#endif /* LIBC_SCCS and not lint */
50
+
51
+#if HAVE_CONFIG_H
52
+#include "clamav-config.h"
53
+#endif
54
+
55
+#if defined(FANOTIFY) && defined(C_LINUX)
56
+
57
+#include <sys/param.h>
58
+#include <sys/stat.h>
59
+#include <fcntl.h>
60
+#include <dirent.h>
61
+#include <errno.h>
62
+#include "priv_fts.h"
63
+#include <stdlib.h>
64
+#include <string.h>
65
+#include <unistd.h>
66
+
67
+#define FTS_OPEN _priv_fts_open
68
+#define FTS_CLOSE _priv_fts_close
69
+#define FTS_READ _priv_fts_read
70
+#define FTS_SET _priv_fts_set
71
+#define FTS_CHILDREN _priv_fts_children
72
+#define FTSOBJ FTS
73
+#define FTSENTRY FTSENT
74
+#define INO_T ino_t
75
+#define STAT stat
76
+#define LSTAT lstat
77
+
78
+#define internal_function
79
+# define __set_errno(val) (errno = (val))
80
+
81
+/* Largest alignment size needed, minus one.
82
+   Usually long double is the worst case.  */
83
+#ifndef ALIGNBYTES
84
+#define ALIGNBYTES	(__alignof__ (long double) - 1)
85
+#endif
86
+/* Align P to that size.  */
87
+#ifndef ALIGN
88
+#define	ALIGN(p)	(((unsigned long int) (p) + ALIGNBYTES) & ~ALIGNBYTES)
89
+#endif
90
+
91
+/* Support for the LFS API version.  */
92
+#ifndef FTS_OPEN
93
+#define FTS_OPEN fts_open
94
+#define FTS_CLOSE fts_close
95
+#define FTS_READ fts_read
96
+#define FTS_SET fts_set
97
+#define FTS_CHILDREN fts_children
98
+# define FTSOBJ FTS
99
+# define FTSENTRY FTSENT
100
+# define INO_T ino_t
101
+# define STAT stat
102
+# define LSTAT lstat
103
+#endif
104
+
105
+static FTSENTRY	*fts_alloc (FTSOBJ *, const char *, size_t) internal_function;
106
+static FTSENTRY	*fts_build (FTSOBJ *, int) internal_function;
107
+static void	 fts_lfree (FTSENTRY *) internal_function;
108
+static void	 fts_load (FTSOBJ *, FTSENTRY *) internal_function;
109
+static size_t	 fts_maxarglen (char * const *) internal_function;
110
+static void	 fts_padjust (FTSOBJ *, FTSENTRY *) internal_function;
111
+static int	 fts_palloc (FTSOBJ *, size_t) internal_function;
112
+static FTSENTRY	*fts_sort (FTSOBJ *, FTSENTRY *, int) internal_function;
113
+static u_short	 fts_stat (FTSOBJ *, FTSENTRY *, int) internal_function;
114
+static int      fts_safe_changedir (FTSOBJ *, FTSENTRY *, int, const char *)
115
+     internal_function;
116
+
117
+#ifndef MAX
118
+#define MAX(a, b)	({ __typeof__ (a) _a = (a); \
119
+			   __typeof__ (b) _b = (b); \
120
+			   _a > _b ? _a : _b; })
121
+#endif
122
+
123
+#define	ISDOT(a)	(a[0] == '.' && (!a[1] || (a[1] == '.' && !a[2])))
124
+
125
+#define CLR(opt)	(sp->fts_options &= ~(opt))
126
+#define	ISSET(opt)	(sp->fts_options & (opt))
127
+#define	SET(opt)	(sp->fts_options |= (opt))
128
+
129
+#define	FCHDIR(sp, fd)	(!ISSET(FTS_NOCHDIR) && fchdir(fd))
130
+
131
+/* fts_build flags */
132
+#define	BCHILD		1		/* fts_children */
133
+#define	BNAMES		2		/* fts_children, names only */
134
+#define	BREAD		3		/* fts_read */
135
+
136
+FTSOBJ *
137
+FTS_OPEN (char * const *argv, int options,
138
+	  int (*compar) (const FTSENTRY **, const FTSENTRY **))
139
+{
140
+	FTSOBJ *sp;
141
+	FTSENTRY *p, *root;
142
+	int nitems;
143
+	FTSENTRY *parent = NULL;
144
+	FTSENTRY *tmp;
145
+
146
+	/* Options check. */
147
+	if (options & ~FTS_OPTIONMASK) {
148
+		__set_errno (EINVAL);
149
+		return (NULL);
150
+	}
151
+
152
+	/* Allocate/initialize the stream */
153
+	if ((sp = malloc((u_int)sizeof(FTSOBJ))) == NULL)
154
+		return (NULL);
155
+	memset(sp, 0, sizeof(FTSOBJ));
156
+	sp->fts_compar = (int (*) (const void *, const void *)) compar;
157
+	sp->fts_options = options;
158
+
159
+	/* Logical walks turn on NOCHDIR; symbolic links are too hard. */
160
+	if (ISSET(FTS_LOGICAL))
161
+		SET(FTS_NOCHDIR);
162
+
163
+	/*
164
+	 * Start out with 1K of path space, and enough, in any case,
165
+	 * to hold the user's paths.
166
+	 */
167
+#ifndef MAXPATHLEN
168
+#define MAXPATHLEN 1024
169
+#endif
170
+	size_t maxarglen = fts_maxarglen(argv);
171
+	if (fts_palloc(sp, MAX(maxarglen, MAXPATHLEN)))
172
+		goto mem1;
173
+
174
+	/* Allocate/initialize root's parent. */
175
+	if (*argv != NULL) {
176
+		if ((parent = fts_alloc(sp, "", 0)) == NULL)
177
+			goto mem2;
178
+		parent->fts_level = FTS_ROOTPARENTLEVEL;
179
+	  }
180
+
181
+	/* Allocate/initialize root(s). */
182
+	for (root = NULL, nitems = 0; *argv != NULL; ++argv, ++nitems) {
183
+		/* Don't allow zero-length paths. */
184
+		size_t len = strlen(*argv);
185
+		if (len == 0) {
186
+			__set_errno (ENOENT);
187
+			goto mem3;
188
+		}
189
+
190
+		p = fts_alloc(sp, *argv, len);
191
+		p->fts_level = FTS_ROOTLEVEL;
192
+		p->fts_parent = parent;
193
+		p->fts_accpath = p->fts_name;
194
+		p->fts_info = fts_stat(sp, p, ISSET(FTS_COMFOLLOW));
195
+
196
+		/* Command-line "." and ".." are real directories. */
197
+		if (p->fts_info == FTS_DOT)
198
+			p->fts_info = FTS_D;
199
+
200
+		/*
201
+		 * If comparison routine supplied, traverse in sorted
202
+		 * order; otherwise traverse in the order specified.
203
+		 */
204
+		if (compar) {
205
+			p->fts_link = root;
206
+			root = p;
207
+		} else {
208
+			p->fts_link = NULL;
209
+			if (root == NULL)
210
+				tmp = root = p;
211
+			else {
212
+				tmp->fts_link = p;
213
+				tmp = p;
214
+			}
215
+		}
216
+	}
217
+	if (compar && nitems > 1)
218
+		root = fts_sort(sp, root, nitems);
219
+
220
+	/*
221
+	 * Allocate a dummy pointer and make fts_read think that we've just
222
+	 * finished the node before the root(s); set p->fts_info to FTS_INIT
223
+	 * so that everything about the "current" node is ignored.
224
+	 */
225
+	if ((sp->fts_cur = fts_alloc(sp, "", 0)) == NULL)
226
+		goto mem3;
227
+	sp->fts_cur->fts_link = root;
228
+	sp->fts_cur->fts_info = FTS_INIT;
229
+
230
+	/*
231
+	 * If using chdir(2), grab a file descriptor pointing to dot to ensure
232
+	 * that we can get back here; this could be avoided for some paths,
233
+	 * but almost certainly not worth the effort.  Slashes, symbolic links,
234
+	 * and ".." are all fairly nasty problems.  Note, if we can't get the
235
+	 * descriptor we run anyway, just more slowly.
236
+	 */
237
+	if (!ISSET(FTS_NOCHDIR)
238
+	    && (sp->fts_rfd = open(".", O_RDONLY, 0)) < 0)
239
+		SET(FTS_NOCHDIR);
240
+
241
+	return (sp);
242
+
243
+mem3:	fts_lfree(root);
244
+	free(parent);
245
+mem2:	free(sp->fts_path);
246
+mem1:	free(sp);
247
+	return (NULL);
248
+}
249
+
250
+static void
251
+internal_function
252
+fts_load (FTSOBJ *sp, FTSENTRY *p)
253
+{
254
+	int len;
255
+	char *cp;
256
+
257
+	/*
258
+	 * Load the stream structure for the next traversal.  Since we don't
259
+	 * actually enter the directory until after the preorder visit, set
260
+	 * the fts_accpath field specially so the chdir gets done to the right
261
+	 * place and the user can access the first node.  From fts_open it's
262
+	 * known that the path will fit.
263
+	 */
264
+	len = p->fts_pathlen = p->fts_namelen;
265
+	memmove(sp->fts_path, p->fts_name, len + 1);
266
+	if ((cp = strrchr(p->fts_name, '/')) && (cp != p->fts_name || cp[1])) {
267
+		len = strlen(++cp);
268
+		memmove(p->fts_name, cp, len + 1);
269
+		p->fts_namelen = len;
270
+	}
271
+	p->fts_accpath = p->fts_path = sp->fts_path;
272
+	sp->fts_dev = p->fts_dev;
273
+}
274
+
275
+int
276
+FTS_CLOSE (FTSOBJ *sp)
277
+{
278
+	FTSENTRY *freep, *p;
279
+	int saved_errno;
280
+
281
+	/*
282
+	 * This still works if we haven't read anything -- the dummy structure
283
+	 * points to the root list, so we step through to the end of the root
284
+	 * list which has a valid parent pointer.
285
+	 */
286
+	if (sp->fts_cur) {
287
+		for (p = sp->fts_cur; p->fts_level >= FTS_ROOTLEVEL;) {
288
+			freep = p;
289
+			p = p->fts_link != NULL ? p->fts_link : p->fts_parent;
290
+			free(freep);
291
+		}
292
+		free(p);
293
+	}
294
+
295
+	/* Free up child linked list, sort array, path buffer. */
296
+	if (sp->fts_child)
297
+		fts_lfree(sp->fts_child);
298
+	free(sp->fts_array);
299
+	free(sp->fts_path);
300
+
301
+	/* Return to original directory, save errno if necessary. */
302
+	if (!ISSET(FTS_NOCHDIR)) {
303
+		saved_errno = fchdir(sp->fts_rfd) ? errno : 0;
304
+		(void)close(sp->fts_rfd);
305
+
306
+		/* Set errno and return. */
307
+		if (saved_errno != 0) {
308
+			/* Free up the stream pointer. */
309
+			free(sp);
310
+			__set_errno (saved_errno);
311
+			return (-1);
312
+		}
313
+	}
314
+
315
+	/* Free up the stream pointer. */
316
+	free(sp);
317
+	return (0);
318
+}
319
+
320
+/*
321
+ * Special case of "/" at the end of the path so that slashes aren't
322
+ * appended which would cause paths to be written as "....//foo".
323
+ */
324
+#define	NAPPEND(p)							\
325
+	(p->fts_path[p->fts_pathlen - 1] == '/'				\
326
+	    ? p->fts_pathlen - 1 : p->fts_pathlen)
327
+
328
+FTSENTRY *
329
+FTS_READ (FTSOBJ *sp)
330
+{
331
+	FTSENTRY *p, *tmp;
332
+	int instr;
333
+	char *t;
334
+	int saved_errno;
335
+
336
+	/* If finished or unrecoverable error, return NULL. */
337
+	if (sp->fts_cur == NULL || ISSET(FTS_STOP))
338
+		return (NULL);
339
+
340
+	/* Set current node pointer. */
341
+	p = sp->fts_cur;
342
+
343
+	/* Save and zero out user instructions. */
344
+	instr = p->fts_instr;
345
+	p->fts_instr = FTS_NOINSTR;
346
+
347
+	/* Any type of file may be re-visited; re-stat and re-turn. */
348
+	if (instr == FTS_AGAIN) {
349
+		p->fts_info = fts_stat(sp, p, 0);
350
+		return (p);
351
+	}
352
+
353
+	/*
354
+	 * Following a symlink -- SLNONE test allows application to see
355
+	 * SLNONE and recover.  If indirecting through a symlink, have
356
+	 * keep a pointer to current location.  If unable to get that
357
+	 * pointer, follow fails.
358
+	 */
359
+	if (instr == FTS_FOLLOW &&
360
+	    (p->fts_info == FTS_SL || p->fts_info == FTS_SLNONE)) {
361
+		p->fts_info = fts_stat(sp, p, 1);
362
+		if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
363
+			if ((p->fts_symfd = open(".", O_RDONLY, 0)) < 0) {
364
+				p->fts_errno = errno;
365
+				p->fts_info = FTS_ERR;
366
+			} else
367
+				p->fts_flags |= FTS_SYMFOLLOW;
368
+		}
369
+		return (p);
370
+	}
371
+
372
+	/* Directory in pre-order. */
373
+	if (p->fts_info == FTS_D) {
374
+		/* If skipped or crossed mount point, do post-order visit. */
375
+		if (instr == FTS_SKIP ||
376
+		    (ISSET(FTS_XDEV) && p->fts_dev != sp->fts_dev)) {
377
+			if (p->fts_flags & FTS_SYMFOLLOW)
378
+				(void)close(p->fts_symfd);
379
+			if (sp->fts_child) {
380
+				fts_lfree(sp->fts_child);
381
+				sp->fts_child = NULL;
382
+			}
383
+			p->fts_info = FTS_DP;
384
+			return (p);
385
+		}
386
+
387
+		/* Rebuild if only read the names and now traversing. */
388
+		if (sp->fts_child != NULL && ISSET(FTS_NAMEONLY)) {
389
+			CLR(FTS_NAMEONLY);
390
+			fts_lfree(sp->fts_child);
391
+			sp->fts_child = NULL;
392
+		}
393
+
394
+		/*
395
+		 * Cd to the subdirectory.
396
+		 *
397
+		 * If have already read and now fail to chdir, whack the list
398
+		 * to make the names come out right, and set the parent errno
399
+		 * so the application will eventually get an error condition.
400
+		 * Set the FTS_DONTCHDIR flag so that when we logically change
401
+		 * directories back to the parent we don't do a chdir.
402
+		 *
403
+		 * If haven't read do so.  If the read fails, fts_build sets
404
+		 * FTS_STOP or the fts_info field of the node.
405
+		 */
406
+		if (sp->fts_child != NULL) {
407
+			if (fts_safe_changedir(sp, p, -1, p->fts_accpath)) {
408
+				p->fts_errno = errno;
409
+				p->fts_flags |= FTS_DONTCHDIR;
410
+				for (p = sp->fts_child; p != NULL;
411
+				     p = p->fts_link)
412
+					p->fts_accpath =
413
+					    p->fts_parent->fts_accpath;
414
+			}
415
+		} else if ((sp->fts_child = fts_build(sp, BREAD)) == NULL) {
416
+			if (ISSET(FTS_STOP))
417
+				return (NULL);
418
+			return (p);
419
+		}
420
+		p = sp->fts_child;
421
+		sp->fts_child = NULL;
422
+		sp->fts_cur = p;
423
+		goto name;
424
+	}
425
+
426
+	/* Move to the next node on this level. */
427
+next:	tmp = p;
428
+	if ((p = p->fts_link) != NULL) {
429
+		sp->fts_cur = p;
430
+		free(tmp);
431
+
432
+		/*
433
+		 * If reached the top, return to the original directory (or
434
+		 * the root of the tree), and load the paths for the next root.
435
+		 */
436
+		if (p->fts_level == FTS_ROOTLEVEL) {
437
+			if (FCHDIR(sp, sp->fts_rfd)) {
438
+				SET(FTS_STOP);
439
+				return (NULL);
440
+			}
441
+			fts_load(sp, p);
442
+			return p;
443
+		}
444
+
445
+		/*
446
+		 * User may have called fts_set on the node.  If skipped,
447
+		 * ignore.  If followed, get a file descriptor so we can
448
+		 * get back if necessary.
449
+		 */
450
+		if (p->fts_instr == FTS_SKIP)
451
+			goto next;
452
+		if (p->fts_instr == FTS_FOLLOW) {
453
+			p->fts_info = fts_stat(sp, p, 1);
454
+			if (p->fts_info == FTS_D && !ISSET(FTS_NOCHDIR)) {
455
+				if ((p->fts_symfd =
456
+				    open(".", O_RDONLY, 0)) < 0) {
457
+					p->fts_errno = errno;
458
+					p->fts_info = FTS_ERR;
459
+				} else
460
+					p->fts_flags |= FTS_SYMFOLLOW;
461
+			}
462
+			p->fts_instr = FTS_NOINSTR;
463
+		}
464
+
465
+name:		t = sp->fts_path + NAPPEND(p->fts_parent);
466
+		*t++ = '/';
467
+		memmove(t, p->fts_name, p->fts_namelen + 1);
468
+		return p;
469
+	}
470
+
471
+	/* Move up to the parent node. */
472
+	p = tmp->fts_parent;
473
+	sp->fts_cur = p;
474
+	free(tmp);
475
+
476
+	if (p->fts_level == FTS_ROOTPARENTLEVEL) {
477
+		/*
478
+		 * Done; free everything up and set errno to 0 so the user
479
+		 * can distinguish between error and EOF.
480
+		 */
481
+		free(p);
482
+		__set_errno (0);
483
+		return (sp->fts_cur = NULL);
484
+	}
485
+
486
+	/* NUL terminate the pathname. */
487
+	sp->fts_path[p->fts_pathlen] = '\0';
488
+
489
+	/*
490
+	 * Return to the parent directory.  If at a root node or came through
491
+	 * a symlink, go back through the file descriptor.  Otherwise, cd up
492
+	 * one directory.
493
+	 */
494
+	if (p->fts_level == FTS_ROOTLEVEL) {
495
+		if (FCHDIR(sp, sp->fts_rfd)) {
496
+			SET(FTS_STOP);
497
+			return (NULL);
498
+		}
499
+	} else if (p->fts_flags & FTS_SYMFOLLOW) {
500
+		if (FCHDIR(sp, p->fts_symfd)) {
501
+			saved_errno = errno;
502
+			(void)close(p->fts_symfd);
503
+			__set_errno (saved_errno);
504
+			SET(FTS_STOP);
505
+			return (NULL);
506
+		}
507
+		(void)close(p->fts_symfd);
508
+	} else if (!(p->fts_flags & FTS_DONTCHDIR) &&
509
+		   fts_safe_changedir(sp, p->fts_parent, -1, "..")) {
510
+		SET(FTS_STOP);
511
+		return (NULL);
512
+	}
513
+	p->fts_info = p->fts_errno ? FTS_ERR : FTS_DP;
514
+	return p;
515
+}
516
+
517
+/*
518
+ * Fts_set takes the stream as an argument although it's not used in this
519
+ * implementation; it would be necessary if anyone wanted to add global
520
+ * semantics to fts using fts_set.  An error return is allowed for similar
521
+ * reasons.
522
+ */
523
+/* ARGSUSED */
524
+int
525
+FTS_SET (FTSOBJ *sp, FTSENTRY *p, int instr)
526
+{
527
+	if (instr != 0 && instr != FTS_AGAIN && instr != FTS_FOLLOW &&
528
+	    instr != FTS_NOINSTR && instr != FTS_SKIP) {
529
+		__set_errno (EINVAL);
530
+		return (1);
531
+	}
532
+	p->fts_instr = instr;
533
+	return (0);
534
+}
535
+
536
+FTSENTRY *
537
+FTS_CHILDREN(FTSOBJ *sp, int instr)
538
+{
539
+	FTSENTRY *p;
540
+	int fd;
541
+
542
+	if (instr != 0 && instr != FTS_NAMEONLY) {
543
+		__set_errno (EINVAL);
544
+		return (NULL);
545
+	}
546
+
547
+	/* Set current node pointer. */
548
+	p = sp->fts_cur;
549
+
550
+	/*
551
+	 * Errno set to 0 so user can distinguish empty directory from
552
+	 * an error.
553
+	 */
554
+	__set_errno (0);
555
+
556
+	/* Fatal errors stop here. */
557
+	if (ISSET(FTS_STOP))
558
+		return (NULL);
559
+
560
+	/* Return logical hierarchy of user's arguments. */
561
+	if (p->fts_info == FTS_INIT)
562
+		return (p->fts_link);
563
+
564
+	/*
565
+	 * If not a directory being visited in pre-order, stop here.  Could
566
+	 * allow FTS_DNR, assuming the user has fixed the problem, but the
567
+	 * same effect is available with FTS_AGAIN.
568
+	 */
569
+	if (p->fts_info != FTS_D /* && p->fts_info != FTS_DNR */)
570
+		return (NULL);
571
+
572
+	/* Free up any previous child list. */
573
+	if (sp->fts_child != NULL)
574
+		fts_lfree(sp->fts_child);
575
+
576
+	if (instr == FTS_NAMEONLY) {
577
+		SET(FTS_NAMEONLY);
578
+		instr = BNAMES;
579
+	} else
580
+		instr = BCHILD;
581
+
582
+	/*
583
+	 * If using chdir on a relative path and called BEFORE fts_read does
584
+	 * its chdir to the root of a traversal, we can lose -- we need to
585
+	 * chdir into the subdirectory, and we don't know where the current
586
+	 * directory is, so we can't get back so that the upcoming chdir by
587
+	 * fts_read will work.
588
+	 */
589
+	if (p->fts_level != FTS_ROOTLEVEL || p->fts_accpath[0] == '/' ||
590
+	    ISSET(FTS_NOCHDIR))
591
+		return (sp->fts_child = fts_build(sp, instr));
592
+
593
+	if ((fd = open(".", O_RDONLY, 0)) < 0)
594
+		return (NULL);
595
+	sp->fts_child = fts_build(sp, instr);
596
+	if (fchdir(fd))
597
+		return (NULL);
598
+	(void)close(fd);
599
+	return (sp->fts_child);
600
+}
601
+
602
+static inline int
603
+dirent_not_directory(const struct dirent *dp)
604
+{
605
+#if defined DT_DIR && defined _DIRENT_HAVE_D_TYPE
606
+        return dp->d_type != DT_DIR && dp->d_type != DT_UNKNOWN;
607
+#else
608
+        return 0;
609
+#endif
610
+}
611
+
612
+/*
613
+ * This is the tricky part -- do not casually change *anything* in here.  The
614
+ * idea is to build the linked list of entries that are used by fts_children
615
+ * and fts_read.  There are lots of special cases.
616
+ *
617
+ * The real slowdown in walking the tree is the stat calls.  If FTS_NOSTAT is
618
+ * set and it's a physical walk (so that symbolic links can't be directories),
619
+ * we can do things quickly.  First, if it's a 4.4BSD file system, the type
620
+ * of the file is in the directory entry.  Otherwise, we assume that the number
621
+ * of subdirectories in a node is equal to the number of links to the parent.
622
+ * The former skips all stat calls.  The latter skips stat calls in any leaf
623
+ * directories and for any files after the subdirectories in the directory have
624
+ * been found, cutting the stat calls by about 2/3.
625
+ */
626
+static FTSENTRY *
627
+internal_function
628
+fts_build (FTSOBJ *sp, int type)
629
+{
630
+	struct dirent *dp;
631
+	FTSENTRY *p, *head;
632
+	int nitems;
633
+	FTSENTRY *cur, *tail;
634
+	DIR *dirp;
635
+	void *oldaddr;
636
+	int cderrno, descend, len, level, nlinks, saved_errno,
637
+	    nostat, doadjust;
638
+	size_t maxlen;
639
+	char *cp;
640
+
641
+	/* Set current node pointer. */
642
+	cur = sp->fts_cur;
643
+
644
+	/*
645
+	 * Open the directory for reading.  If this fails, we're done.
646
+	 * If being called from fts_read, set the fts_info field.
647
+	 */
648
+#if defined FTS_WHITEOUT && 0
649
+	if (ISSET(FTS_WHITEOUT))
650
+		oflag = DTF_NODUP|DTF_REWIND;
651
+	else
652
+		oflag = DTF_HIDEW|DTF_NODUP|DTF_REWIND;
653
+#else
654
+# define __opendir2(path, flag) opendir(path)
655
+#endif
656
+       if ((dirp = __opendir2(cur->fts_accpath, oflag)) == NULL) {
657
+		if (type == BREAD) {
658
+			cur->fts_info = FTS_DNR;
659
+			cur->fts_errno = errno;
660
+		}
661
+		return (NULL);
662
+	}
663
+
664
+	/*
665
+	 * Nlinks is the number of possible entries of type directory in the
666
+	 * directory if we're cheating on stat calls, 0 if we're not doing
667
+	 * any stat calls at all, -1 if we're doing stats on everything.
668
+	 */
669
+	if (type == BNAMES) {
670
+		nlinks = 0;
671
+		/* Be quiet about nostat, GCC. */
672
+		nostat = 0;
673
+	} else if (ISSET(FTS_NOSTAT) && ISSET(FTS_PHYSICAL)) {
674
+		nlinks = cur->fts_nlink - (ISSET(FTS_SEEDOT) ? 0 : 2);
675
+		nostat = 1;
676
+	} else {
677
+		nlinks = -1;
678
+		nostat = 0;
679
+	}
680
+
681
+#ifdef notdef
682
+	(void)printf("nlinks == %d (cur: %d)\n", nlinks, cur->fts_nlink);
683
+	(void)printf("NOSTAT %d PHYSICAL %d SEEDOT %d\n",
684
+	    ISSET(FTS_NOSTAT), ISSET(FTS_PHYSICAL), ISSET(FTS_SEEDOT));
685
+#endif
686
+	/*
687
+	 * If we're going to need to stat anything or we want to descend
688
+	 * and stay in the directory, chdir.  If this fails we keep going,
689
+	 * but set a flag so we don't chdir after the post-order visit.
690
+	 * We won't be able to stat anything, but we can still return the
691
+	 * names themselves.  Note, that since fts_read won't be able to
692
+	 * chdir into the directory, it will have to return different path
693
+	 * names than before, i.e. "a/b" instead of "b".  Since the node
694
+	 * has already been visited in pre-order, have to wait until the
695
+	 * post-order visit to return the error.  There is a special case
696
+	 * here, if there was nothing to stat then it's not an error to
697
+	 * not be able to stat.  This is all fairly nasty.  If a program
698
+	 * needed sorted entries or stat information, they had better be
699
+	 * checking FTS_NS on the returned nodes.
700
+	 */
701
+	cderrno = 0;
702
+	if (nlinks || type == BREAD) {
703
+		if (fts_safe_changedir(sp, cur, dirfd(dirp), NULL)) {
704
+			if (nlinks && type == BREAD)
705
+				cur->fts_errno = errno;
706
+			cur->fts_flags |= FTS_DONTCHDIR;
707
+			descend = 0;
708
+			cderrno = errno;
709
+			(void)closedir(dirp);
710
+			dirp = NULL;
711
+		} else
712
+			descend = 1;
713
+	} else
714
+		descend = 0;
715
+
716
+	/*
717
+	 * Figure out the max file name length that can be stored in the
718
+	 * current path -- the inner loop allocates more path as necessary.
719
+	 * We really wouldn't have to do the maxlen calculations here, we
720
+	 * could do them in fts_read before returning the path, but it's a
721
+	 * lot easier here since the length is part of the dirent structure.
722
+	 *
723
+	 * If not changing directories set a pointer so that can just append
724
+	 * each new name into the path.
725
+	 */
726
+	len = NAPPEND(cur);
727
+	if (ISSET(FTS_NOCHDIR)) {
728
+		cp = sp->fts_path + len;
729
+		*cp++ = '/';
730
+	} else {
731
+		/* GCC, you're too verbose. */
732
+		cp = NULL;
733
+	}
734
+	len++;
735
+	maxlen = sp->fts_pathlen - len;
736
+
737
+	level = cur->fts_level + 1;
738
+
739
+	/* Read the directory, attaching each entry to the `link' pointer. */
740
+	doadjust = 0;
741
+	for (head = tail = NULL, nitems = 0; dirp && (dp = readdir(dirp));) {
742
+		if (!ISSET(FTS_SEEDOT) && ISDOT(dp->d_name))
743
+			continue;
744
+
745
+		if ((p = fts_alloc(sp, dp->d_name, _D_EXACT_NAMLEN (dp))) == NULL)
746
+			goto mem1;
747
+		if (_D_EXACT_NAMLEN (dp) >= maxlen) {/* include space for NUL */
748
+			oldaddr = sp->fts_path;
749
+			if (fts_palloc(sp, _D_EXACT_NAMLEN (dp) + len + 1)) {
750
+				/*
751
+				 * No more memory for path or structures.  Save
752
+				 * errno, free up the current structure and the
753
+				 * structures already allocated.
754
+				 */
755
+mem1:				saved_errno = errno;
756
+				free(p);
757
+				fts_lfree(head);
758
+				(void)closedir(dirp);
759
+				cur->fts_info = FTS_ERR;
760
+				SET(FTS_STOP);
761
+				__set_errno (saved_errno);
762
+				return (NULL);
763
+			}
764
+			/* Did realloc() change the pointer? */
765
+			if (oldaddr != sp->fts_path) {
766
+				doadjust = 1;
767
+				if (ISSET(FTS_NOCHDIR))
768
+					cp = sp->fts_path + len;
769
+			}
770
+			maxlen = sp->fts_pathlen - len;
771
+		}
772
+
773
+		if (len + _D_EXACT_NAMLEN (dp) >= USHRT_MAX) {
774
+			/*
775
+			 * In an FTSENT, fts_pathlen is a u_short so it is
776
+			 * possible to wraparound here.  If we do, free up
777
+			 * the current structure and the structures already
778
+			 * allocated, then error out with ENAMETOOLONG.
779
+			 */
780
+			free(p);
781
+			fts_lfree(head);
782
+			(void)closedir(dirp);
783
+			cur->fts_info = FTS_ERR;
784
+			SET(FTS_STOP);
785
+			__set_errno (ENAMETOOLONG);
786
+			return (NULL);
787
+		}
788
+		p->fts_level = level;
789
+		p->fts_parent = sp->fts_cur;
790
+		p->fts_pathlen = len + _D_EXACT_NAMLEN (dp);
791
+
792
+#if defined FTS_WHITEOUT && 0
793
+		if (dp->d_type == DT_WHT)
794
+			p->fts_flags |= FTS_ISW;
795
+#endif
796
+
797
+		/* Unreachable code.  cderrno is only ever set to a nonnull
798
+		   value if dirp is closed at the same time.  But then we
799
+		   cannot enter this loop.  */
800
+		if (0 && cderrno) {
801
+			if (nlinks) {
802
+				p->fts_info = FTS_NS;
803
+				p->fts_errno = cderrno;
804
+			} else
805
+				p->fts_info = FTS_NSOK;
806
+			p->fts_accpath = cur->fts_accpath;
807
+		} else if (nlinks == 0
808
+                           || (nostat && dirent_not_directory(dp))) {
809
+			p->fts_accpath =
810
+			    ISSET(FTS_NOCHDIR) ? p->fts_path : p->fts_name;
811
+			p->fts_info = FTS_NSOK;
812
+		} else {
813
+			/* Build a file name for fts_stat to stat. */
814
+			if (ISSET(FTS_NOCHDIR)) {
815
+				p->fts_accpath = p->fts_path;
816
+				memmove(cp, p->fts_name, p->fts_namelen + 1);
817
+			} else
818
+				p->fts_accpath = p->fts_name;
819
+			/* Stat it. */
820
+			p->fts_info = fts_stat(sp, p, 0);
821
+
822
+			/* Decrement link count if applicable. */
823
+			if (nlinks > 0 && (p->fts_info == FTS_D ||
824
+			    p->fts_info == FTS_DC || p->fts_info == FTS_DOT))
825
+				--nlinks;
826
+		}
827
+
828
+		/* We walk in directory order so "ls -f" doesn't get upset. */
829
+		p->fts_link = NULL;
830
+		if (head == NULL)
831
+			head = tail = p;
832
+		else {
833
+			tail->fts_link = p;
834
+			tail = p;
835
+		}
836
+		++nitems;
837
+	}
838
+	if (dirp)
839
+		(void)closedir(dirp);
840
+
841
+	/*
842
+	 * If realloc() changed the address of the path, adjust the
843
+	 * addresses for the rest of the tree and the dir list.
844
+	 */
845
+	if (doadjust)
846
+		fts_padjust(sp, head);
847
+
848
+	/*
849
+	 * If not changing directories, reset the path back to original
850
+	 * state.
851
+	 */
852
+	if (ISSET(FTS_NOCHDIR)) {
853
+		if (len == sp->fts_pathlen || nitems == 0)
854
+			--cp;
855
+		*cp = '\0';
856
+	}
857
+
858
+	/*
859
+	 * If descended after called from fts_children or after called from
860
+	 * fts_read and nothing found, get back.  At the root level we use
861
+	 * the saved fd; if one of fts_open()'s arguments is a relative path
862
+	 * to an empty directory, we wind up here with no other way back.  If
863
+	 * can't get back, we're done.
864
+	 */
865
+	if (descend && (type == BCHILD || !nitems) &&
866
+	    (cur->fts_level == FTS_ROOTLEVEL ?
867
+	     FCHDIR(sp, sp->fts_rfd) :
868
+	     fts_safe_changedir(sp, cur->fts_parent, -1, ".."))) {
869
+		cur->fts_info = FTS_ERR;
870
+		SET(FTS_STOP);
871
+		fts_lfree(head);
872
+		return (NULL);
873
+	}
874
+
875
+	/* If didn't find anything, return NULL. */
876
+	if (!nitems) {
877
+		if (type == BREAD)
878
+			cur->fts_info = FTS_DP;
879
+		fts_lfree(head);
880
+		return (NULL);
881
+	}
882
+
883
+	/* Sort the entries. */
884
+	if (sp->fts_compar && nitems > 1)
885
+		head = fts_sort(sp, head, nitems);
886
+	return (head);
887
+}
888
+
889
+static u_short
890
+internal_function
891
+fts_stat (FTSOBJ *sp, FTSENTRY *p, int follow)
892
+{
893
+	FTSENTRY *t;
894
+	dev_t dev;
895
+	INO_T ino;
896
+	struct STAT *sbp, sb;
897
+	int saved_errno;
898
+
899
+	/* If user needs stat info, stat buffer already allocated. */
900
+	sbp = ISSET(FTS_NOSTAT) ? &sb : p->fts_statp;
901
+
902
+#if defined FTS_WHITEOUT && 0
903
+	/* check for whiteout */
904
+	if (p->fts_flags & FTS_ISW) {
905
+		if (sbp != &sb) {
906
+			memset(sbp, '\0', sizeof (*sbp));
907
+			sbp->st_mode = S_IFWHT;
908
+		}
909
+		return (FTS_W);
910
+       }
911
+#endif
912
+
913
+	/*
914
+	 * If doing a logical walk, or application requested FTS_FOLLOW, do
915
+	 * a stat(2).  If that fails, check for a non-existent symlink.  If
916
+	 * fail, set the errno from the stat call.
917
+	 */
918
+	if (ISSET(FTS_LOGICAL) || follow) {
919
+		if (STAT(p->fts_accpath, sbp)) {
920
+			saved_errno = errno;
921
+			if (!LSTAT(p->fts_accpath, sbp)) {
922
+				__set_errno (0);
923
+				return (FTS_SLNONE);
924
+			}
925
+			p->fts_errno = saved_errno;
926
+			goto err;
927
+		}
928
+	} else if (LSTAT(p->fts_accpath, sbp)) {
929
+		p->fts_errno = errno;
930
+err:		memset(sbp, 0, sizeof(struct STAT));
931
+		return (FTS_NS);
932
+	}
933
+
934
+	if (S_ISDIR(sbp->st_mode)) {
935
+		/*
936
+		 * Set the device/inode.  Used to find cycles and check for
937
+		 * crossing mount points.  Also remember the link count, used
938
+		 * in fts_build to limit the number of stat calls.  It is
939
+		 * understood that these fields are only referenced if fts_info
940
+		 * is set to FTS_D.
941
+		 */
942
+		dev = p->fts_dev = sbp->st_dev;
943
+		ino = p->fts_ino = sbp->st_ino;
944
+		p->fts_nlink = sbp->st_nlink;
945
+
946
+		if (ISDOT(p->fts_name))
947
+			return (FTS_DOT);
948
+
949
+		/*
950
+		 * Cycle detection is done by brute force when the directory
951
+		 * is first encountered.  If the tree gets deep enough or the
952
+		 * number of symbolic links to directories is high enough,
953
+		 * something faster might be worthwhile.
954
+		 */
955
+		for (t = p->fts_parent;
956
+		    t->fts_level >= FTS_ROOTLEVEL; t = t->fts_parent)
957
+			if (ino == t->fts_ino && dev == t->fts_dev) {
958
+				p->fts_cycle = t;
959
+				return (FTS_DC);
960
+			}
961
+		return (FTS_D);
962
+	}
963
+	if (S_ISLNK(sbp->st_mode))
964
+		return (FTS_SL);
965
+	if (S_ISREG(sbp->st_mode))
966
+		return (FTS_F);
967
+	return (FTS_DEFAULT);
968
+}
969
+
970
+static FTSENTRY *
971
+internal_function
972
+fts_sort (FTSOBJ *sp, FTSENTRY *head, int nitems)
973
+{
974
+	FTSENTRY **ap, *p;
975
+
976
+	/*
977
+	 * Construct an array of pointers to the structures and call qsort(3).
978
+	 * Reassemble the array in the order returned by qsort.  If unable to
979
+	 * sort for memory reasons, return the directory entries in their
980
+	 * current order.  Allocate enough space for the current needs plus
981
+	 * 40 so don't realloc one entry at a time.
982
+	 */
983
+	if (nitems > sp->fts_nitems) {
984
+		FTSENTRY **a;
985
+
986
+		sp->fts_nitems = nitems + 40;
987
+		if ((a = realloc(sp->fts_array,
988
+		    (size_t)(sp->fts_nitems * sizeof(FTSENTRY *)))) == NULL) {
989
+			free(sp->fts_array);
990
+			sp->fts_array = NULL;
991
+			sp->fts_nitems = 0;
992
+			return (head);
993
+		}
994
+		sp->fts_array = a;
995
+	}
996
+	for (ap = sp->fts_array, p = head; p; p = p->fts_link)
997
+		*ap++ = p;
998
+	qsort((void *)sp->fts_array, nitems, sizeof(FTSENTRY *), sp->fts_compar);
999
+	for (head = *(ap = sp->fts_array); --nitems; ++ap)
1000
+		ap[0]->fts_link = ap[1];
1001
+	ap[0]->fts_link = NULL;
1002
+	return (head);
1003
+}
1004
+
1005
+static FTSENTRY *
1006
+internal_function
1007
+fts_alloc (FTSOBJ *sp, const char *name, size_t namelen)
1008
+{
1009
+	FTSENTRY *p;
1010
+	size_t len;
1011
+
1012
+	/*
1013
+	 * The file name is a variable length array and no stat structure is
1014
+	 * necessary if the user has set the nostat bit.  Allocate the FTSENT
1015
+	 * structure, the file name and the stat structure in one chunk, but
1016
+	 * be careful that the stat structure is reasonably aligned.  Since the
1017
+	 * fts_name field is declared to be of size 1, the fts_name pointer is
1018
+	 * namelen + 2 before the first possible address of the stat structure.
1019
+	 */
1020
+	len = sizeof(FTSENTRY) + namelen;
1021
+	if (!ISSET(FTS_NOSTAT))
1022
+		len += sizeof(struct STAT) + ALIGNBYTES;
1023
+	if ((p = malloc(len)) == NULL)
1024
+		return (NULL);
1025
+
1026
+	/* Copy the name and guarantee NUL termination. */
1027
+	memmove(p->fts_name, name, namelen);
1028
+	p->fts_name[namelen] = '\0';
1029
+
1030
+	if (!ISSET(FTS_NOSTAT))
1031
+		p->fts_statp = (struct STAT *)ALIGN(p->fts_name + namelen + 2);
1032
+	p->fts_namelen = namelen;
1033
+	p->fts_path = sp->fts_path;
1034
+	p->fts_errno = 0;
1035
+	p->fts_flags = 0;
1036
+	p->fts_instr = FTS_NOINSTR;
1037
+	p->fts_number = 0;
1038
+	p->fts_pointer = NULL;
1039
+	return (p);
1040
+}
1041
+
1042
+static void
1043
+internal_function
1044
+fts_lfree (FTSENTRY *head)
1045
+{
1046
+	FTSENTRY *p;
1047
+
1048
+	/* Free a linked list of structures. */
1049
+	while ((p = head)) {
1050
+		head = head->fts_link;
1051
+		free(p);
1052
+	}
1053
+}
1054
+
1055
+/*
1056
+ * Allow essentially unlimited paths; find, rm, ls should all work on any tree.
1057
+ * Most systems will allow creation of paths much longer than MAXPATHLEN, even
1058
+ * though the kernel won't resolve them.  Add the size (not just what's needed)
1059
+ * plus 256 bytes so don't realloc the path 2 bytes at a time.
1060
+ */
1061
+static int
1062
+internal_function
1063
+fts_palloc (FTSOBJ *sp, size_t more)
1064
+{
1065
+	char *p;
1066
+
1067
+	sp->fts_pathlen += more + 256;
1068
+	/*
1069
+	 * Check for possible wraparound.  In an FTS, fts_pathlen is
1070
+	 * a signed int but in an FTSENT it is an unsigned short.
1071
+	 * We limit fts_pathlen to USHRT_MAX to be safe in both cases.
1072
+	 */
1073
+	if (sp->fts_pathlen < 0 || sp->fts_pathlen >= USHRT_MAX) {
1074
+		free(sp->fts_path);
1075
+		sp->fts_path = NULL;
1076
+		__set_errno (ENAMETOOLONG);
1077
+		return (1);
1078
+	}
1079
+	p = realloc(sp->fts_path, sp->fts_pathlen);
1080
+	if (p == NULL) {
1081
+		free(sp->fts_path);
1082
+		sp->fts_path = NULL;
1083
+		return 1;
1084
+	}
1085
+	sp->fts_path = p;
1086
+	return 0;
1087
+}
1088
+
1089
+/*
1090
+ * When the path is realloc'd, have to fix all of the pointers in structures
1091
+ * already returned.
1092
+ */
1093
+static void
1094
+internal_function
1095
+fts_padjust (FTSOBJ *sp, FTSENTRY *head)
1096
+{
1097
+	FTSENTRY *p;
1098
+	char *addr = sp->fts_path;
1099
+
1100
+#define	ADJUST(p) do {							\
1101
+	if ((p)->fts_accpath != (p)->fts_name) {			\
1102
+		(p)->fts_accpath =					\
1103
+		    (char *)addr + ((p)->fts_accpath - (p)->fts_path);	\
1104
+	}								\
1105
+	(p)->fts_path = addr;						\
1106
+} while (0)
1107
+	/* Adjust the current set of children. */
1108
+	for (p = sp->fts_child; p; p = p->fts_link)
1109
+		ADJUST(p);
1110
+
1111
+	/* Adjust the rest of the tree, including the current level. */
1112
+	for (p = head; p->fts_level >= FTS_ROOTLEVEL;) {
1113
+		ADJUST(p);
1114
+		p = p->fts_link ? p->fts_link : p->fts_parent;
1115
+	}
1116
+}
1117
+
1118
+static size_t
1119
+internal_function
1120
+fts_maxarglen (char * const *argv)
1121
+{
1122
+	size_t len, max;
1123
+
1124
+	for (max = 0; *argv; ++argv)
1125
+		if ((len = strlen(*argv)) > max)
1126
+			max = len;
1127
+	return (max + 1);
1128
+}
1129
+
1130
+/*
1131
+ * Change to dir specified by fd or p->fts_accpath without getting
1132
+ * tricked by someone changing the world out from underneath us.
1133
+ * Assumes p->fts_dev and p->fts_ino are filled in.
1134
+ */
1135
+static int
1136
+internal_function
1137
+fts_safe_changedir (FTSOBJ *sp, FTSENTRY *p, int fd, const char *path)
1138
+{
1139
+	int ret, oerrno, newfd;
1140
+	struct stat sb;
1141
+
1142
+	newfd = fd;
1143
+	if (ISSET(FTS_NOCHDIR))
1144
+		return (0);
1145
+	if (fd < 0 && (newfd = open(path, O_RDONLY, 0)) < 0)
1146
+		return (-1);
1147
+	if (fstat(newfd, &sb)) {
1148
+		ret = -1;
1149
+		goto bail;
1150
+	}
1151
+	if (p->fts_dev != sb.st_dev || p->fts_ino != sb.st_ino) {
1152
+		__set_errno (ENOENT);		/* disinformation */
1153
+		ret = -1;
1154
+		goto bail;
1155
+	}
1156
+	ret = fchdir(newfd);
1157
+bail:
1158
+	oerrno = errno;
1159
+	if (fd < 0)
1160
+		(void)close(newfd);
1161
+	__set_errno (oerrno);
1162
+	return (ret);
1163
+}
1164
+#endif
0 1165
new file mode 100644
... ...
@@ -0,0 +1,221 @@
0
+#include "clamav-config.h"
1
+
2
+#if HAVE_SYSTEM_LFS_FTS
3
+#include <fts.h>
4
+
5
+static inline FTSENT *_priv_fts_children(FTS *ftsp, int options)
6
+{
7
+	return fts_children(ftsp, options);
8
+}
9
+
10
+static inline int _priv_fts_close(FTS *ftsp)
11
+{
12
+	return fts_close(ftsp);
13
+}
14
+
15
+static inline FTS *_priv_fts_open (char * const *path_argv, int options,
16
+		   int (*compar)(const FTSENT **, const FTSENT **))
17
+{
18
+	return fts_open(path_argv, options, compar);
19
+}
20
+
21
+static inline FTSENT *_priv_fts_read (FTS *ftsp)
22
+{
23
+	return fts_read(ftsp);
24
+}
25
+
26
+static inline int _priv_fts_set (FTS *ftsp, FTSENT *f, int options)
27
+{
28
+	return fts_set(ftsp, f, options);
29
+}
30
+
31
+#else
32
+/* File tree traversal functions declarations.
33
+   Copyright (C) 1994-2015 Free Software Foundation, Inc.
34
+   This file is part of the GNU C Library.
35
+
36
+   The GNU C Library is free software; you can redistribute it and/or
37
+   modify it under the terms of the GNU Lesser General Public
38
+   License as published by the Free Software Foundation; either
39
+   version 2.1 of the License, or (at your option) any later version.
40
+
41
+   The GNU C Library is distributed in the hope that it will be useful,
42
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
43
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
44
+   Lesser General Public License for more details.
45
+
46
+   You should have received a copy of the GNU Lesser General Public
47
+   License along with the GNU C Library; if not, see
48
+   <http://www.gnu.org/licenses/>.  */
49
+
50
+/*
51
+ * Copyright (c) 1989, 1993
52
+ *	The Regents of the University of California.  All rights reserved.
53
+ *
54
+ * Redistribution and use in source and binary forms, with or without
55
+ * modification, are permitted provided that the following conditions
56
+ * are met:
57
+ * 1. Redistributions of source code must retain the above copyright
58
+ *    notice, this list of conditions and the following disclaimer.
59
+ * 2. Redistributions in binary form must reproduce the above copyright
60
+ *    notice, this list of conditions and the following disclaimer in the
61
+ *    documentation and/or other materials provided with the distribution.
62
+ * 4. Neither the name of the University nor the names of its contributors
63
+ *    may be used to endorse or promote products derived from this software
64
+ *    without specific prior written permission.
65
+ *
66
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
67
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
68
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
69
+ * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
70
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
71
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
72
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
73
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
74
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
75
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
76
+ * SUCH DAMAGE.
77
+ *
78
+ *	@(#)fts.h	8.3 (Berkeley) 8/14/94
79
+ */
80
+
81
+#ifndef	_FTS_H
82
+#define	_FTS_H 1
83
+
84
+#include <sys/types.h>
85
+
86
+
87
+typedef struct {
88
+	struct _ftsent *fts_cur;	/* current node */
89
+	struct _ftsent *fts_child;	/* linked list of children */
90
+	struct _ftsent **fts_array;	/* sort array */
91
+	dev_t fts_dev;			/* starting device # */
92
+	char *fts_path;			/* path for this descent */
93
+	int fts_rfd;			/* fd for root */
94
+	int fts_pathlen;		/* sizeof(path) */
95
+	int fts_nitems;			/* elements in the sort array */
96
+	int (*fts_compar) (const void *, const void *); /* compare fn */
97
+
98
+#define	FTS_COMFOLLOW	0x0001		/* follow command line symlinks */
99
+#define	FTS_LOGICAL	0x0002		/* logical walk */
100
+#define	FTS_NOCHDIR	0x0004		/* don't change directories */
101
+#define	FTS_NOSTAT	0x0008		/* don't get stat info */
102
+#define	FTS_PHYSICAL	0x0010		/* physical walk */
103
+#define	FTS_SEEDOT	0x0020		/* return dot and dot-dot */
104
+#define	FTS_XDEV	0x0040		/* don't cross devices */
105
+#define FTS_WHITEOUT	0x0080		/* return whiteout information */
106
+#define	FTS_OPTIONMASK	0x00ff		/* valid user option mask */
107
+
108
+#define	FTS_NAMEONLY	0x0100		/* (private) child names only */
109
+#define	FTS_STOP	0x0200		/* (private) unrecoverable error */
110
+	int fts_options;		/* fts_open options, global flags */
111
+} FTS;
112
+
113
+#ifdef __USE_LARGEFILE64
114
+typedef struct {
115
+	struct _ftsent64 *fts_cur;	/* current node */
116
+	struct _ftsent64 *fts_child;	/* linked list of children */
117
+	struct _ftsent64 **fts_array;	/* sort array */
118
+	dev_t fts_dev;			/* starting device # */
119
+	char *fts_path;			/* path for this descent */
120
+	int fts_rfd;			/* fd for root */
121
+	int fts_pathlen;		/* sizeof(path) */
122
+	int fts_nitems;			/* elements in the sort array */
123
+	int (*fts_compar) (const void *, const void *); /* compare fn */
124
+	int fts_options;		/* fts_open options, global flags */
125
+} FTS64;
126
+#endif
127
+
128
+typedef struct _ftsent {
129
+	struct _ftsent *fts_cycle;	/* cycle node */
130
+	struct _ftsent *fts_parent;	/* parent directory */
131
+	struct _ftsent *fts_link;	/* next file in directory */
132
+	long fts_number;	        /* local numeric value */
133
+	void *fts_pointer;	        /* local address value */
134
+	char *fts_accpath;		/* access path */
135
+	char *fts_path;			/* root path */
136
+	int fts_errno;			/* errno for this node */
137
+	int fts_symfd;			/* fd for symlink */
138
+	u_short fts_pathlen;		/* strlen(fts_path) */
139
+	u_short fts_namelen;		/* strlen(fts_name) */
140
+
141
+	ino_t fts_ino;			/* inode */
142
+	dev_t fts_dev;			/* device */
143
+	nlink_t fts_nlink;		/* link count */
144
+
145
+#define	FTS_ROOTPARENTLEVEL	-1
146
+#define	FTS_ROOTLEVEL		 0
147
+	short fts_level;		/* depth (-1 to N) */
148
+
149
+#define	FTS_D		 1		/* preorder directory */
150
+#define	FTS_DC		 2		/* directory that causes cycles */
151
+#define	FTS_DEFAULT	 3		/* none of the above */
152
+#define	FTS_DNR		 4		/* unreadable directory */
153
+#define	FTS_DOT		 5		/* dot or dot-dot */
154
+#define	FTS_DP		 6		/* postorder directory */
155
+#define	FTS_ERR		 7		/* error; errno is set */
156
+#define	FTS_F		 8		/* regular file */
157
+#define	FTS_INIT	 9		/* initialized only */
158
+#define	FTS_NS		10		/* stat(2) failed */
159
+#define	FTS_NSOK	11		/* no stat(2) requested */
160
+#define	FTS_SL		12		/* symbolic link */
161
+#define	FTS_SLNONE	13		/* symbolic link without target */
162
+#define FTS_W		14		/* whiteout object */
163
+	u_short fts_info;		/* user flags for FTSENT structure */
164
+
165
+#define	FTS_DONTCHDIR	 0x01		/* don't chdir .. to the parent */
166
+#define	FTS_SYMFOLLOW	 0x02		/* followed a symlink to get here */
167
+	u_short fts_flags;		/* private flags for FTSENT structure */
168
+
169
+#define	FTS_AGAIN	 1		/* read node again */
170
+#define	FTS_FOLLOW	 2		/* follow symbolic link */
171
+#define	FTS_NOINSTR	 3		/* no instructions */
172
+#define	FTS_SKIP	 4		/* discard node */
173
+	u_short fts_instr;		/* fts_set() instructions */
174
+
175
+	struct stat *fts_statp;		/* stat(2) information */
176
+	char fts_name[1];		/* file name */
177
+} FTSENT;
178
+
179
+#ifdef __USE_LARGEFILE64
180
+typedef struct _ftsent64 {
181
+	struct _ftsent64 *fts_cycle;	/* cycle node */
182
+	struct _ftsent64 *fts_parent;	/* parent directory */
183
+	struct _ftsent64 *fts_link;	/* next file in directory */
184
+	long fts_number;	        /* local numeric value */
185
+	void *fts_pointer;	        /* local address value */
186
+	char *fts_accpath;		/* access path */
187
+	char *fts_path;			/* root path */
188
+	int fts_errno;			/* errno for this node */
189
+	int fts_symfd;			/* fd for symlink */
190
+	u_short fts_pathlen;		/* strlen(fts_path) */
191
+	u_short fts_namelen;		/* strlen(fts_name) */
192
+
193
+	ino64_t fts_ino;		/* inode */
194
+	dev_t fts_dev;			/* device */
195
+	nlink_t fts_nlink;		/* link count */
196
+
197
+	short fts_level;		/* depth (-1 to N) */
198
+
199
+	u_short fts_info;		/* user flags for FTSENT structure */
200
+
201
+	u_short fts_flags;		/* private flags for FTSENT structure */
202
+
203
+	u_short fts_instr;		/* fts_set() instructions */
204
+
205
+	struct stat64 *fts_statp;	/* stat(2) information */
206
+	char fts_name[1];		/* file name */
207
+} FTSENT64;
208
+#endif
209
+
210
+__BEGIN_DECLS
211
+FTSENT	*_priv_fts_children (FTS *, int);
212
+int	 _priv_fts_close (FTS *);
213
+FTS	*_priv_fts_open (char * const *, int,
214
+		   int (*)(const FTSENT **, const FTSENT **));
215
+FTSENT	*_priv_fts_read (FTS *);
216
+int	 _priv_fts_set (FTS *, FTSENT *, int) __THROW;
217
+__END_DECLS
218
+
219
+#endif /* fts.h */
220
+#endif
... ...
@@ -35,7 +35,7 @@
35 35
 #include "shared/output.h"
36 36
 
37 37
 #include "libclamav/others.h"
38
-#include "clamd/priv_fts.h"
38
+#include "../misc/priv_fts.h"
39 39
 #include "../misc/onaccess_others.h"
40 40
 #include "onaccess_scth.h"
41 41
 //#include "onaccess_others.h"
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -37,17 +37,7 @@
37 37
 #  MA 02110-1301, USA.
38 38
 
39 39
 VPATH = @srcdir@
40
-am__is_gnu_make = { \
41
-  if test -z '$(MAKELEVEL)'; then \
42
-    false; \
43
-  elif test -n '$(MAKE_HOST)'; then \
44
-    true; \
45
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
46
-    true; \
47
-  else \
48
-    false; \
49
-  fi; \
50
-}
40
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
51 41
 am__make_running_with_option = \
52 42
   case $${target_option-} in \
53 43
       ?) ;; \
... ...
@@ -113,6 +103,8 @@ host_triplet = @host@
113 113
 target_triplet = @target@
114 114
 bin_PROGRAMS = clamscan$(EXEEXT)
115 115
 subdir = clamscan
116
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
117
+	$(top_srcdir)/config/depcomp
116 118
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
117 119
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
118 120
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -191,7 +183,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
191 191
 	$(top_srcdir)/configure.ac
192 192
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
193 193
 	$(ACLOCAL_M4)
194
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
195 194
 mkinstalldirs = $(install_sh) -d
196 195
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
197 196
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -268,7 +259,6 @@ am__define_uniq_tagged_files = \
268 268
   done | $(am__uniquify_input)`
269 269
 ETAGS = etags
270 270
 CTAGS = ctags
271
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
272 271
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
273 272
 ACLOCAL = @ACLOCAL@
274 273
 AMTAR = @AMTAR@
... ...
@@ -504,7 +494,6 @@ pdfdir = @pdfdir@
504 504
 prefix = @prefix@
505 505
 program_transform_name = @program_transform_name@
506 506
 psdir = @psdir@
507
-runstatedir = @runstatedir@
508 507
 sbindir = @sbindir@
509 508
 sharedstatedir = @sharedstatedir@
510 509
 srcdir = @srcdir@
... ...
@@ -555,6 +544,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
555 555
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamscan/Makefile'; \
556 556
 	$(am__cd) $(top_srcdir) && \
557 557
 	  $(AUTOMAKE) --foreign clamscan/Makefile
558
+.PRECIOUS: Makefile
558 559
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
559 560
 	@case '$?' in \
560 561
 	  *config.status*) \
... ...
@@ -960,8 +950,6 @@ uninstall-am: uninstall-binPROGRAMS
960 960
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
961 961
 	uninstall-am uninstall-binPROGRAMS
962 962
 
963
-.PRECIOUS: Makefile
964
-
965 963
 
966 964
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
967 965
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -33,17 +33,7 @@
33 33
 #  MA 02110-1301, USA.
34 34
 
35 35
 VPATH = @srcdir@
36
-am__is_gnu_make = { \
37
-  if test -z '$(MAKELEVEL)'; then \
38
-    false; \
39
-  elif test -n '$(MAKE_HOST)'; then \
40
-    true; \
41
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
42
-    true; \
43
-  else \
44
-    false; \
45
-  fi; \
46
-}
36
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
47 37
 am__make_running_with_option = \
48 38
   case $${target_option-} in \
49 39
       ?) ;; \
... ...
@@ -121,6 +111,8 @@ bin_PROGRAMS = clamsubmit$(EXEEXT)
121 121
 @LINUX_TRUE@        $(top_srcdir)/shared/cert_util.h
122 122
 
123 123
 subdir = clamsubmit
124
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
125
+	$(top_srcdir)/config/depcomp
124 126
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
125 127
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
126 128
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -199,7 +191,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
199 199
 	$(top_srcdir)/configure.ac
200 200
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
201 201
 	$(ACLOCAL_M4)
202
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
203 202
 mkinstalldirs = $(install_sh) -d
204 203
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
205 204
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -308,7 +299,6 @@ am__define_uniq_tagged_files = \
308 308
   done | $(am__uniquify_input)`
309 309
 ETAGS = etags
310 310
 CTAGS = ctags
311
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
312 311
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
313 312
 ACLOCAL = @ACLOCAL@
314 313
 AMTAR = @AMTAR@
... ...
@@ -544,7 +534,6 @@ pdfdir = @pdfdir@
544 544
 prefix = @prefix@
545 545
 program_transform_name = @program_transform_name@
546 546
 psdir = @psdir@
547
-runstatedir = @runstatedir@
548 547
 sbindir = @sbindir@
549 548
 sharedstatedir = @sharedstatedir@
550 549
 srcdir = @srcdir@
... ...
@@ -589,6 +578,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
589 589
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign clamsubmit/Makefile'; \
590 590
 	$(am__cd) $(top_srcdir) && \
591 591
 	  $(AUTOMAKE) --foreign clamsubmit/Makefile
592
+.PRECIOUS: Makefile
592 593
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
593 594
 	@case '$?' in \
594 595
 	  *config.status*) \
... ...
@@ -1059,8 +1049,6 @@ uninstall-am: uninstall-binPROGRAMS
1059 1059
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
1060 1060
 	uninstall-am uninstall-binPROGRAMS
1061 1061
 
1062
-.PRECIOUS: Makefile
1063
-
1064 1062
 
1065 1063
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1066 1064
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -916,7 +916,6 @@ infodir
916 916
 docdir
917 917
 oldincludedir
918 918
 includedir
919
-runstatedir
920 919
 localstatedir
921 920
 sharedstatedir
922 921
 sysconfdir
... ...
@@ -1074,7 +1073,6 @@ datadir='${datarootdir}'
1074 1074
 sysconfdir='${prefix}/etc'
1075 1075
 sharedstatedir='${prefix}/com'
1076 1076
 localstatedir='${prefix}/var'
1077
-runstatedir='${localstatedir}/run'
1078 1077
 includedir='${prefix}/include'
1079 1078
 oldincludedir='/usr/include'
1080 1079
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
... ...
@@ -1327,15 +1325,6 @@ do
1327 1327
   | -silent | --silent | --silen | --sile | --sil)
1328 1328
     silent=yes ;;
1329 1329
 
1330
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
1331
-  | --runstate | --runstat | --runsta | --runst | --runs \
1332
-  | --run | --ru | --r)
1333
-    ac_prev=runstatedir ;;
1334
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1335
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1336
-  | --run=* | --ru=* | --r=*)
1337
-    runstatedir=$ac_optarg ;;
1338
-
1339 1330
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1340 1331
     ac_prev=sbindir ;;
1341 1332
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
... ...
@@ -1473,7 +1462,7 @@ fi
1473 1473
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1474 1474
 		datadir sysconfdir sharedstatedir localstatedir includedir \
1475 1475
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1476
-		libdir localedir mandir runstatedir
1476
+		libdir localedir mandir
1477 1477
 do
1478 1478
   eval ac_val=\$$ac_var
1479 1479
   # Remove trailing slashes.
... ...
@@ -1626,7 +1615,6 @@ Fine tuning of the installation directories:
1626 1626
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1627 1627
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1628 1628
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1629
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
1630 1629
   --libdir=DIR            object code libraries [EPREFIX/lib]
1631 1630
   --includedir=DIR        C header files [PREFIX/include]
1632 1631
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
... ...
@@ -3755,7 +3743,7 @@ done
3755 3755
 
3756 3756
 
3757 3757
 
3758
-am__api_version='1.15'
3758
+am__api_version='1.14'
3759 3759
 
3760 3760
 # Find a good install program.  We prefer a C program (faster),
3761 3761
 # so one script is as good as another.  But avoid the broken or
... ...
@@ -3927,8 +3915,8 @@ test "$program_suffix" != NONE &&
3927 3927
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
3928 3928
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
3929 3929
 
3930
-# Expand $ac_aux_dir to an absolute path.
3931
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
3930
+# expand $ac_aux_dir to an absolute path
3931
+am_aux_dir=`cd $ac_aux_dir && pwd`
3932 3932
 
3933 3933
 if test x"${MISSING+set}" != xset; then
3934 3934
   case $am_aux_dir in
... ...
@@ -3947,7 +3935,7 @@ else
3947 3947
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
3948 3948
 fi
3949 3949
 
3950
-if test x"${install_sh+set}" != xset; then
3950
+if test x"${install_sh}" != xset; then
3951 3951
   case $am_aux_dir in
3952 3952
   *\ * | *\	*)
3953 3953
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
... ...
@@ -4329,8 +4317,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
4329 4329
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
4330 4330
 mkdir_p='$(MKDIR_P)'
4331 4331
 
4332
-# We need awk for the "check" target (and possibly the TAP driver).  The
4333
-# system "awk" is bad on some platforms.
4332
+# We need awk for the "check" target.  The system "awk" is bad on
4333
+# some platforms.
4334 4334
 # Always define AMTAR for backward compatibility.  Yes, it's still used
4335 4335
 # in the wild :-(  We should find a proper way to deprecate it ...
4336 4336
 AMTAR='$${TAR-tar}'
... ...
@@ -4631,7 +4619,6 @@ END
4631 4631
     as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
4632 4632
   fi
4633 4633
 fi
4634
-
4635 4634
 # Check whether --enable-silent-rules was given.
4636 4635
 if test "${enable_silent_rules+set}" = set; then :
4637 4636
   enableval=$enable_silent_rules;
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  along with this program; if not, write to the Free Software
36 36
 #  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -110,6 +100,7 @@ build_triplet = @build@
110 110
 host_triplet = @host@
111 111
 target_triplet = @target@
112 112
 subdir = database
113
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
113 114
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
114 115
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
115 116
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -188,7 +179,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
188 188
 	$(top_srcdir)/configure.ac
189 189
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
190 190
 	$(ACLOCAL_M4)
191
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
192 191
 mkinstalldirs = $(install_sh) -d
193 192
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
194 193
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -214,7 +204,6 @@ am__can_run_installinfo = \
214 214
     *) (install-info --version) >/dev/null 2>&1;; \
215 215
   esac
216 216
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
217
-am__DIST_COMMON = $(srcdir)/Makefile.in
218 217
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
219 218
 ACLOCAL = @ACLOCAL@
220 219
 AMTAR = @AMTAR@
... ...
@@ -450,7 +439,6 @@ pdfdir = @pdfdir@
450 450
 prefix = @prefix@
451 451
 program_transform_name = @program_transform_name@
452 452
 psdir = @psdir@
453
-runstatedir = @runstatedir@
454 453
 sbindir = @sbindir@
455 454
 sharedstatedir = @sharedstatedir@
456 455
 srcdir = @srcdir@
... ...
@@ -483,6 +471,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
483 483
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign database/Makefile'; \
484 484
 	$(am__cd) $(top_srcdir) && \
485 485
 	  $(AUTOMAKE) --foreign database/Makefile
486
+.PRECIOUS: Makefile
486 487
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
487 488
 	@case '$?' in \
488 489
 	  *config.status*) \
... ...
@@ -658,8 +647,6 @@ uninstall-am:
658 658
 	mostlyclean-libtool pdf pdf-am ps ps-am tags-am uninstall \
659 659
 	uninstall-am
660 660
 
661
-.PRECIOUS: Makefile
662
-
663 661
 
664 662
 install-data-local:
665 663
 	@test -s $(srcdir)/main.cvd -a -s $(srcdir)/daily.cvd || exit 0;\
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -34,17 +34,7 @@
34 34
 #  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
35 35
 #  MA 02110-1301, USA.
36 36
 VPATH = @srcdir@
37
-am__is_gnu_make = { \
38
-  if test -z '$(MAKELEVEL)'; then \
39
-    false; \
40
-  elif test -n '$(MAKE_HOST)'; then \
41
-    true; \
42
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
43
-    true; \
44
-  else \
45
-    false; \
46
-  fi; \
47
-}
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
48 38
 am__make_running_with_option = \
49 39
   case $${target_option-} in \
50 40
       ?) ;; \
... ...
@@ -110,6 +100,7 @@ host_triplet = @host@
110 110
 target_triplet = @target@
111 111
 @ENABLE_CLAMSUBMIT_TRUE@am__append_1 = man/clamsubmit.1
112 112
 subdir = docs
113
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
113 114
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
114 115
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
115 116
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -188,7 +179,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
188 188
 	$(top_srcdir)/configure.ac
189 189
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
190 190
 	$(ACLOCAL_M4)
191
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
192 191
 mkinstalldirs = $(install_sh) -d
193 192
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
194 193
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -248,7 +238,6 @@ man8dir = $(mandir)/man8
248 248
 NROFF = nroff
249 249
 MANS = $(man_MANS)
250 250
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
251
-am__DIST_COMMON = $(srcdir)/Makefile.in
252 251
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
253 252
 ACLOCAL = @ACLOCAL@
254 253
 AMTAR = @AMTAR@
... ...
@@ -484,7 +473,6 @@ pdfdir = @pdfdir@
484 484
 prefix = @prefix@
485 485
 program_transform_name = @program_transform_name@
486 486
 psdir = @psdir@
487
-runstatedir = @runstatedir@
488 487
 sbindir = @sbindir@
489 488
 sharedstatedir = @sharedstatedir@
490 489
 srcdir = @srcdir@
... ...
@@ -520,6 +508,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
520 520
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign docs/Makefile'; \
521 521
 	$(am__cd) $(top_srcdir) && \
522 522
 	  $(AUTOMAKE) --foreign docs/Makefile
523
+.PRECIOUS: Makefile
523 524
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
524 525
 	@case '$?' in \
525 526
 	  *config.status*) \
... ...
@@ -830,8 +819,6 @@ uninstall-man: uninstall-man1 uninstall-man5 uninstall-man8
830 830
 	uninstall-am uninstall-man uninstall-man1 uninstall-man5 \
831 831
 	uninstall-man8
832 832
 
833
-.PRECIOUS: Makefile
834
-
835 833
 
836 834
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
837 835
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -111,6 +101,7 @@ host_triplet = @host@
111 111
 target_triplet = @target@
112 112
 @BUILD_CLAMD_TRUE@@HAVE_MILTER_TRUE@am__append_1 = clamav-milter.conf.sample
113 113
 subdir = etc
114
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
114 115
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115 116
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
116 117
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -189,7 +180,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
189 189
 	$(top_srcdir)/configure.ac
190 190
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
191 191
 	$(ACLOCAL_M4)
192
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
193 192
 mkinstalldirs = $(install_sh) -d
194 193
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
195 194
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -244,7 +234,6 @@ am__uninstall_files_from_dir = { \
244 244
 am__installdirs = "$(DESTDIR)$(sysconfdir)"
245 245
 DATA = $(sysconf_DATA)
246 246
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
247
-am__DIST_COMMON = $(srcdir)/Makefile.in
248 247
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
249 248
 ACLOCAL = @ACLOCAL@
250 249
 AMTAR = @AMTAR@
... ...
@@ -480,7 +469,6 @@ pdfdir = @pdfdir@
480 480
 prefix = @prefix@
481 481
 program_transform_name = @program_transform_name@
482 482
 psdir = @psdir@
483
-runstatedir = @runstatedir@
484 483
 sbindir = @sbindir@
485 484
 sharedstatedir = @sharedstatedir@
486 485
 srcdir = @srcdir@
... ...
@@ -514,6 +502,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
514 514
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign etc/Makefile'; \
515 515
 	$(am__cd) $(top_srcdir) && \
516 516
 	  $(AUTOMAKE) --foreign etc/Makefile
517
+.PRECIOUS: Makefile
517 518
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
518 519
 	@case '$?' in \
519 520
 	  *config.status*) \
... ...
@@ -712,8 +701,6 @@ uninstall-am: uninstall-sysconfDATA
712 712
 	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
713 713
 	ps ps-am tags-am uninstall uninstall-am uninstall-sysconfDATA
714 714
 
715
-.PRECIOUS: Makefile
716
-
717 715
 
718 716
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
719 717
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -37,17 +37,7 @@
37 37
 
38 38
 
39 39
 VPATH = @srcdir@
40
-am__is_gnu_make = { \
41
-  if test -z '$(MAKELEVEL)'; then \
42
-    false; \
43
-  elif test -n '$(MAKE_HOST)'; then \
44
-    true; \
45
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
46
-    true; \
47
-  else \
48
-    false; \
49
-  fi; \
50
-}
40
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
51 41
 am__make_running_with_option = \
52 42
   case $${target_option-} in \
53 43
       ?) ;; \
... ...
@@ -113,6 +103,9 @@ host_triplet = @host@
113 113
 target_triplet = @target@
114 114
 bin_PROGRAMS = freshclam$(EXEEXT)
115 115
 subdir = freshclam
116
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
117
+	$(srcdir)/clamav-freshclam.service.in \
118
+	$(top_srcdir)/config/depcomp
116 119
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
117 120
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
118 121
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -191,7 +184,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
191 191
 	$(top_srcdir)/configure.ac
192 192
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
193 193
 	$(ACLOCAL_M4)
194
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
195 194
 mkinstalldirs = $(install_sh) -d
196 195
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
197 196
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -297,9 +289,6 @@ am__define_uniq_tagged_files = \
297 297
   done | $(am__uniquify_input)`
298 298
 ETAGS = etags
299 299
 CTAGS = ctags
300
-am__DIST_COMMON = $(srcdir)/Makefile.in \
301
-	$(srcdir)/clamav-freshclam.service.in \
302
-	$(top_srcdir)/config/depcomp
303 300
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
304 301
 ACLOCAL = @ACLOCAL@
305 302
 AMTAR = @AMTAR@
... ...
@@ -535,7 +524,6 @@ pdfdir = @pdfdir@
535 535
 prefix = @prefix@
536 536
 program_transform_name = @program_transform_name@
537 537
 psdir = @psdir@
538
-runstatedir = @runstatedir@
539 538
 sbindir = @sbindir@
540 539
 sharedstatedir = @sharedstatedir@
541 540
 srcdir = @srcdir@
... ...
@@ -588,6 +576,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
588 588
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign freshclam/Makefile'; \
589 589
 	$(am__cd) $(top_srcdir) && \
590 590
 	  $(AUTOMAKE) --foreign freshclam/Makefile
591
+.PRECIOUS: Makefile
591 592
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
592 593
 	@case '$?' in \
593 594
 	  *config.status*) \
... ...
@@ -1003,8 +992,6 @@ uninstall-am: uninstall-binPROGRAMS uninstall-systemdsystemunitDATA
1003 1003
 	tags tags-am uninstall uninstall-am uninstall-binPROGRAMS \
1004 1004
 	uninstall-systemdsystemunitDATA
1005 1005
 
1006
-.PRECIOUS: Makefile
1007
-
1008 1006
 
1009 1007
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1010 1008
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -36,17 +36,7 @@
36 36
 
37 37
 
38 38
 VPATH = @srcdir@
39
-am__is_gnu_make = { \
40
-  if test -z '$(MAKELEVEL)'; then \
41
-    false; \
42
-  elif test -n '$(MAKE_HOST)'; then \
43
-    true; \
44
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
45
-    true; \
46
-  else \
47
-    false; \
48
-  fi; \
49
-}
39
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
50 40
 am__make_running_with_option = \
51 41
   case $${target_option-} in \
52 42
       ?) ;; \
... ...
@@ -137,6 +127,10 @@ target_triplet = @target@
137 137
 @ENABLE_YARA_TRUE@	yara_clam.h
138 138
 
139 139
 subdir = libclamav
140
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
141
+	yara_grammar.h yara_grammar.c yara_lexer.c \
142
+	$(top_srcdir)/config/depcomp $(top_srcdir)/config/ylwrap \
143
+	$(include_HEADERS)
140 144
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
141 145
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
142 146
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -215,8 +209,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
215 215
 	$(top_srcdir)/configure.ac
216 216
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
217 217
 	$(ACLOCAL_M4)
218
-DIST_COMMON = $(srcdir)/Makefile.am $(include_HEADERS) \
219
-	$(am__DIST_COMMON)
220 218
 mkinstalldirs = $(install_sh) -d
221 219
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
222 220
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -841,9 +833,6 @@ am__define_uniq_tagged_files = \
841 841
 ETAGS = etags
842 842
 CTAGS = ctags
843 843
 DIST_SUBDIRS = c++
844
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
845
-	$(top_srcdir)/config/ylwrap yara_grammar.c yara_grammar.h \
846
-	yara_lexer.c
847 844
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
848 845
 am__relativize = \
849 846
   dir0=`pwd`; \
... ...
@@ -1104,7 +1093,6 @@ pdfdir = @pdfdir@
1104 1104
 prefix = @prefix@
1105 1105
 program_transform_name = @program_transform_name@
1106 1106
 psdir = @psdir@
1107
-runstatedir = @runstatedir@
1108 1107
 sbindir = @sbindir@
1109 1108
 sharedstatedir = @sharedstatedir@
1110 1109
 srcdir = @srcdir@
... ...
@@ -1466,6 +1454,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
1466 1466
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libclamav/Makefile'; \
1467 1467
 	$(am__cd) $(top_srcdir) && \
1468 1468
 	  $(AUTOMAKE) --foreign libclamav/Makefile
1469
+.PRECIOUS: Makefile
1469 1470
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1470 1471
 	@case '$?' in \
1471 1472
 	  *config.status*) \
... ...
@@ -4591,8 +4580,6 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
4591 4591
 	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
4592 4592
 	uninstall-libLTLIBRARIES
4593 4593
 
4594
-.PRECIOUS: Makefile
4595
-
4596 4594
 @ENABLE_LLVM_FALSE@c++/Makefile: c++/Makefile.nollvm.in
4597 4595
 @ENABLE_LLVM_FALSE@	$(AM_V_at) cp $< $@
4598 4596
 @ENABLE_LLVM_FALSE@distclean-recursive distdir maintainer-clean-recursive: c++/Makefile
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -31,17 +31,7 @@
31 31
 
32 32
 
33 33
 VPATH = @srcdir@
34
-am__is_gnu_make = { \
35
-  if test -z '$(MAKELEVEL)'; then \
36
-    false; \
37
-  elif test -n '$(MAKE_HOST)'; then \
38
-    true; \
39
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
40
-    true; \
41
-  else \
42
-    false; \
43
-  fi; \
44
-}
34
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
45 35
 am__make_running_with_option = \
46 36
   case $${target_option-} in \
47 37
       ?) ;; \
... ...
@@ -117,6 +107,16 @@ target_triplet = @target@
117 117
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@am__append_9 = $(TBLGENFILES)
118 118
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@noinst_PROGRAMS = tblgen$(EXEEXT)
119 119
 subdir = .
120
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
121
+	$(top_srcdir)/configure $(am__configure_deps) \
122
+	$(srcdir)/clamavcxx-config.h.in $(top_srcdir)/config/depcomp \
123
+	config/compile config/config.guess config/config.sub \
124
+	config/depcomp config/install-sh config/missing \
125
+	config/ltmain.sh $(top_srcdir)/config/compile \
126
+	$(top_srcdir)/config/config.guess \
127
+	$(top_srcdir)/config/config.sub \
128
+	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
129
+	$(top_srcdir)/config/missing
120 130
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
121 131
 am__aclocal_m4_deps = $(top_srcdir)/m4/check_gnu_make.m4 \
122 132
 	$(top_srcdir)/m4/cxx_flag_check.m4 $(top_srcdir)/m4/libtool.m4 \
... ...
@@ -126,8 +126,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/check_gnu_make.m4 \
126 126
 	$(top_srcdir)/m4/llvm-opts.m4 $(top_srcdir)/configure.ac
127 127
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
128 128
 	$(ACLOCAL_M4)
129
-DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
130
-	$(am__configure_deps) $(am__DIST_COMMON)
131 129
 am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
132 130
  configure.lineno config.status.lineno
133 131
 mkinstalldirs = $(install_sh) -d
... ...
@@ -904,14 +902,6 @@ ETAGS = etags
904 904
 CTAGS = ctags
905 905
 CSCOPE = cscope
906 906
 AM_RECURSIVE_TARGETS = cscope
907
-am__DIST_COMMON = $(srcdir)/Makefile.in \
908
-	$(srcdir)/clamavcxx-config.h.in $(top_srcdir)/config/compile \
909
-	$(top_srcdir)/config/config.guess \
910
-	$(top_srcdir)/config/config.sub $(top_srcdir)/config/depcomp \
911
-	$(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
912
-	$(top_srcdir)/config/missing config/compile \
913
-	config/config.guess config/config.sub config/depcomp \
914
-	config/install-sh config/ltmain.sh config/missing
915 907
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
916 908
 distdir = $(PACKAGE)-$(VERSION)
917 909
 top_distdir = $(distdir)
... ...
@@ -1054,7 +1044,6 @@ pdfdir = @pdfdir@
1054 1054
 prefix = @prefix@
1055 1055
 program_transform_name = @program_transform_name@
1056 1056
 psdir = @psdir@
1057
-runstatedir = @runstatedir@
1058 1057
 sbindir = @sbindir@
1059 1058
 sharedstatedir = @sharedstatedir@
1060 1059
 srcdir = @srcdir@
... ...
@@ -1566,6 +1555,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
1566 1566
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
1567 1567
 	$(am__cd) $(top_srcdir) && \
1568 1568
 	  $(AUTOMAKE) --foreign Makefile
1569
+.PRECIOUS: Makefile
1569 1570
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
1570 1571
 	@case '$?' in \
1571 1572
 	  *config.status*) \
... ...
@@ -5605,7 +5595,7 @@ distdir: $(DISTFILES)
5605 5605
 	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
5606 5606
 	|| chmod -R a+r "$(distdir)"
5607 5607
 dist-gzip: distdir
5608
-	tardir=$(distdir) && $(am__tar) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).tar.gz
5608
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
5609 5609
 	$(am__post_remove_distdir)
5610 5610
 
5611 5611
 dist-bzip2: distdir
... ...
@@ -5621,17 +5611,17 @@ dist-xz: distdir
5621 5621
 	$(am__post_remove_distdir)
5622 5622
 
5623 5623
 dist-tarZ: distdir
5624
-	@echo WARNING: "Support for distribution archives compressed with" \
5625
-		       "legacy program 'compress' is deprecated." >&2
5624
+	@echo WARNING: "Support for shar distribution archives is" \
5625
+	               "deprecated." >&2
5626 5626
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
5627 5627
 	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
5628 5628
 	$(am__post_remove_distdir)
5629 5629
 
5630 5630
 dist-shar: distdir
5631
-	@echo WARNING: "Support for shar distribution archives is" \
5632
-	               "deprecated." >&2
5631
+	@echo WARNING: "Support for distribution archives compressed with" \
5632
+		       "legacy program 'compress' is deprecated." >&2
5633 5633
 	@echo WARNING: "It will be removed altogether in Automake 2.0" >&2
5634
-	shar $(distdir) | eval GZIP= gzip $(GZIP_ENV) -c >$(distdir).shar.gz
5634
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
5635 5635
 	$(am__post_remove_distdir)
5636 5636
 
5637 5637
 dist-zip: distdir
... ...
@@ -5649,7 +5639,7 @@ dist dist-all:
5649 5649
 distcheck: dist
5650 5650
 	case '$(DIST_ARCHIVES)' in \
5651 5651
 	*.tar.gz*) \
5652
-	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).tar.gz | $(am__untar) ;;\
5652
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
5653 5653
 	*.tar.bz2*) \
5654 5654
 	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
5655 5655
 	*.tar.lz*) \
... ...
@@ -5659,23 +5649,23 @@ distcheck: dist
5659 5659
 	*.tar.Z*) \
5660 5660
 	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
5661 5661
 	*.shar.gz*) \
5662
-	  eval GZIP= gzip $(GZIP_ENV) -dc $(distdir).shar.gz | unshar ;;\
5662
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
5663 5663
 	*.zip*) \
5664 5664
 	  unzip $(distdir).zip ;;\
5665 5665
 	esac
5666 5666
 	chmod -R a-w $(distdir)
5667 5667
 	chmod u+w $(distdir)
5668
-	mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
5668
+	mkdir $(distdir)/_build $(distdir)/_inst
5669 5669
 	chmod a-w $(distdir)
5670 5670
 	test -d $(distdir)/_build || exit 0; \
5671 5671
 	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
5672 5672
 	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
5673 5673
 	  && am__cwd=`pwd` \
5674
-	  && $(am__cd) $(distdir)/_build/sub \
5675
-	  && ../../configure \
5674
+	  && $(am__cd) $(distdir)/_build \
5675
+	  && ../configure \
5676 5676
 	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
5677 5677
 	    $(DISTCHECK_CONFIGURE_FLAGS) \
5678
-	    --srcdir=../.. --prefix="$$dc_install_base" \
5678
+	    --srcdir=.. --prefix="$$dc_install_base" \
5679 5679
 	  && $(MAKE) $(AM_MAKEFLAGS) \
5680 5680
 	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
5681 5681
 	  && $(MAKE) $(AM_MAKEFLAGS) check \
... ...
@@ -5861,8 +5851,6 @@ uninstall-am:
5861 5861
 	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
5862 5862
 	pdf pdf-am ps ps-am tags tags-am uninstall uninstall-am
5863 5863
 
5864
-.PRECIOUS: Makefile
5865
-
5866 5864
 
5867 5865
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@llvm/include/llvm/Intrinsics.gen: llvm/include/llvm/Intrinsics.td $(TBLGEN)
5868 5866
 @BUILD_EXTERNAL_LLVM_FALSE@@MAINTAINER_MODE_TRUE@	$(TBLGEN_V) $(TBLGEN_FLAGS) -gen-intrinsic -o $@ $<
... ...
@@ -1,6 +1,6 @@
1
-# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
1
+# generated automatically by aclocal 1.14.1 -*- Autoconf -*-
2 2
 
3
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
3
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
4 4
 
5 5
 # This file is free software; the Free Software Foundation
6 6
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -20,7 +20,7 @@ You have another version of autoconf.  It may work, but is not guaranteed to.
20 20
 If you have problems, you may need to regenerate the build system entirely.
21 21
 To do so, use the procedure documented by the package, typically 'autoreconf'.])])
22 22
 
23
-# Copyright (C) 2002-2017 Free Software Foundation, Inc.
23
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
24 24
 #
25 25
 # This file is free software; the Free Software Foundation
26 26
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -32,10 +32,10 @@ To do so, use the procedure documented by the package, typically 'autoreconf'.])
32 32
 # generated from the m4 files accompanying Automake X.Y.
33 33
 # (This private macro should not be called outside this file.)
34 34
 AC_DEFUN([AM_AUTOMAKE_VERSION],
35
-[am__api_version='1.15'
35
+[am__api_version='1.14'
36 36
 dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
37 37
 dnl require some minimum version.  Point them to the right macro.
38
-m4_if([$1], [1.15.1], [],
38
+m4_if([$1], [1.14.1], [],
39 39
       [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
40 40
 ])
41 41
 
... ...
@@ -51,14 +51,14 @@ m4_define([_AM_AUTOCONF_VERSION], [])
51 51
 # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
52 52
 # This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
53 53
 AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
54
-[AM_AUTOMAKE_VERSION([1.15.1])dnl
54
+[AM_AUTOMAKE_VERSION([1.14.1])dnl
55 55
 m4_ifndef([AC_AUTOCONF_VERSION],
56 56
   [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
57 57
 _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
58 58
 
59 59
 # AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
60 60
 
61
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
61
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
62 62
 #
63 63
 # This file is free software; the Free Software Foundation
64 64
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -103,14 +103,15 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
103 103
 # configured tree to be moved without reconfiguration.
104 104
 
105 105
 AC_DEFUN([AM_AUX_DIR_EXPAND],
106
-[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
107
-# Expand $ac_aux_dir to an absolute path.
108
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
106
+[dnl Rely on autoconf to set up CDPATH properly.
107
+AC_PREREQ([2.50])dnl
108
+# expand $ac_aux_dir to an absolute path
109
+am_aux_dir=`cd $ac_aux_dir && pwd`
109 110
 ])
110 111
 
111 112
 # AM_CONDITIONAL                                            -*- Autoconf -*-
112 113
 
113
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
114
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
114 115
 #
115 116
 # This file is free software; the Free Software Foundation
116 117
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -141,7 +142,7 @@ AC_CONFIG_COMMANDS_PRE(
141 141
 Usually this means the macro was only invoked conditionally.]])
142 142
 fi])])
143 143
 
144
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
144
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
145 145
 #
146 146
 # This file is free software; the Free Software Foundation
147 147
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -332,7 +333,7 @@ _AM_SUBST_NOTMAKE([am__nodep])dnl
332 332
 
333 333
 # Generate code to set up dependency tracking.              -*- Autoconf -*-
334 334
 
335
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
335
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
336 336
 #
337 337
 # This file is free software; the Free Software Foundation
338 338
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -408,7 +409,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
408 408
 
409 409
 # Do all the work for Automake.                             -*- Autoconf -*-
410 410
 
411
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
411
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
412 412
 #
413 413
 # This file is free software; the Free Software Foundation
414 414
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -498,8 +499,8 @@ AC_REQUIRE([AC_PROG_MKDIR_P])dnl
498 498
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
499 499
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
500 500
 AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
501
-# We need awk for the "check" target (and possibly the TAP driver).  The
502
-# system "awk" is bad on some platforms.
501
+# We need awk for the "check" target.  The system "awk" is bad on
502
+# some platforms.
503 503
 AC_REQUIRE([AC_PROG_AWK])dnl
504 504
 AC_REQUIRE([AC_PROG_MAKE_SET])dnl
505 505
 AC_REQUIRE([AM_SET_LEADING_DOT])dnl
... ...
@@ -572,11 +573,7 @@ to "yes", and re-run configure.
572 572
 END
573 573
     AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
574 574
   fi
575
-fi
576
-dnl The trailing newline in this macro's definition is deliberate, for
577
-dnl backward compatibility and to allow trailing 'dnl'-style comments
578
-dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
579
-])
575
+fi])
580 576
 
581 577
 dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
582 578
 dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
... ...
@@ -605,7 +602,7 @@ for _am_header in $config_headers :; do
605 605
 done
606 606
 echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
607 607
 
608
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
608
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
609 609
 #
610 610
 # This file is free software; the Free Software Foundation
611 611
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -616,7 +613,7 @@ echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_co
616 616
 # Define $install_sh.
617 617
 AC_DEFUN([AM_PROG_INSTALL_SH],
618 618
 [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
619
-if test x"${install_sh+set}" != xset; then
619
+if test x"${install_sh}" != xset; then
620 620
   case $am_aux_dir in
621 621
   *\ * | *\	*)
622 622
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
... ...
@@ -626,7 +623,7 @@ if test x"${install_sh+set}" != xset; then
626 626
 fi
627 627
 AC_SUBST([install_sh])])
628 628
 
629
-# Copyright (C) 2003-2017 Free Software Foundation, Inc.
629
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
630 630
 #
631 631
 # This file is free software; the Free Software Foundation
632 632
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -648,7 +645,7 @@ AC_SUBST([am__leading_dot])])
648 648
 # Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
649 649
 # From Jim Meyering
650 650
 
651
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
651
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
652 652
 #
653 653
 # This file is free software; the Free Software Foundation
654 654
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -683,7 +680,7 @@ AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
683 683
 
684 684
 # Check to see how 'make' treats includes.	            -*- Autoconf -*-
685 685
 
686
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
686
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
687 687
 #
688 688
 # This file is free software; the Free Software Foundation
689 689
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -733,7 +730,7 @@ rm -f confinc confmf
733 733
 
734 734
 # Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
735 735
 
736
-# Copyright (C) 1997-2017 Free Software Foundation, Inc.
736
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
737 737
 #
738 738
 # This file is free software; the Free Software Foundation
739 739
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -772,7 +769,7 @@ fi
772 772
 
773 773
 # Helper functions for option handling.                     -*- Autoconf -*-
774 774
 
775
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
775
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
776 776
 #
777 777
 # This file is free software; the Free Software Foundation
778 778
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -801,7 +798,7 @@ AC_DEFUN([_AM_SET_OPTIONS],
801 801
 AC_DEFUN([_AM_IF_OPTION],
802 802
 [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
803 803
 
804
-# Copyright (C) 1999-2017 Free Software Foundation, Inc.
804
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
805 805
 #
806 806
 # This file is free software; the Free Software Foundation
807 807
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -848,7 +845,7 @@ AC_LANG_POP([C])])
848 848
 # For backward compatibility.
849 849
 AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
850 850
 
851
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
851
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
852 852
 #
853 853
 # This file is free software; the Free Software Foundation
854 854
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -867,7 +864,7 @@ AC_DEFUN([AM_RUN_LOG],
867 867
 
868 868
 # Check to make sure that the build environment is sane.    -*- Autoconf -*-
869 869
 
870
-# Copyright (C) 1996-2017 Free Software Foundation, Inc.
870
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
871 871
 #
872 872
 # This file is free software; the Free Software Foundation
873 873
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -948,7 +945,7 @@ AC_CONFIG_COMMANDS_PRE(
948 948
 rm -f conftest.file
949 949
 ])
950 950
 
951
-# Copyright (C) 2009-2017 Free Software Foundation, Inc.
951
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
952 952
 #
953 953
 # This file is free software; the Free Software Foundation
954 954
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1008,7 +1005,7 @@ AC_SUBST([AM_BACKSLASH])dnl
1008 1008
 _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
1009 1009
 ])
1010 1010
 
1011
-# Copyright (C) 2001-2017 Free Software Foundation, Inc.
1011
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
1012 1012
 #
1013 1013
 # This file is free software; the Free Software Foundation
1014 1014
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1036,7 +1033,7 @@ fi
1036 1036
 INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
1037 1037
 AC_SUBST([INSTALL_STRIP_PROGRAM])])
1038 1038
 
1039
-# Copyright (C) 2006-2017 Free Software Foundation, Inc.
1039
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
1040 1040
 #
1041 1041
 # This file is free software; the Free Software Foundation
1042 1042
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -1055,7 +1052,7 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
1055 1055
 
1056 1056
 # Check how to create a tarball.                            -*- Autoconf -*-
1057 1057
 
1058
-# Copyright (C) 2004-2017 Free Software Foundation, Inc.
1058
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
1059 1059
 #
1060 1060
 # This file is free software; the Free Software Foundation
1061 1061
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -765,7 +765,6 @@ infodir
765 765
 docdir
766 766
 oldincludedir
767 767
 includedir
768
-runstatedir
769 768
 localstatedir
770 769
 sharedstatedir
771 770
 sysconfdir
... ...
@@ -858,7 +857,6 @@ datadir='${datarootdir}'
858 858
 sysconfdir='${prefix}/etc'
859 859
 sharedstatedir='${prefix}/com'
860 860
 localstatedir='${prefix}/var'
861
-runstatedir='${localstatedir}/run'
862 861
 includedir='${prefix}/include'
863 862
 oldincludedir='/usr/include'
864 863
 docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
... ...
@@ -1111,15 +1109,6 @@ do
1111 1111
   | -silent | --silent | --silen | --sile | --sil)
1112 1112
     silent=yes ;;
1113 1113
 
1114
-  -runstatedir | --runstatedir | --runstatedi | --runstated \
1115
-  | --runstate | --runstat | --runsta | --runst | --runs \
1116
-  | --run | --ru | --r)
1117
-    ac_prev=runstatedir ;;
1118
-  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
1119
-  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
1120
-  | --run=* | --ru=* | --r=*)
1121
-    runstatedir=$ac_optarg ;;
1122
-
1123 1114
   -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
1124 1115
     ac_prev=sbindir ;;
1125 1116
   -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
... ...
@@ -1257,7 +1246,7 @@ fi
1257 1257
 for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
1258 1258
 		datadir sysconfdir sharedstatedir localstatedir includedir \
1259 1259
 		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
1260
-		libdir localedir mandir runstatedir
1260
+		libdir localedir mandir
1261 1261
 do
1262 1262
   eval ac_val=\$$ac_var
1263 1263
   # Remove trailing slashes.
... ...
@@ -1410,7 +1399,6 @@ Fine tuning of the installation directories:
1410 1410
   --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
1411 1411
   --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
1412 1412
   --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
1413
-  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
1414 1413
   --libdir=DIR            object code libraries [EPREFIX/lib]
1415 1414
   --includedir=DIR        C header files [PREFIX/include]
1416 1415
   --oldincludedir=DIR     C header files for non-gcc [/usr/include]
... ...
@@ -2502,7 +2490,7 @@ test -n "$target_alias" &&
2502 2502
   test "$program_prefix$program_suffix$program_transform_name" = \
2503 2503
     NONENONEs,x,x, &&
2504 2504
   program_prefix=${target_alias}-
2505
-am__api_version='1.15'
2505
+am__api_version='1.14'
2506 2506
 
2507 2507
 # Find a good install program.  We prefer a C program (faster),
2508 2508
 # so one script is as good as another.  But avoid the broken or
... ...
@@ -2674,8 +2662,8 @@ test "$program_suffix" != NONE &&
2674 2674
 ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
2675 2675
 program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
2676 2676
 
2677
-# Expand $ac_aux_dir to an absolute path.
2678
-am_aux_dir=`cd "$ac_aux_dir" && pwd`
2677
+# expand $ac_aux_dir to an absolute path
2678
+am_aux_dir=`cd $ac_aux_dir && pwd`
2679 2679
 
2680 2680
 if test x"${MISSING+set}" != xset; then
2681 2681
   case $am_aux_dir in
... ...
@@ -2694,7 +2682,7 @@ else
2694 2694
 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
2695 2695
 fi
2696 2696
 
2697
-if test x"${install_sh+set}" != xset; then
2697
+if test x"${install_sh}" != xset; then
2698 2698
   case $am_aux_dir in
2699 2699
   *\ * | *\	*)
2700 2700
     install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
... ...
@@ -3013,8 +3001,8 @@ MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
3013 3013
 # <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
3014 3014
 mkdir_p='$(MKDIR_P)'
3015 3015
 
3016
-# We need awk for the "check" target (and possibly the TAP driver).  The
3017
-# system "awk" is bad on some platforms.
3016
+# We need awk for the "check" target.  The system "awk" is bad on
3017
+# some platforms.
3018 3018
 # Always define AMTAR for backward compatibility.  Yes, it's still used
3019 3019
 # in the wild :-(  We should find a proper way to deprecate it ...
3020 3020
 AMTAR='$${TAR-tar}'
... ...
@@ -3156,7 +3144,6 @@ END
3156 3156
     as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
3157 3157
   fi
3158 3158
 fi
3159
-
3160 3159
 # Check whether --enable-silent-rules was given.
3161 3160
 if test "${enable_silent_rules+set}" = set; then :
3162 3161
   enableval=$enable_silent_rules;
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -34,17 +34,7 @@
34 34
 
35 35
 
36 36
 VPATH = @srcdir@
37
-am__is_gnu_make = { \
38
-  if test -z '$(MAKELEVEL)'; then \
39
-    false; \
40
-  elif test -n '$(MAKE_HOST)'; then \
41
-    true; \
42
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
43
-    true; \
44
-  else \
45
-    false; \
46
-  fi; \
47
-}
37
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
48 38
 am__make_running_with_option = \
49 39
   case $${target_option-} in \
50 40
       ?) ;; \
... ...
@@ -203,7 +193,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
203 203
 	$(top_srcdir)/configure.ac
204 204
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
205 205
 	$(ACLOCAL_M4)
206
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
207 206
 mkinstalldirs = $(install_sh) -d
208 207
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
209 208
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -345,7 +334,6 @@ am__define_uniq_tagged_files = \
345 345
   done | $(am__uniquify_input)`
346 346
 ETAGS = etags
347 347
 CTAGS = ctags
348
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
349 348
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
350 349
 ACLOCAL = @ACLOCAL@
351 350
 AMTAR = @AMTAR@
... ...
@@ -581,7 +569,6 @@ pdfdir = @pdfdir@
581 581
 prefix = @prefix@
582 582
 program_transform_name = @program_transform_name@
583 583
 psdir = @psdir@
584
-runstatedir = @runstatedir@
585 584
 sbindir = @sbindir@
586 585
 sharedstatedir = @sharedstatedir@
587 586
 srcdir = @srcdir@
... ...
@@ -637,6 +624,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
637 637
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libfreshclam/Makefile'; \
638 638
 	$(am__cd) $(top_srcdir) && \
639 639
 	  $(AUTOMAKE) --foreign libfreshclam/Makefile
640
+.PRECIOUS: Makefile
640 641
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
641 642
 	@case '$?' in \
642 643
 	  *config.status*) \
... ...
@@ -1061,8 +1049,6 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES
1061 1061
 	tags tags-am uninstall uninstall-am uninstall-includeHEADERS \
1062 1062
 	uninstall-libLTLIBRARIES
1063 1063
 
1064
-.PRECIOUS: Makefile
1065
-
1066 1064
 
1067 1065
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
1068 1066
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -18,17 +18,7 @@
18 18
 
19 19
 
20 20
 VPATH = @srcdir@
21
-am__is_gnu_make = { \
22
-  if test -z '$(MAKELEVEL)'; then \
23
-    false; \
24
-  elif test -n '$(MAKE_HOST)'; then \
25
-    true; \
26
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
27
-    true; \
28
-  else \
29
-    false; \
30
-  fi; \
31
-}
21
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
32 22
 am__make_running_with_option = \
33 23
   case $${target_option-} in \
34 24
       ?) ;; \
... ...
@@ -96,6 +86,9 @@ target_triplet = @target@
96 96
 @INSTALL_LTDL_TRUE@am__append_2 = libltdl.la
97 97
 @CONVENIENCE_LTDL_TRUE@am__append_3 = libltdlc.la
98 98
 subdir = libltdl
99
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
100
+	$(top_srcdir)/config/depcomp $(am__include_HEADERS_DIST) \
101
+	$(am__ltdlinclude_HEADERS_DIST) COPYING.LIB README
99 102
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
100 103
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
101 104
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -174,8 +167,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
174 174
 	$(top_srcdir)/configure.ac
175 175
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
176 176
 	$(ACLOCAL_M4)
177
-DIST_COMMON = $(srcdir)/Makefile.am $(am__include_HEADERS_DIST) \
178
-	$(am__ltdlinclude_HEADERS_DIST) $(am__DIST_COMMON)
179 177
 mkinstalldirs = $(install_sh) -d
180 178
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
181 179
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -342,8 +333,6 @@ am__define_uniq_tagged_files = \
342 342
   done | $(am__uniquify_input)`
343 343
 ETAGS = etags
344 344
 CTAGS = ctags
345
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
346
-	COPYING.LIB README
347 345
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
348 346
 ACLOCAL = @ACLOCAL@
349 347
 AMTAR = @AMTAR@
... ...
@@ -579,7 +568,6 @@ pdfdir = @pdfdir@
579 579
 prefix = @prefix@
580 580
 program_transform_name = @program_transform_name@
581 581
 psdir = @psdir@
582
-runstatedir = @runstatedir@
583 582
 sbindir = @sbindir@
584 583
 sharedstatedir = @sharedstatedir@
585 584
 srcdir = @srcdir@
... ...
@@ -678,6 +666,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
678 678
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign libltdl/Makefile'; \
679 679
 	$(am__cd) $(top_srcdir) && \
680 680
 	  $(AUTOMAKE) --foreign libltdl/Makefile
681
+.PRECIOUS: Makefile
681 682
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
682 683
 	@case '$?' in \
683 684
 	  *config.status*) \
... ...
@@ -1201,8 +1190,6 @@ uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1201 1201
 	uninstall-includeHEADERS uninstall-libLTLIBRARIES \
1202 1202
 	uninstall-ltdlincludeHEADERS
1203 1203
 
1204
-.PRECIOUS: Makefile
1205
-
1206 1204
 
1207 1205
 # We need the following in order to create an <argz.h> when the system
1208 1206
 # doesn't have one that works with the given compiler.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -35,17 +35,7 @@
35 35
 #  MA 02110-1301, USA.
36 36
 
37 37
 VPATH = @srcdir@
38
-am__is_gnu_make = { \
39
-  if test -z '$(MAKELEVEL)'; then \
40
-    false; \
41
-  elif test -n '$(MAKE_HOST)'; then \
42
-    true; \
43
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
44
-    true; \
45
-  else \
46
-    false; \
47
-  fi; \
48
-}
38
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
49 39
 am__make_running_with_option = \
50 40
   case $${target_option-} in \
51 41
       ?) ;; \
... ...
@@ -111,6 +101,8 @@ host_triplet = @host@
111 111
 target_triplet = @target@
112 112
 bin_PROGRAMS = sigtool$(EXEEXT)
113 113
 subdir = sigtool
114
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
115
+	$(top_srcdir)/config/depcomp
114 116
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
115 117
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
116 118
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -189,7 +181,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
189 189
 	$(top_srcdir)/configure.ac
190 190
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
191 191
 	$(ACLOCAL_M4)
192
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
193 192
 mkinstalldirs = $(install_sh) -d
194 193
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
195 194
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -266,7 +257,6 @@ am__define_uniq_tagged_files = \
266 266
   done | $(am__uniquify_input)`
267 267
 ETAGS = etags
268 268
 CTAGS = ctags
269
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp
270 269
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
271 270
 ACLOCAL = @ACLOCAL@
272 271
 AMTAR = @AMTAR@
... ...
@@ -502,7 +492,6 @@ pdfdir = @pdfdir@
502 502
 prefix = @prefix@
503 503
 program_transform_name = @program_transform_name@
504 504
 psdir = @psdir@
505
-runstatedir = @runstatedir@
506 505
 sbindir = @sbindir@
507 506
 sharedstatedir = @sharedstatedir@
508 507
 srcdir = @srcdir@
... ...
@@ -554,6 +543,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
554 554
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign sigtool/Makefile'; \
555 555
 	$(am__cd) $(top_srcdir) && \
556 556
 	  $(AUTOMAKE) --foreign sigtool/Makefile
557
+.PRECIOUS: Makefile
557 558
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
558 559
 	@case '$?' in \
559 560
 	  *config.status*) \
... ...
@@ -974,8 +964,6 @@ uninstall-am: uninstall-binPROGRAMS
974 974
 	mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
975 975
 	uninstall-am uninstall-binPROGRAMS
976 976
 
977
-.PRECIOUS: Makefile
978
-
979 977
 
980 978
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
981 979
 # Otherwise a system limit (for SysV at least) may be exceeded.
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -14,17 +14,7 @@
14 14
 
15 15
 @SET_MAKE@
16 16
 VPATH = @srcdir@
17
-am__is_gnu_make = { \
18
-  if test -z '$(MAKELEVEL)'; then \
19
-    false; \
20
-  elif test -n '$(MAKE_HOST)'; then \
21
-    true; \
22
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
23
-    true; \
24
-  else \
25
-    false; \
26
-  fi; \
27
-}
17
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
28 18
 am__make_running_with_option = \
29 19
   case $${target_option-} in \
30 20
       ?) ;; \
... ...
@@ -91,6 +81,7 @@ target_triplet = @target@
91 91
 @ENABLE_UNRAR_TRUE@am__append_1 = clam-v2.rar clam-v3.rar
92 92
 @HAVE_LIBBZ2_TRUE@am__append_2 = clam.exe.bz2 clam.bz2.zip
93 93
 subdir = test
94
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am README
94 95
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
95 96
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
96 97
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -169,7 +160,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
169 169
 	$(top_srcdir)/configure.ac
170 170
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
171 171
 	$(ACLOCAL_M4)
172
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
173 172
 mkinstalldirs = $(install_sh) -d
174 173
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
175 174
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -195,7 +185,6 @@ am__can_run_installinfo = \
195 195
     *) (install-info --version) >/dev/null 2>&1;; \
196 196
   esac
197 197
 am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
198
-am__DIST_COMMON = $(srcdir)/Makefile.in README
199 198
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
200 199
 ACLOCAL = @ACLOCAL@
201 200
 AMTAR = @AMTAR@
... ...
@@ -431,7 +420,6 @@ pdfdir = @pdfdir@
431 431
 prefix = @prefix@
432 432
 program_transform_name = @program_transform_name@
433 433
 psdir = @psdir@
434
-runstatedir = @runstatedir@
435 434
 sbindir = @sbindir@
436 435
 sharedstatedir = @sharedstatedir@
437 436
 srcdir = @srcdir@
... ...
@@ -478,6 +466,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
478 478
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign test/Makefile'; \
479 479
 	$(am__cd) $(top_srcdir) && \
480 480
 	  $(AUTOMAKE) --foreign test/Makefile
481
+.PRECIOUS: Makefile
481 482
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
482 483
 	@case '$?' in \
483 484
 	  *config.status*) \
... ...
@@ -652,8 +641,6 @@ uninstall-am:
652 652
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
653 653
 	tags-am uninstall uninstall-am
654 654
 
655
-.PRECIOUS: Makefile
656
-
657 655
 
658 656
 all: $(FILES)
659 657
 
... ...
@@ -1,7 +1,7 @@
1
-# Makefile.in generated by automake 1.15.1 from Makefile.am.
1
+# Makefile.in generated by automake 1.14.1 from Makefile.am.
2 2
 # @configure_input@
3 3
 
4
-# Copyright (C) 1994-2017 Free Software Foundation, Inc.
4
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
5 5
 
6 6
 # This Makefile.in is free software; the Free Software Foundation
7 7
 # gives unlimited permission to copy and/or distribute it,
... ...
@@ -14,17 +14,7 @@
14 14
 
15 15
 @SET_MAKE@
16 16
 VPATH = @srcdir@
17
-am__is_gnu_make = { \
18
-  if test -z '$(MAKELEVEL)'; then \
19
-    false; \
20
-  elif test -n '$(MAKE_HOST)'; then \
21
-    true; \
22
-  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
23
-    true; \
24
-  else \
25
-    false; \
26
-  fi; \
27
-}
17
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
28 18
 am__make_running_with_option = \
29 19
   case $${target_option-} in \
30 20
       ?) ;; \
... ...
@@ -92,6 +82,8 @@ target_triplet = @target@
92 92
 TESTS = $(am__EXEEXT_1) $(scripts)
93 93
 check_PROGRAMS = $(am__EXEEXT_1) check_clamd$(EXEEXT) $(am__EXEEXT_2)
94 94
 subdir = unit_tests
95
+DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
96
+	$(top_srcdir)/config/depcomp $(top_srcdir)/config/test-driver
95 97
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
96 98
 am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
97 99
 	$(top_srcdir)/m4/ax_check_uname_syscall.m4 \
... ...
@@ -170,7 +162,6 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \
170 170
 	$(top_srcdir)/configure.ac
171 171
 am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
172 172
 	$(ACLOCAL_M4)
173
-DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
174 173
 mkinstalldirs = $(install_sh) -d
175 174
 CONFIG_HEADER = $(top_builddir)/clamav-config.h \
176 175
 	$(top_builddir)/libclammspack/config.h
... ...
@@ -484,8 +475,6 @@ TEST_LOGS = $(am__test_logs2:.test.log=.log)
484 484
 TEST_LOG_DRIVER = $(SHELL) $(top_srcdir)/config/test-driver
485 485
 TEST_LOG_COMPILE = $(TEST_LOG_COMPILER) $(AM_TEST_LOG_FLAGS) \
486 486
 	$(TEST_LOG_FLAGS)
487
-am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/depcomp \
488
-	$(top_srcdir)/config/test-driver
489 487
 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
490 488
 ACLOCAL = @ACLOCAL@
491 489
 AMTAR = @AMTAR@
... ...
@@ -721,7 +710,6 @@ pdfdir = @pdfdir@
721 721
 prefix = @prefix@
722 722
 program_transform_name = @program_transform_name@
723 723
 psdir = @psdir@
724
-runstatedir = @runstatedir@
725 724
 sbindir = @sbindir@
726 725
 sharedstatedir = @sharedstatedir@
727 726
 srcdir = @srcdir@
... ...
@@ -789,6 +777,7 @@ $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__confi
789 789
 	echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign unit_tests/Makefile'; \
790 790
 	$(am__cd) $(top_srcdir) && \
791 791
 	  $(AUTOMAKE) --foreign unit_tests/Makefile
792
+.PRECIOUS: Makefile
792 793
 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
793 794
 	@case '$?' in \
794 795
 	  *config.status*) \
... ...
@@ -1139,7 +1128,7 @@ $(TEST_SUITE_LOG): $(TEST_LOGS)
1139 1139
 	if test -n "$$am__remaking_logs"; then \
1140 1140
 	  echo "fatal: making $(TEST_SUITE_LOG): possible infinite" \
1141 1141
 	       "recursion detected" >&2; \
1142
-	elif test -n "$$redo_logs"; then \
1142
+	else \
1143 1143
 	  am__remaking_logs=yes $(MAKE) $(AM_MAKEFLAGS) $$redo_logs; \
1144 1144
 	fi; \
1145 1145
 	if $(am__make_dryrun); then :; else \
... ...
@@ -1514,8 +1503,6 @@ uninstall-am:
1514 1514
 	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
1515 1515
 	recheck tags tags-am uninstall uninstall-am
1516 1516
 
1517
-.PRECIOUS: Makefile
1518
-
1519 1517
 
1520 1518
 check_unit_vg.sh: $(FILES)
1521 1519
 check2_clamd.sh: $(FILES)