diff -Nru systemtap-4.2/debian/changelog systemtap-4.2/debian/changelog --- systemtap-4.2/debian/changelog 2020-02-17 11:01:11.000000000 +0000 +++ systemtap-4.2/debian/changelog 2022-03-16 20:04:27.000000000 +0000 @@ -1,3 +1,11 @@ +systemtap (4.2-3ubuntu0.1) focal; urgency=medium + + * d/p/dtrace-predictable-tmp-file.patch: + Cherry-pick fix from upstream to avoid a race condition due to + use of a predictable temporary file name. (LP: #1962785). + + -- dann frazier Wed, 16 Mar 2022 14:04:27 -0600 + systemtap (4.2-3) unstable; urgency=medium * autopkgtest: do not assume architecture is amd64 diff -Nru systemtap-4.2/debian/control systemtap-4.2/debian/control --- systemtap-4.2/debian/control 2020-02-17 10:23:34.000000000 +0000 +++ systemtap-4.2/debian/control 2022-03-16 20:03:19.000000000 +0000 @@ -1,7 +1,8 @@ Source: systemtap Section: devel Priority: optional -Maintainer: Emanuele Rocca +Maintainer: Ubuntu Developers +XSBC-Original-Maintainer: Emanuele Rocca Uploaders: Timo Juhani Lindfors , Vincent Bernat , Ritesh Raj Sarraf diff -Nru systemtap-4.2/debian/patches/dtrace-predictable-tmp-file.patch systemtap-4.2/debian/patches/dtrace-predictable-tmp-file.patch --- systemtap-4.2/debian/patches/dtrace-predictable-tmp-file.patch 1970-01-01 00:00:00.000000000 +0000 +++ systemtap-4.2/debian/patches/dtrace-predictable-tmp-file.patch 2022-03-16 20:03:19.000000000 +0000 @@ -0,0 +1,39 @@ +Description: dtrace: Use hash-based scheme for predictable file generation +Origin: upstream, https://sourceware.org/git/?p=systemtap.git;a=commit;h=0de9020c970bceda73e32bbd169c12e7579f21ec +Author: dann frazier +Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=28923 +Bug-Debian: https://bugs.debian.org/1006703 +Bug-Ubuntu: https://launchpad.net/bugs/1962785 +Last-Updated: 2022-03-16 + +Index: systemtap/dtrace.in +=================================================================== +--- systemtap.orig/dtrace.in ++++ systemtap/dtrace.in +@@ -20,6 +20,7 @@ + # pylint: disable=R0201 + # pylint: disable=R0904 + ++import hashlib + import os + import sys + from shlex import split +@@ -410,12 +411,12 @@ def main(): + else: + print("header: " + fname) + +- try: # for reproducible-builds purposes, prefer a fixed path name pattern +- fname = filename + ".dtrace-temp.c" +- fdesc = open(fname, mode='w') +- except: # but that doesn't work for -o /dev/null - see rhbz1504009 +- (ignore,fname) = mkstemp(suffix=".c") +- fdesc = open(fname, mode='w') ++ # for reproducible-builds purposes, use a predictable tmpfile path ++ sha = hashlib.sha256() ++ sha.update(s_filename.encode('utf-8')) ++ sha.update(filename.encode('utf-8')) ++ fname = ".dtrace-temp." + sha.hexdigest()[:8] + ".c" ++ fdesc = open(fname, mode='w') + providers.semaphore_write(fdesc) + fdesc.close() + cc1 = os.environ.get("CC", "gcc") diff -Nru systemtap-4.2/debian/patches/series systemtap-4.2/debian/patches/series --- systemtap-4.2/debian/patches/series 2020-02-17 10:03:40.000000000 +0000 +++ systemtap-4.2/debian/patches/series 2022-03-16 20:03:34.000000000 +0000 @@ -7,3 +7,4 @@ stap-prep.patch fallback-comment-gcc-9.diff fix-autoconf-stack-trace-strict-prototypes.diff +dtrace-predictable-tmp-file.patch