commit 683ec58e0103a83ea39d34559fa855505f68bb74 from: Thomas Adam date: Sat Jul 16 12:31:04 2022 UTC portable: gotwebd: handle setres{g,u}id This isn't defined on all systems. commit - dd7a7d5b22adf0bd60fa6bc7b146aaf2d4dbb59c commit + 683ec58e0103a83ea39d34559fa855505f68bb74 blob - 1ccc590844e14535156422b3817ceee8feb57bd4 blob + 0890ec5198afd385e54e69bee2d7730ae2a556bd --- configure.ac +++ configure.ac @@ -110,6 +110,8 @@ AC_CHECK_FUNCS([ \ rmdir \ setlocale \ socket \ + setresgid \ + setresuid \ setproctitle \ strcasecmp \ strchr \ @@ -128,6 +130,8 @@ AC_CHECK_FUNCS([ \ ]) AM_CONDITIONAL([HAVE_SETPROCTITLE], [test "x$ac_cv_func_setproctitle" = xyes]) +AM_CONDITIONAL([HAVE_SETRESGID], [test "x$ac_cv_func_setresgid" = xyes]) +AM_CONDITIONAL([HAVE_SETRESUID], [test "x$ac_cv_func_setresuid" = xyes]) # Siphash support. AC_CHECK_FUNCS([SipHash]) blob - abc05f1eec66c9406b7c98b48d1579c2934bff89 blob + 93f202844392649423bc8847671f40d36092249e --- include/got_compat.h +++ include/got_compat.h @@ -88,6 +88,14 @@ #ifndef __FreeBSD__ #define cap_enter() (0) +#endif + +#ifndef HAVE_SETRESGID +#define setresgid(a, b, c) (0) +#endif + +#ifndef HAVE_SETRESUID +#define setresuid(a, b, c) (0) #endif #ifndef HAVE_LINUX_LANDLOCK_H