2
0
mirror of https://github.com/sudo-project/sudo.git synced 2025-08-22 01:49:11 +00:00

Add check for getresuid() declaration, which may be missing on HP-UX.

When checking for getdomainname() prototype, look in netdb.h too.
This commit is contained in:
Todd C. Miller 2015-02-06 11:33:30 -07:00
parent c3c28773f5
commit 3eb9a854d8
4 changed files with 30 additions and 5 deletions

View File

@ -93,6 +93,10 @@
don't. */
#undef HAVE_DECL_GETDOMAINNAME
/* Define to 1 if you have the declaration of `getresuid', and to 0 if you
don't. */
#undef HAVE_DECL_GETRESUID
/* Define to 1 if you have the declaration of `HOST_NAME_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_HOST_NAME_MAX

16
configure vendored
View File

@ -18630,6 +18630,16 @@ do :
if test "x$ac_cv_func_getresuid" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_GETRESUID 1
_ACEOF
ac_fn_c_check_decl "$LINENO" "getresuid" "ac_cv_have_decl_getresuid" "$ac_includes_default"
if test "x$ac_cv_have_decl_getresuid" = xyes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_GETRESUID $ac_have_decl
_ACEOF
fi
@ -18763,7 +18773,11 @@ if test "x$ac_cv_func_getdomainname" = xyes; then :
#define HAVE_GETDOMAINNAME 1
_ACEOF
ac_fn_c_check_decl "$LINENO" "getdomainname" "ac_cv_have_decl_getdomainname" "$ac_includes_default"
ac_fn_c_check_decl "$LINENO" "getdomainname" "ac_cv_have_decl_getdomainname" "
$ac_includes_default
#include <netdb.h>
"
if test "x$ac_cv_have_decl_getdomainname" = xyes; then :
ac_have_decl=1
else

View File

@ -2458,7 +2458,7 @@ if test -z "$SKIP_SETRESUID"; then
AC_CHECK_FUNCS([setresuid], [
SKIP_SETREUID=yes
AC_CHECK_DECLS([setresuid])
AC_CHECK_FUNCS([getresuid])
AC_CHECK_FUNCS([getresuid], [AC_CHECK_DECLS([getresuid])])
])
fi
if test -z "$SKIP_SETREUID"; then
@ -2490,7 +2490,10 @@ AC_INCLUDES_DEFAULT
])
])
AC_CHECK_FUNCS([getdomainname], [
AC_CHECK_DECLS([getdomainname])
AC_CHECK_DECLS([getdomainname], [], [], [
AC_INCLUDES_DEFAULT
#include <netdb.h>
])
], [
AC_CHECK_FUNCS([sysinfo], [AC_CHECK_HEADERS([sys/systeminfo.h])])
])

View File

@ -343,8 +343,12 @@ extern int errno;
* Older HP-UX does not declare setresuid() or setresgid().
*/
#if defined(HAVE_DECL_SETRESUID) && !HAVE_DECL_SETRESUID
int setresuid(uid_t ruid, uid_t euid, uid_t suid);
int setresgid(gid_t rgid, gid_t egid, gid_t sgid);
int setresuid(uid_t, uid_t, uid_t);
int setresgid(gid_t, gid_t, gid_t);
#endif
#if defined(HAVE_DECL_GETRESUID) && !HAVE_DECL_GETRESUID
int getresuid(uid_t *, uid_t *, uid_t *);
int getresgid(gid_t *, gid_t *, gid_t *);
#endif
/*