From: Simon McVittie Date: Wed, 5 Jan 2011 19:10:12 +0000 (+0000) Subject: configure.in: use AC_TRY_COMPILE to avoid a symlink attack in /tmp during compilation X-Git-Tag: dbus-1.4.4~40^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d83d74dc6833d127032dc18b1b1aac27cb974015;p=platform%2Fupstream%2Fdbus.git configure.in: use AC_TRY_COMPILE to avoid a symlink attack in /tmp during compilation --- diff --git a/configure.in b/configure.in index 842a359..aec3419 100644 --- a/configure.in +++ b/configure.in @@ -1085,17 +1085,13 @@ fi #### gcc warning flags cc_supports_flag() { - AC_MSG_CHECKING(whether $CC supports "$@") - Cfile=/tmp/foo${$} - touch ${Cfile}.c - $CC -c "$@" ${Cfile}.c -o ${Cfile}.o >/dev/null 2>&1 - rc=$? - rm -f ${Cfile}.c ${Cfile}.o - case $rc in - 0) AC_MSG_RESULT(yes);; - *) AC_MSG_RESULT(no);; - esac - return $rc + AC_MSG_CHECKING(whether $CC supports "$*") + save_CFLAGS="$CFLAGS" + CFLAGS="$*" + AC_TRY_COMPILE([], [], [rc=yes], [rc=no]) + CFLAGS="$save_CFLAGS" + AC_MSG_RESULT([$rc]) + test "x$rc" = xyes } ld_supports_flag() {