Skip to content

Commit 2a0d61e

Browse files
committed
Use --tmpdir when creating temporary files with mktemp
1 parent b783576 commit 2a0d61e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

srpm/sbin_update-motd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ then
4545
fi
4646

4747
if [ -d /etc/update-motd.d ]; then
48-
TMPFILE=$(mktemp -p /var/tmp motd.XXXXX)
48+
TMPFILE=$(mktemp --tmpdir motd.XXXXX)
4949
if [ -f /etc/motd.head ]; then
5050
cat /etc/motd.head >> $TMPFILE
5151
fi
@@ -56,7 +56,7 @@ if [ -d /etc/update-motd.d ]; then
5656
[[ $part =~ \.rpm* ]] && continue
5757
# Run only if it's a regular file and executable
5858
if [ -f $part ] && [ -x $part ]; then
59-
TMPPART=$(mktemp motd.partXXXXX)
59+
TMPPART=$(mktemp --tmpdir motd.partXXXXX)
6060
if ($part > $TMPPART); then
6161
cat $TMPPART >> $TMPFILE
6262
fi

srpm/update-motd.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
Name: update-motd
2-
Version: 1.0
2+
Version: 1.0.1
33
Release: 1%{?dist}
44
License: ASL 2.0
55
Summary: Framework for dynamically generating MOTD

0 commit comments

Comments
 (0)