Skip to content

Commit

Permalink
Adding with-sce-script-dir flag to configure.ac. Fixes OpenSCAP#1016
Browse files Browse the repository at this point in the history
Signed-off-by: Conor Nosal <[email protected]>
  • Loading branch information
JennyYJK committed Apr 20, 2018
1 parent 8996fe1 commit a8e8941
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
8 changes: 8 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1151,8 +1151,16 @@ AC_ARG_ENABLE([sce],
*) AC_MSG_ERROR([bad value ${enableval} for --enable-sce]) ;;
esac],[sce=no])


AC_ARG_WITH([sce-script-dir],
[AS_HELP_STRING([--with-sce-script-dir],
[use different temporary directory to execute sce scripts [default=/tmp]])],
[],
[with_sce_script_dir="/tmp"])

if test "x${sce}" = xyes; then
AC_DEFINE([ENABLE_SCE], [1], [compilation of script check engine enabled])
CFLAGS="$CFLAGS -DSCE_SCRIPT_DIR=\"${with_sce_script_dir}\""
fi

AC_ARG_ENABLE([util-oscap],
Expand Down
7 changes: 3 additions & 4 deletions src/common/oscap_acquire.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
#include <config.h>
#endif

#include <stdio.h> // for P_tmpdir macro
#include <string.h>
#include <stdlib.h>
#include <errno.h>
Expand All @@ -41,11 +40,11 @@
#include "common/_error.h"
#include "oscap_string.h"

#ifndef P_tmpdir
#define P_tmpdir "/tmp"
#ifndef SCE_SCRIPT_DIR
#define SCE_SCRIPT_DIR "/tmp"
#endif

#define TEMP_DIR_TEMPLATE P_tmpdir "/oscap.XXXXXX"
#define TEMP_DIR_TEMPLATE SCE_SCRIPT_DIR "/oscap.XXXXXX"
#define TEMP_URL_TEMPLATE "downloaded.XXXXXX"

char *
Expand Down

0 comments on commit a8e8941

Please sign in to comment.