kdumpctl: Fix temporary directory location

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=2215606
Upstream: Fedora Rawhide
Conflict: None

commit dda81d72c2
Author: Philipp Rudo <prudo@redhat.com>
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 <prudo@redhat.com>
    Reviewed-by: Coiby Xu <coxu@redhat.com>

Signed-off-by: Philipp Rudo <prudo@redhat.com>
Signed-off-by: Tao Liu <ltao@redhat.com>
This commit is contained in:
Tao Liu 2023-06-21 16:02:14 +08:00
parent d8ee87cfda
commit 401619f484

View File

@ -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"