utils.c revision b9175c69691c8949bec97fb8f689b7d1efdb05bb
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * CDDL HEADER START
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * The contents of this file are subject to the terms of the
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * Common Development and Distribution License (the "License").
ae115bc77f6fcde83175c75b4206dc2e50747966mrj * You may not use this file except in compliance with the License.
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * See the License for the specific language governing permissions
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * and limitations under the License.
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * When distributing Covered Code, include this CDDL HEADER in each
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * If applicable, add the following below this CDDL HEADER, with the
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * fields enclosed by brackets "[]" replaced with your own identifying
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * information: Portions Copyright [yyyy] [name of copyright owner]
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * CDDL HEADER END
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * Copyright 2009 Sun Microsystems, Inc. All rights reserved.
1cb6af97c6f66f456d4f726ef056e1ebc0f73305wnelson * Use is subject to license terms.
if (s == NULL) {
*d = NULL;
return (PWU_NOT_FOUND);
return (PWU_NOMEM);
if (s->pw_name) {
goto no_mem;
if (s->pw_passwd) {
goto no_mem;
if (s->pw_gecos) {
goto no_mem;
if (s->pw_dir) {
goto no_mem;
if (s->pw_shell) {
goto no_mem;
return (PWU_SUCCESS);
free_pwd(*d);
*d = NULL;
return (PWU_NOMEM);
if (s == NULL) {
*d = NULL;
return (PWU_NOT_FOUND);
return (PWU_NOMEM);
if (s->sp_namp)
goto no_mem;
if (s->sp_pwdp)
goto no_mem;
return (PWU_SUCCESS);
free_spwd(*d);
return (PWU_NOMEM);
int minweeks;
int maxweeks;
int warnweeks;
void *defp;
int val;
void *defp;
return (val);