From 401619f484f2b2e943ca4ecc8fd90e02978a75c2 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Wed, 21 Jun 2023 16:02:14 +0800 Subject: [PATCH] kdumpctl: Fix temporary directory location Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2215606 Upstream: Fedora Rawhide Conflict: None commit dda81d72c2766167d48d3e505b95b2ca9b013039 Author: Philipp Rudo Date: Mon Jun 19 14:31:48 2023 +0200 kdumpctl: Fix temporary directory location The temporary directory is currently created under the current working directory. That alone isn't ideal but works most of the time. However, it will fail when the current working directory is not writable. So make sure the directory is created within TMPDIR. Fixes: ea00b7d ("kdumpctl: Move temp file in get_kernel_size to global temp dir") Signed-off-by: Philipp Rudo Reviewed-by: Coiby Xu Signed-off-by: Philipp Rudo Signed-off-by: Tao Liu --- kdumpctl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdumpctl b/kdumpctl index a46f9f9..dbcc502 100755 --- a/kdumpctl +++ b/kdumpctl @@ -42,7 +42,7 @@ if ! dlog_init; then exit 1 fi -KDUMP_TMPDIR=$(mktemp -d kdump.XXXX) +KDUMP_TMPDIR=$(mktemp --tmpdir -d kdump.XXXX) trap ' ret=$?; rm -rf "$KDUMP_TMPDIR"