From 6897c329b5b323567267d364fefdf01a9bff5688 Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Tue, 17 Feb 2015 08:41:16 +0100 Subject: [PATCH] xt_geoip_update: Fix mktemp calls. --- src/scripts/xt_geoip_update | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/scripts/xt_geoip_update b/src/scripts/xt_geoip_update index 3ad34d0c6d..294af58e0a 100644 --- a/src/scripts/xt_geoip_update +++ b/src/scripts/xt_geoip_update @@ -20,7 +20,7 @@ ############################################################################### TMP_PATH=$(mktemp -d) -TMP_FILE=$(mktemp) +TMP_FILE=$(mktemp -p $TMP_PATH) SCRIPT_PATH=/usr/libexec/xtables-addons DEST_PATH=/usr/share/xt_geoip @@ -35,11 +35,14 @@ ARCH=LE function download() { echo "Downloading latest GeoIP ruleset..." + # Create temporary directory. + mkdir -pv $TMP_PATH + # Get the latest GeoIP database from server. - wget $DL_URL/$DL_FILE -O $TMP_PATH/$TMP_FILE + wget $DL_URL/$DL_FILE -O $TMP_FILE # Extract files. - unzip $TMP_PATH/$TMP_FILE -d $TMP_PATH + unzip $TMP_FILE -d $TMP_PATH return 0 } @@ -55,7 +58,7 @@ function build() { # Run script to convert the CSV file into several xtables # compatible binary files. - if ! $SCRIPT_PATH/xt_geoip_build $TMP_DIR/$CSV_FILE -D $TMP_DIR; then + if ! $SCRIPT_PATH/xt_geoip_build $TMP_PATH/$CSV_FILE -D $TMP_PATH; then echo "Could not convert ruleset. Aborting." >&2 return 1 fi -- 2.39.2