From: Todd C. Miller Date: Thu, 30 Mar 1995 02:30:33 +0000 (+0000) Subject: added support for sunos with C2 security X-Git-Tag: SUDO_1_4_0~526 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=99af59db47a0eb5c7d7672be79eaece3457a5b16;p=sudo added support for sunos with C2 security --- diff --git a/check.c b/check.c index 822e433e3..c12ea3e4a 100644 --- a/check.c +++ b/check.c @@ -76,6 +76,11 @@ static char rcsid[] = "$Id$"; #include #include #endif /* __convex__ && HAVE_C2_SECURITY */ +#if defined(SUNOS4) && defined(HAVE_C2_SECURITY) +#include +#include +#include +#endif /* SUNOS4 && HAVE_C2_SECURITY */ #ifdef HAVE_AFS #include #include @@ -296,6 +301,9 @@ static void check_passwd() #if defined(__hpux) && defined(HAVE_C2_SECURITY) struct s_passwd *spw_ent; #endif /* __hpux && HAVE_C2_SECURITY */ +#if defined(SUNOS4) && defined(HAVE_C2_SECURITY) + struct passwd_adjunct *pwa; +#endif /* SUNOS4 && HAVE_C2_SECURITY */ #if defined(__osf__) && defined(HAVE_C2_SECURITY) struct pr_passwd *spw_ent; #endif /* __osf__ && HAVE_C2_SECURITY */ @@ -379,6 +387,20 @@ static void check_passwd() } encrypted = spw_ent->ufld.fd_encrypt; #endif /* __convex__ && HAVE_C2_SECURITY */ +#if defined(SUNOS4) && (HAVE_C2_SECURITY) + /* + * SunOS with C2 security + */ + set_perms(PERM_ROOT); + pwa = getpwanam(user); + set_perms(PERM_USER); + if (pwa == (struct passwd_adjunct *)NULL) { + (void) sprintf(user, "%u", uid); + log_error(GLOBAL_NO_PW_ENT); + inform_user(GLOBAL_NO_PW_ENT); + exit(1); + } +#endif /* SUNOS4 && HAVE_C2_SECURITY */ /* * you get TRIES_FOR_PASSWORD times to guess your password