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

Older Solaris has getusershell() et al but does not declare it.

This commit is contained in:
Todd C. Miller 2021-08-13 09:52:02 -06:00
parent a55b54329e
commit 62aca803ce
4 changed files with 24 additions and 1 deletions

View File

@ -129,6 +129,10 @@
don't. */
#undef HAVE_DECL_GETRESUID
/* Define to 1 if you have the declaration of `getusershell', and to 0 if you
don't. */
#undef HAVE_DECL_GETUSERSHELL
/* Define to 1 if you have the declaration of `h_errno', and to 0 if you
don't. */
#undef HAVE_DECL_H_ERRNO

11
configure vendored
View File

@ -19940,6 +19940,17 @@ if test "x$ac_cv_func_getusershell" = xyes
then :
printf "%s\n" "#define HAVE_GETUSERSHELL 1" >>confdefs.h
# Older Solaris has getusershell() et al but does not declare it.
ac_fn_check_decl "$LINENO" "getusershell" "ac_cv_have_decl_getusershell" "$ac_includes_default" "$ac_c_undeclared_builtin_options" "CFLAGS"
if test "x$ac_cv_have_decl_getusershell" = xyes
then :
ac_have_decl=1
else $as_nop
ac_have_decl=0
fi
printf "%s\n" "#define HAVE_DECL_GETUSERSHELL $ac_have_decl" >>confdefs.h
else $as_nop
case " $LIBOBJS " in

View File

@ -2600,7 +2600,10 @@ AC_CHECK_FUNCS([getdelim], [
SUDO_APPEND_COMPAT_EXP(sudo_getdelim)
COMPAT_TEST_PROGS="${COMPAT_TEST_PROGS}${COMPAT_TEST_PROGS+ }getdelim_test"
])
AC_CHECK_FUNCS([getusershell], [], [
AC_CHECK_FUNCS([getusershell], [
# Older Solaris has getusershell() et al but does not declare it.
AC_CHECK_DECLS([getusershell])
], [
AC_LIBOBJ(getusershell)
SUDO_APPEND_COMPAT_EXP(sudo_getusershell)
])

View File

@ -441,6 +441,11 @@ sudo_dso_public void sudo_setusershell(void);
sudo_dso_public void sudo_endusershell(void);
# undef endusershell
# define endusershell() sudo_endusershell()
#elif HAVE_DECL_GETUSERSHELL == 0
/* Older Solaris has getusershell() et al but does not declare it. */
char *getusershell(void);
void setusershell(void);
void endusershell(void);
#endif /* HAVE_GETUSERSHELL */
#ifndef HAVE_UTIMENSAT
sudo_dso_public int sudo_utimensat(int fd, const char *file, const struct timespec *times, int flag);