diff --git a/configure b/configure index fa4469cfb..8eb62a8ed 100755 --- a/configure +++ b/configure @@ -684,6 +684,7 @@ NROFFPROG MANDOCPROG TRPROG UNAMEPROG +SHA1SUM LT_SYS_LIBRARY_PATH OTOOL64 OTOOL @@ -16785,6 +16786,52 @@ fi NOEXECFILE="sudo_noexec.so" NOEXECDIR="`echo $noexec_file|sed -e 's:^${\([^}]*\)}:$(\1):' -e 's:^\(.*\)/[^/]*:\1:'`" +# Extract the first word of "sha1sum", so it can be a program name with args. +set dummy sha1sum; ac_word=$2 +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +printf %s "checking for $ac_word... " >&6; } +if test ${ac_cv_path_SHA1SUM+y} +then : + printf %s "(cached) " >&6 +else $as_nop + case $SHA1SUM in + [\\/]* | ?:[\\/]*) + ac_cv_path_SHA1SUM="$SHA1SUM" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + case $as_dir in #((( + '') as_dir=./ ;; + */) ;; + *) as_dir=$as_dir/ ;; + esac + for ac_exec_ext in '' $ac_executable_extensions; do + if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then + ac_cv_path_SHA1SUM="$as_dir$ac_word$ac_exec_ext" + printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + + test -z "$ac_cv_path_SHA1SUM" && ac_cv_path_SHA1SUM="openssl dgst -sha1" + ;; +esac +fi +SHA1SUM=$ac_cv_path_SHA1SUM +if test -n "$SHA1SUM"; then + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $SHA1SUM" >&5 +printf "%s\n" "$SHA1SUM" >&6; } +else + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 +printf "%s\n" "no" >&6; } +fi + + # Extract the first word of "uname", so it can be a program name with args. set dummy uname; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/configure.ac b/configure.ac index 4744b83fe..b56bd24b4 100644 --- a/configure.ac +++ b/configure.ac @@ -1714,6 +1714,7 @@ NOEXECDIR="`echo $noexec_file|sed -e 's:^${\([[^}]]*\)}:$(\1):' -e 's:^\(.*\)/[[ dnl dnl Find programs we use dnl +AC_PATH_PROG(SHA1SUM, [sha1sum], [openssl dgst -sha1]) AC_PATH_PROG(UNAMEPROG, [uname], [uname]) AC_PATH_PROG(TRPROG, [tr], [tr]) AC_PATH_PROG(MANDOCPROG, [mandoc], [mandoc]) diff --git a/lib/iolog/Makefile.in b/lib/iolog/Makefile.in index cf49a0899..f722ae1c7 100644 --- a/lib/iolog/Makefile.in +++ b/lib/iolog/Makefile.in @@ -34,6 +34,8 @@ cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ LIBTOOL = @LIBTOOL@ +SHA1SUM = @SHA1SUM@ +SED = @SED@ # Libraries LT_LIBS = $(top_builddir)/lib/eventlog/libsudo_eventlog.la \ @@ -188,7 +190,7 @@ fuzz_iolog_json_seed_corpus.zip: tdir=fuzz_iolog_json.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_IOLOG_JSON_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir @@ -214,7 +216,7 @@ fuzz_iolog_legacy_seed_corpus.zip: tdir=fuzz_iolog_legacy.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_IOLOG_LEGACY_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir @@ -240,7 +242,7 @@ fuzz_iolog_timing_seed_corpus.zip: tdir=fuzz_iolog_timing.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_IOLOG_TIMING_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir diff --git a/lib/util/Makefile.in b/lib/util/Makefile.in index 16dac03e2..5b6bee42a 100644 --- a/lib/util/Makefile.in +++ b/lib/util/Makefile.in @@ -54,6 +54,7 @@ HOSTCC = @CC_FOR_BUILD@ CPP = @CPP@ HOSTCPP = @CPP_FOR_BUILD@ LIBTOOL = @LIBTOOL@ +SHA1SUM = @SHA1SUM@ SED = @SED@ AWK = @AWK@ @@ -318,7 +319,7 @@ fuzz_sudo_conf_seed_corpus.zip: tdir=fuzz_sudo_conf.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_SUDO_CONF_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir diff --git a/logsrvd/Makefile.in b/logsrvd/Makefile.in index 171da3341..e9ac8cbd6 100644 --- a/logsrvd/Makefile.in +++ b/logsrvd/Makefile.in @@ -35,6 +35,7 @@ cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ LIBTOOL = @LIBTOOL@ +SHA1SUM = @SHA1SUM@ SED = @SED@ # Our install program supports extra flags... @@ -174,7 +175,7 @@ fuzz_logsrvd_conf_seed_corpus.zip: tdir=fuzz_logsrvd_conf.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_LOGSRVD_CONF_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir diff --git a/plugins/sudoers/Makefile.in b/plugins/sudoers/Makefile.in index 59eb7602b..046a5928c 100644 --- a/plugins/sudoers/Makefile.in +++ b/plugins/sudoers/Makefile.in @@ -44,6 +44,7 @@ cross_compiling = @CROSS_COMPILING@ # Compiler & tools to use CC = @CC@ LIBTOOL = @LIBTOOL@ +SHA1SUM = @SHA1SUM@ FLEX = @FLEX@ YACC = @YACC@ SED = @SED@ @@ -407,7 +408,7 @@ fuzz_policy_seed_corpus.zip: tdir=fuzz_policy.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_POLICY_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir @@ -433,7 +434,7 @@ fuzz_sudoers_seed_corpus.zip: tdir=fuzz_sudoers.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_SUDOERS_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir @@ -459,7 +460,7 @@ fuzz_sudoers_ldif_seed_corpus.zip: tdir=fuzz_sudoers_ldif.$$$$; \ mkdir $$tdir; \ for f in $(FUZZ_SUDOERS_LDIF_CORPUS); do \ - cp $$f $$tdir/`sha1sum $$f | cut -d' ' -f1`; \ + cp $$f $$tdir/`$(SHA1SUM) $$f | $(SED) -e 's/^.*= *//' -e 's/ .*//'`; \ done; \ zip -j $@ $$tdir/*; \ rm -rf $$tdir