iptables/iptables-apply-Use-mktemp-instead-of-tempfile.patch

34 lines
851 B
Diff
Raw Normal View History

2020-01-12 13:46:38 +08:00
From 6c3a1a5c29a7c41af9da1a3bbf137df994479518 Mon Sep 17 00:00:00 2001
2020-01-10 11:19:03 +08:00
From: Phil Sutter <psutter@redhat.com>
Date: Fri, 12 Apr 2019 18:02:19 +0200
Subject: [PATCH] iptables-apply: Use mktemp instead of tempfile
---
2020-01-12 13:46:38 +08:00
iptables-apply | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/iptables-apply b/iptables-apply
index 819ca4a..a685b6b 100755
--- a/iptables/iptables-apply
+++ b/iptables/iptables-apply
@@ -111,7 +111,7 @@ if [[ ! -r "$FILE" ]]; then
exit 2
fi
2020-01-10 11:19:03 +08:00
-COMMANDS=(tempfile "$SAVE" "$RESTORE")
+COMMANDS=(mktemp "$SAVE" "$RESTORE")
2020-01-12 13:46:38 +08:00
2020-01-10 11:19:03 +08:00
for cmd in "${COMMANDS[@]}"; do
2020-01-12 13:46:38 +08:00
if ! command -v $cmd >/dev/null; then
2020-01-10 11:19:03 +08:00
@@ -122,7 +122,7 @@ done
2020-01-12 13:46:38 +08:00
2020-01-10 11:19:03 +08:00
umask 0700
2020-01-12 13:46:38 +08:00
2020-01-10 11:19:03 +08:00
-TMPFILE=$(tempfile -p iptap)
+TMPFILE=$(mktemp)
trap "rm -f $TMPFILE" EXIT HUP INT QUIT ILL TRAP ABRT BUS \
2020-01-12 13:46:38 +08:00
FPE USR1 SEGV USR2 PIPE ALRM TERM
2020-01-10 11:19:03 +08:00
--
2020-01-12 13:46:38 +08:00
1.8.3.1