From 4a7ceb24cfcc0a97f96d86cfe5852ae445b50e57 Mon Sep 17 00:00:00 2001 From: jjj Date: Wed, 23 Jan 2008 09:40:35 -0800 Subject: 6483447 pam_sm_chauthtok NOT mt-safe: authtok_check/dict.c:lock_db uses alarm(2) 6548129 some pam modules can use some malloc/strdup error checking --- usr/src/lib/passwdutil/files_attr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'usr/src/lib/passwdutil/files_attr.c') diff --git a/usr/src/lib/passwdutil/files_attr.c b/usr/src/lib/passwdutil/files_attr.c index 63da6ed4e8..22519fb5df 100644 --- a/usr/src/lib/passwdutil/files_attr.c +++ b/usr/src/lib/passwdutil/files_attr.c @@ -327,6 +327,7 @@ error: * PWU_NOT_FOUND * PWU_SUCCESS and (auth_user == NULL || auth_user = user) * PWU_DENIED + * PWU_NOMEM */ /*ARGSUSED*/ int @@ -349,8 +350,11 @@ files_user_to_authenticate(char *user, pwu_repository_t *rep, } else { *privileged = 0; if (getuid() == pwbuf->pwd->pw_uid) { - *auth_user = strdup(user); - res = PWU_SUCCESS; + if ((*auth_user = strdup(user)) == NULL) { + res = PWU_NOMEM; + } else { + res = PWU_SUCCESS; + } } else { res = PWU_DENIED; } -- cgit v1.2.3