commit b7ec583187229afb41e581a1063e04ab6239584d from: Thomas Adam date: Fri Jul 15 09:57:55 2022 UTC portable: gotwebd: handle setres{g,u}id This isn't defined on all systems. commit - 62da1d17b61450e7c91f51c010e419897cf86d02 commit + b7ec583187229afb41e581a1063e04ab6239584d blob - 181919af7959ac179ec18885f7028d91f9207b9b blob + 1b2a72ab52334c6b2aac5b5924a947fff28992eb --- configure.ac +++ configure.ac @@ -109,6 +109,8 @@ AC_CHECK_FUNCS([ \ rmdir \ setlocale \ socket \ + setresgid \ + setresuid \ setproctitle \ strcasecmp \ strchr \ @@ -127,6 +129,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 - ebb7e3608ad72ede8057117a4f13d564010ac8db blob + 85456bfa61f6850289e535085198f7baa431bcbf --- 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