summaryrefslogtreecommitdiff
path: root/usr/src/lib/passwdutil/files_attr.c
diff options
context:
space:
mode:
authorjjj <none@none>2008-01-23 09:40:35 -0800
committerjjj <none@none>2008-01-23 09:40:35 -0800
commit4a7ceb24cfcc0a97f96d86cfe5852ae445b50e57 (patch)
tree87fbcad153f1888e510ae0ca12b035f9a24650df /usr/src/lib/passwdutil/files_attr.c
parente79c98e6c943cb3032f272714ff4ce6137d40394 (diff)
downloadillumos-joyent-4a7ceb24cfcc0a97f96d86cfe5852ae445b50e57.tar.gz
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
Diffstat (limited to 'usr/src/lib/passwdutil/files_attr.c')
-rw-r--r--usr/src/lib/passwdutil/files_attr.c8
1 files changed, 6 insertions, 2 deletions
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;
}