From: Andreas Schneider Date: Fri, 15 Nov 2013 08:36:54 +0000 (+0100) Subject: cmake: Add check for setgroups prototype. X-Git-Url: http://git.samba.org/?a=commitdiff_plain;h=23c39228f206c33880773f49c18bcdcd6aaf466f;p=obnox%2Fcwrap%2Fuid_wrapper.git cmake: Add check for setgroups prototype. --- diff --git a/ConfigureChecks.cmake b/ConfigureChecks.cmake index 337314c..f85a125 100644 --- a/ConfigureChecks.cmake +++ b/ConfigureChecks.cmake @@ -69,6 +69,14 @@ check_function_exists(setregid HAVE_SETRESGID) check_function_exists(getgroups HAVE_GETGROUPS) check_function_exists(setgroups HAVE_SETGROUPS) +if (HAVE_SETGROUPS) + check_prototype_definition(setgroups + "int setgroups(int size, const gid_t *list)" + "-1" + "unistd.h" + HAVE_SETGROUPS_INT) +endif (HAVE_SETGROUPS) + check_function_exists(syscall HAVE_SYSCALL) if (HAVE_SYSCALL) diff --git a/config.h.cmake b/config.h.cmake index 591553c..f9a3c72 100644 --- a/config.h.cmake +++ b/config.h.cmake @@ -40,6 +40,10 @@ /* Define to 1 if you have the `setresgid' function. */ #cmakedefine HAVE_SETREGID 1 +/* Define to 1 if you have the `setgroups' function. */ +#cmakedefine HAVE_SETGROUPS 1 +#cmakedefine HAVE_SETGROUPS_INT 1 + /* Define to 1 if you have the `syscall' function. */ #cmakedefine HAVE_SYSCALL 1 diff --git a/src/uid_wrapper.c b/src/uid_wrapper.c index 971932f..8a16513 100644 --- a/src/uid_wrapper.c +++ b/src/uid_wrapper.c @@ -758,7 +758,11 @@ out: return rc; } +#ifdef HAVE_SETGROUPS_INT +int setgroups(int size, const gid_t *list) +#else int setgroups(size_t size, const gid_t *list) +#endif { if (!uwrap_enabled()) { return uwrap.libc.fns._libc_setgroups(size, list);