From 4c63daac52b77c9224ff501084f79274fd531a97 Mon Sep 17 00:00:00 2001 From: Simon Ruderich Date: Wed, 23 Sep 2015 01:56:47 +0200 Subject: [PATCH] configure.ac: check for setresuid/setresuid when using utmpx.h Broken in 3553a29a54f7755debfa189db830c4b8de51826f ("drop privileges when running as group utmp"). --- configure.ac | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 -- 2.43.2