+2020-03-28 Frank Ch. Eigler <fche@redhat.com>
+
+ * debuginfod.cxx (handle_buildid_r_match): During archive
+ extraction / fdcache prefetching, set the mtime of each
+ file in the cache.
+
2020-03-27 Frank Ch. Eigler <fche@redhat.com>
* debuginfod-find.c (main): Extract buildid from /binary/ if
throw archive_exception(a, "cannot extract file");
}
+ // Set the mtime so the fdcache file mtimes, even prefetched ones,
+ // propagate to future webapi clients.
+ struct timeval tvs[2];
+ tvs[0].tv_sec = tvs[1].tv_sec = archive_entry_mtime(e);
+ tvs[0].tv_usec = tvs[1].tv_usec = 0;
+ (void) futimes (fd, tvs); /* best effort */
+
if (r != 0) // stage 3
{
// NB: now we know we have a complete reusable file; make fdcache
+2020-03-28 Frank Ch. Eigler <fche@redhat.com>
+
+ * run-debuginfod-find.sh: Test timestamps of archive-origin files.
+
2020-03-27 Frank Ch. Eigler <fche@redhat.com>
* run-debuginfod-find.sh: Test /path/-based debuginfod-find.
buildid=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
-a $filename | grep 'Build ID' | cut -d ' ' -f 7`
test $__BUILDID = $buildid
+ # check that timestamps are plausible - older than the near-present (tmpdir mtime)
+ test $filename -ot `pwd`
# run again to assure that fdcache is being enjoyed
filename=`testrun ${abs_top_builddir}/debuginfod/debuginfod-find executable $__BUILDID`
buildid=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
-a $filename | grep 'Build ID' | cut -d ' ' -f 7`
test $__BUILDID = $buildid
+ test $filename -ot `pwd`
filename=`testrun ${abs_top_builddir}/debuginfod/debuginfod-find debuginfo $__BUILDID`
buildid=`env LD_LIBRARY_PATH=$ldpath ${abs_builddir}/../src/readelf \
-a $filename | grep 'Build ID' | cut -d ' ' -f 7`
test $__BUILDID = $buildid
+ test $filename -ot `pwd`
if test "x$__SOURCEPATH" != "x"; then
filename=`testrun ${abs_top_builddir}/debuginfod/debuginfod-find source $__BUILDID $__SOURCEPATH`
hash=`cat $filename | sha1sum | awk '{print $1}'`
test $__SOURCESHA1 = $hash
+ test $filename -ot `pwd`
fi
}