--- old/usr/src/cmd/getent/Makefile	2012-10-04 09:42:46.859612043 +0400
+++ new/usr/src/cmd/getent/Makefile	2012-10-04 09:42:46.925916084 +0400
@@ -41,6 +41,7 @@
 	dogetproject.o	\
 	dogetproto.o	\
 	dogetpw.o	\
+	dogetsp.o	\
 	dogetserv.o	\
 	getent.o
 
--- /dev/null	2012-10-04 09:42:48.000000000 +0400
+++ new/usr/src/cmd/getent/dogetsp.c	2012-10-04 09:42:48.298157812 +0400
@@ -0,0 +1,62 @@
+/*
+ * CDDL HEADER START
+ *
+ * The contents of this file are subject to the terms of the
+ * Common Development and Distribution License (the "License").
+ * You may not use this file except in compliance with the License.
+ *
+ * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
+ * or http://www.opensolaris.org/os/licensing.
+ * See the License for the specific language governing permissions
+ * and limitations under the License.
+ *
+ * When distributing Covered Code, include this CDDL HEADER in each
+ * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
+ * If applicable, add the following below this CDDL HEADER, with the
+ * fields enclosed by brackets "[]" replaced with your own identifying
+ * information: Portions Copyright [yyyy] [name of copyright owner]
+ *
+ * CDDL HEADER END
+ */
+
+/*
+ * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
+ * Copyright 2012 Nexenta Systems, Inc. All rights reserved.
+ * Use is subject to license terms.
+ */
+
+#include <stdio.h>
+#include <shadow.h>
+#include <stdlib.h>
+#include <errno.h>
+#include "getent.h"
+
+/*
+ * getspnam - get entries from shadow database
+ */
+int
+dogetsp(const char **list)
+{
+	struct spwd *sp;
+	int rc = EXC_SUCCESS;
+	char *ptr;
+	uid_t uid;
+
+
+	if (list == NULL || *list == NULL) {
+		setspent();
+		while ((sp = getspent()) != NULL)
+			(void) putspent(sp, stdout);
+		endspent();
+	} else {
+		for (; *list != NULL; list++) {
+			sp = getspnam(*list);
+			if (sp == NULL)
+				rc = EXC_NAME_NOT_FOUND;
+			else
+				(void) putspent(sp, stdout);
+		}
+	}
+
+	return (rc);
+}
--- old/usr/src/cmd/getent/getent.c	2012-10-04 09:42:48.839579169 +0400
+++ new/usr/src/cmd/getent/getent.c	2012-10-04 09:42:48.875518328 +0400
@@ -42,6 +42,7 @@
 
 static struct table t[] = {
 	{ "passwd",	dogetpw },
+	{ "shadow",	dogetsp },
 	{ "group",	dogetgr },
 	{ "hosts",	dogethost },
 	{ "ipnodes",	dogetipnodes },
--- old/usr/src/cmd/getent/getent.h	2012-10-04 09:42:49.621936262 +0400
+++ new/usr/src/cmd/getent/getent.h	2012-10-04 09:42:49.664551253 +0400
@@ -42,6 +42,7 @@
 #define	EXC_ENUM_NOT_SUPPORTED	3
 
 extern int dogetpw(const char **);
+extern int dogetsp(const char **);
 extern int dogetgr(const char **);
 extern int dogethost(const char **);
 extern int dogetipnodes(const char **);
--- old/usr/src/man/man1m/getent.1m	2012-10-04 09:42:50.403491863 +0400
+++ new/usr/src/man/man1m/getent.1m	2012-10-04 09:42:50.449537363 +0400
@@ -21,10 +21,10 @@
 .sp
 .LP
 \fIdatabase\fR is the name of the database to be examined. This can be
-\fBpasswd\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
+\fBpasswd\fR, \fBshadow\fR, \fBgroup\fR, \fBhosts\fR, \fBipnodes\fR, \fBservices\fR,
 \fBprotocols\fR, \fBethers\fR, \fBproject\fR, \fBnetworks\fR, or
 \fBnetmasks\fR. For each of these databases, \fBgetent\fR uses the appropriate
-library routines described in \fBgetpwnam\fR(3C), \fBgetgrnam\fR(3C),
+library routines described in \fBgetpwnam\fR(3C), \fBgetspnam\fR(3C), \fBgetgrnam\fR(3C),
 \fBgethostbyaddr\fR(3NSL), \fBgethostbyname\fR(3NSL),
 \fBgetipnodebyaddr\fR(3SOCKET), \fBgetipnodebyname\fR(3SOCKET),
 \fBgetservbyname\fR(3SOCKET), \fBgetprotobyname\fR(3SOCKET),
@@ -41,7 +41,7 @@
 .LP
 \fBgetent\fR prints out the database entries that match each of the supplied
 keys, one per line, in the format of the matching administrative file:
-\fBpasswd\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
+\fBpasswd\fR(4), \fBshadow\fR(4), \fBgroup\fR(4), \fBproject\fR(4), \fBhosts\fR(4),
 \fBservices\fR(4), \fBprotocols\fR(4), \fBethers\fR(3SOCKET),
 \fBnetworks\fR(4), or \fBnetmasks\fR(4). If no key is given, all entries
 returned by the corresponding enumeration library routine, for example,
@@ -151,6 +151,15 @@
 .sp
 .ne 2
 .na
+\fB\fB/etc/shadow\fR\fR
+.ad
+.RS 22n
+shadowed password file
+.RE
+
+.sp
+.ne 2
+.na
 \fB\fB/etc/group\fR\fR
 .ad
 .RS 22n
