Skip to content

Commit

Permalink
avoid mktemp collisions with [find -not -path '*.ko*']
Browse files Browse the repository at this point in the history
  • Loading branch information
bfjelds committed Feb 4, 2025
1 parent cb6ac00 commit 77bd6be
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
28 changes: 28 additions & 0 deletions SPECS/dracut/avoid-mktemp-collisions-with-find-not-path.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
From 192a4908594d0080072dd4aaf3417a926003083b Mon Sep 17 00:00:00 2001
From: Brian Fjeldstad <[email protected]>
Date: Tue, 4 Feb 2025 21:48:52 +0000
Subject: [PATCH] avoid mktemp collisions with [find -not -path '*.ko*']

---
dracut.sh | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dracut.sh b/dracut.sh
index cc6d6f28..06e7ce8e 100755
--- a/dracut.sh
+++ b/dracut.sh
@@ -1253,9 +1253,9 @@ if findmnt --raw -n --target "$tmpdir" --output=options | grep -q noexec; then
fi

# shellcheck disable=SC2155
-readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.XXXXXX)"
+readonly DRACUT_TMPDIR="$(mktemp -p "$TMPDIR/" -d -t dracut.dXXXXXX)"
[ -d "$DRACUT_TMPDIR" ] || {
- printf "%s\n" "dracut[F]: mktemp -p '$TMPDIR/' -d -t dracut.XXXXXX failed." >&2
+ printf "%s\n" "dracut[F]: mktemp -p '$TMPDIR/' -d -t dracut.dXXXXXX failed." >&2
exit 1
}

--
2.34.1

1 change: 1 addition & 0 deletions SPECS/dracut/dracut.spec
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ Patch: 0013-revert-fix-crypt-unlock-encrypted-devices-by-default.patch
Patch: 0014-fix-systemd-pcrphase-in-hostonly-mode-do-not-try-to-include-systemd-pcrphase.patch
Patch: 0015-fix-systemd-pcrphase-make-tpm2-tss-an-optional-dependency.patch
Patch: 0016-Handle-SELinux-configuration-for-overlayfs-folders.patch
Patch: avoid-mktemp-collisions-with-find-not-path.patch

BuildRequires: bash
BuildRequires: kmod-devel
Expand Down

0 comments on commit 77bd6be

Please sign in to comment.