]> ruderich.org/simon Gitweb - wall-notify/wall-notify.git/commitdiff
configure.ac: check for setresuid/setresuid when using utmpx.h
authorSimon Ruderich <simon@ruderich.org>
Tue, 22 Sep 2015 23:56:47 +0000 (01:56 +0200)
committerSimon Ruderich <simon@ruderich.org>
Tue, 22 Sep 2015 23:56:47 +0000 (01:56 +0200)
Broken in 3553a29a54f7755debfa189db830c4b8de51826f ("drop privileges
when running as group utmp").

configure.ac

index 84c3e324ea395864d4147e43a6f1b19be1b4f80e..3c1939664a6a5c5ec1922a2cdd45d92c41596eb0 100644 (file)
@@ -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