From 08a4a285927d3d0af1c39133ab8de5b6be2e8e52 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Mon, 14 Nov 2016 14:40:50 -0700 Subject: [PATCH] Remove SunOS 4 support, it is not modern enough to run sudo. --- config.h.in | 8 -------- configure | 32 +------------------------------- configure.ac | 18 ------------------ plugins/sudoers/getspwuid.c | 25 +------------------------ 4 files changed, 2 insertions(+), 81 deletions(-) diff --git a/config.h.in b/config.h.in index 823823584..0fb1b98e2 100644 --- a/config.h.in +++ b/config.h.in @@ -286,10 +286,6 @@ passwords). */ #undef HAVE_GETPRPWNAM -/* Define to 1 if you have the `getpwanam' function. (SunOS 4.x shadow - passwords). */ -#undef HAVE_GETPWANAM - /* Define to 1 if you have the `getresuid' function. */ #undef HAVE_GETRESUID @@ -346,10 +342,6 @@ shadow enabled). */ #undef HAVE_ISCOMSEC -/* Define to 1 if you have the `issecure' function. (SunOS 4.x check for - shadow enabled). */ -#undef HAVE_ISSECURE - /* Define to 1 if you use Kerberos V. */ #undef HAVE_KERB5 diff --git a/configure b/configure index 015043a6a..d7e74c551 100755 --- a/configure +++ b/configure @@ -638,10 +638,10 @@ ac_func_list= ac_c_werror_flag= ac_subst_vars='LTLIBOBJS KRB5CONFIG +LIBOBJS FLEX YFLAGS YACC -LIBOBJS NROFFPROG MANDOCPROG TRPROG @@ -14794,34 +14794,6 @@ else fi case "$host" in - *-*-sunos4*) - # LD_PRELOAD is space-delimited - RTLD_PRELOAD_DELIM=" " - - # getcwd(3) opens a pipe to getpwd(1)!?! - case " $LIBOBJS " in - *" getcwd.$ac_objext "* ) ;; - *) LIBOBJS="$LIBOBJS getcwd.$ac_objext" - ;; -esac - - - for _sym in sudo_getcwd; do - COMPAT_EXP="${COMPAT_EXP}${_sym} -" - done - - $as_echo "#define PREFER_PORTABLE_GETCWD 1" >>confdefs.h - - - # system headers lack prototypes but gcc helps... - if test -n "$GCC"; then - $as_echo "#define __USE_FIXED_PROTOTYPES__ 1" >>confdefs.h - - fi - - shadow_funcs="getpwanam issecure" - ;; *-*-solaris2*) $as_echo "#define PAM_SUN_CODEBASE 1" >>confdefs.h @@ -26740,8 +26712,6 @@ fi - - diff --git a/configure.ac b/configure.ac index 8baff3466..fef8d5b5e 100644 --- a/configure.ac +++ b/configure.ac @@ -1677,22 +1677,6 @@ else fi case "$host" in - *-*-sunos4*) - # LD_PRELOAD is space-delimited - RTLD_PRELOAD_DELIM=" " - - # getcwd(3) opens a pipe to getpwd(1)!?! - AC_LIBOBJ(getcwd) - SUDO_APPEND_COMPAT_EXP(sudo_getcwd) - AC_DEFINE(PREFER_PORTABLE_GETCWD) - - # system headers lack prototypes but gcc helps... - if test -n "$GCC"; then - AC_DEFINE([__USE_FIXED_PROTOTYPES__]) - fi - - shadow_funcs="getpwanam issecure" - ;; *-*-solaris2*) AC_DEFINE([PAM_SUN_CODEBASE]) @@ -4301,14 +4285,12 @@ AH_TEMPLATE(HAVE_FCNTL_CLOSEM, [Define to 1 if your system has the F_CLOSEM fcnt AH_TEMPLATE(HAVE_FNMATCH, [Define to 1 if you have the `fnmatch' function.]) AH_TEMPLATE(HAVE_FWTK, [Define to 1 if you use the FWTK authsrv daemon.]) AH_TEMPLATE(HAVE_GETPRPWNAM, [Define to 1 if you have the `getprpwnam' function. (SecureWare-style shadow passwords).]) -AH_TEMPLATE(HAVE_GETPWANAM, [Define to 1 if you have the `getpwanam' function. (SunOS 4.x shadow passwords).]) AH_TEMPLATE(HAVE_GETSPNAM, [Define to 1 if you have the `getspnam' function (SVR4-style shadow passwords).]) AH_TEMPLATE(HAVE_GSS_KRB5_CCACHE_NAME, [Define to 1 if you have the `gss_krb5_ccache_name' function.]) AH_TEMPLATE(HAVE_HEIMDAL, [Define to 1 if your Kerberos is Heimdal.]) AH_TEMPLATE(HAVE_INET_NTOP, [Define to 1 if you have the `inet_ntop' function.]) AH_TEMPLATE(HAVE_INET_PTON, [Define to 1 if you have the `inet_pton' function.]) AH_TEMPLATE(HAVE_ISCOMSEC, [Define to 1 if you have the `iscomsec' function. (HP-UX >= 10.x check for shadow enabled).]) -AH_TEMPLATE(HAVE_ISSECURE, [Define to 1 if you have the `issecure' function. (SunOS 4.x check for shadow enabled).]) AH_TEMPLATE(HAVE_KERB5, [Define to 1 if you use Kerberos V.]) AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_ALLOC, [Define to 1 if you have the `krb5_get_init_creds_opt_alloc' function.]) AH_TEMPLATE(HAVE_KRB5_GET_INIT_CREDS_OPT_FREE_TWO_ARGS, [Define to 1 if your `krb5_get_init_creds_opt_free' function takes two arguments.]) diff --git a/plugins/sudoers/getspwuid.c b/plugins/sudoers/getspwuid.c index 55020aa46..7a8fc75e4 100644 --- a/plugins/sudoers/getspwuid.c +++ b/plugins/sudoers/getspwuid.c @@ -46,11 +46,6 @@ # endif /* __hpux */ # include #endif /* HAVE_GETPRPWNAM */ -#ifdef HAVE_GETPWANAM -# include -# include -# include -#endif /* HAVE_GETPWANAM */ #include "sudoers.h" @@ -76,10 +71,6 @@ sudo_getepw(const struct passwd *pw) if (!iscomsec()) goto done; #endif /* HAVE_ISCOMSEC */ -#ifdef HAVE_ISSECURE - if (!issecure()) - goto done; -#endif /* HAVE_ISSECURE */ #ifdef HAVE_GETPRPWNAM { @@ -101,16 +92,8 @@ sudo_getepw(const struct passwd *pw) epw = spw->sp_pwdp; } #endif /* HAVE_GETSPNAM */ -#ifdef HAVE_GETPWANAM - { - struct passwd_adjunct *spw; - - if ((spw = getpwanam(pw->pw_name)) && spw->pwa_passwd) - epw = spw->pwa_passwd; - } -#endif /* HAVE_GETPWANAM */ -#if defined(HAVE_ISCOMSEC) || defined(HAVE_ISSECURE) +#if defined(HAVE_ISCOMSEC) done: #endif /* If no shadow password, fall back on regular password. */ @@ -127,9 +110,6 @@ sudo_setspent(void) #endif #ifdef HAVE_GETSPNAM setspent(); -#endif -#ifdef HAVE_GETPWANAM - setpwaent(); #endif debug_return; } @@ -144,9 +124,6 @@ sudo_endspent(void) #endif #ifdef HAVE_GETSPNAM endspent(); -#endif -#ifdef HAVE_GETPWANAM - endpwaent(); #endif debug_return; } -- 2.40.0