From: Simon Ruderich Date: Tue, 22 Sep 2015 23:56:47 +0000 (+0200) Subject: configure.ac: check for setresuid/setresuid when using utmpx.h X-Git-Url: https://ruderich.org/simon/gitweb/?p=wall-notify%2Fwall-notify.git;a=commitdiff_plain;h=4c63daac52b77c9224ff501084f79274fd531a97 configure.ac: check for setresuid/setresuid when using utmpx.h Broken in 3553a29a54f7755debfa189db830c4b8de51826f ("drop privileges when running as group utmp"). --- diff --git a/configure.ac b/configure.ac index 84c3e32..3c19396 100644 --- a/configure.ac +++ b/configure.ac @@ -37,9 +37,6 @@ fi AC_CHECK_HEADERS([utempter.h utmpx.h]) if test "x$ac_cv_header_utempter_h" = xyes; then - AC_CHECK_FUNCS([setresuid setresgid],[], - [AC_MSG_ERROR([setresuid() and setresgid() required for utmpx])]) - AC_MSG_NOTICE([using utempter]) AC_CHECK_LIB([utempter], [utempter_add_record], [], [AC_MSG_ERROR([utempter_add_record() required])]) @@ -49,7 +46,10 @@ if test "x$ac_cv_header_utempter_h" = xyes; then elif test "x$ac_cv_header_utmpx_h" = xyes; then AC_MSG_NOTICE([using utmp]) + AC_CHECK_FUNCS([setresuid setresgid],[], + [AC_MSG_ERROR([setresuid() and setresgid() required for utmpx])]) AC_DEFINE([USE_UTMPX], 1, [Define to 1 to use utmp.]) + else AC_MSG_ERROR([neither utmpx.h nor utempter.h found, aborting]) fi