--- old/usr/src/lib/libnisdb/Makefile	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/Makefile	Fri Jul 24 12:28:10 2015
@@ -19,6 +19,7 @@
 # CDDL HEADER END
 #
 #
+# Copyright 2015 Gary Mills
 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
 # Use is subject to license terms.
 #
@@ -134,18 +135,44 @@
 $(LARGEPICS) :=	sparc_C_PICFLAGS = $(C_BIGPICFLAGS)
 $(LARGEPICS) :=	i386_C_PICFLAGS = $(C_BIGPICFLAGS)
 
+# More and stricter semantic checks and lint-like checks
+CFLAGS	+=	$(CCVERBOSE)
+
 CPPFLAGS +=	-D_REENTRANT
 
-CERRWARN +=	-_gcc=-Wno-unused-variable
-CERRWARN +=	-_gcc=-Wno-unused-value
+# Have an unused variable that can't be removed
+UVAR_PICS = \
+pics/db_dictionary_c_xdr.o \
+pics/db_dictlog_c_xdr.o \
+pics/db_entry_c_xdr.o \
+pics/db_index_c_xdr.o \
+pics/db_item_c_xdr.o \
+pics/db_log_entry_c_xdr.o \
+pics/db_mindex_c_xdr.o \
+pics/db_query_c_xdr.o \
+pics/db_scheme_c_xdr.o \
+pics/db_table_c_xdr.o \
+pics/db_vers_c_xdr.o \
+pics/ldap_xdr.o \
+pics/dit_access.o \
+pics/update.o \
+pics/yptol_utils.o \
+pics/map_ctrl.o
+
+$(UVAR_PICS) := CERRWARN += -_gcc=-Wno-unused-variable
+
+# Correcting these might alter logic
 CERRWARN +=	-_gcc=-Wno-uninitialized
-CERRWARN +=	-_gcc=-Wno-implicit-function-declaration
 CERRWARN +=	-_gcc=-Wno-switch
-CERRWARN +=	-_gcc=-Wno-parentheses
 
 # Extra includes, from yp, for yptol files.
 CPPFLAGS += -I$(SRC)/cmd/ypcmd
 
+# Need the path to nis_clnt.h
+CLNT_PICS = pics/db_entry_c_xdr.o pics/ldap_xdr.o pics/db_mindex_c_xdr.o
+
+$(CLNT_PICS) := CPPFLAGS += -I../libnsl/nis/gen
+
 LIBS = $(DYNLIB)
 ZDEFS=
 LDLIBS += -lnsl -lldap -lc
--- old/usr/src/lib/libnisdb/db_dictionary_c.x	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_dictionary_c.x	Fri Jul 24 12:28:10 2015
@@ -22,11 +22,14 @@
 /*
  *	db_dictionary_c.x
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
  
-%#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#if RPC_XDR
+%#include "xdr_nullptr.h"
+#endif /* RPC_XDR */
  
 #if RPC_HDR
 %#ifndef _DB_DICTIONARY_H
--- old/usr/src/lib/libnisdb/db_dictxdr.c	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_dictxdr.c	Fri Jul 24 12:28:10 2015
@@ -22,13 +22,13 @@
 /*
  *	db_dictxdr.c
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include "db_dictionary_c.h"
+#include "db_dictionary.h"
 #include "db_vers_c.h"
 
 extern vers db_update_version;
--- old/usr/src/lib/libnisdb/db_entry_c.x	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_entry_c.x	Fri Jul 24 12:28:10 2015
@@ -22,12 +22,11 @@
 /*
  *	db_entry_c.x
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-%#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * Some manifest constants, chosen to maximize flexibility without
  * plugging the wire full of data.
@@ -40,6 +39,10 @@
 %#include <rpcsvc/nis.h>
 #endif /* RPC_HDR */
 
+#if RPC_XDR
+%#include "nis_clnt.h"
+#endif /* RPC_XDR */
+
 #ifdef USINGC
 enum db_status {DB_SUCCESS, DB_NOTFOUND, DB_NOTUNIQUE,
 		DB_BADTABLE, DB_BADQUERY, DB_BADOBJECT,
--- old/usr/src/lib/libnisdb/db_index_c.x	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_index_c.x	Fri Jul 24 12:28:10 2015
@@ -21,10 +21,15 @@
 /*
  *	db_index_c.x
  *
+ *  Copyright 2015 Gary Mills
  *  Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  *  Use is subject to license terms.
  */
 
+#if RPC_XDR
+%#include "ldap_xdr.h"
+#endif /* RPC_XDR */
+
 #if RPC_HDR
 %#ifndef _DB_INDEX_H
 %#define _DB_INDEX_H
--- old/usr/src/lib/libnisdb/db_index_entry_c.c	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_index_entry_c.c	Fri Jul 24 12:28:10 2015
@@ -19,13 +19,16 @@
  *
  * CDDL HEADER END
  */
+
 /*
+ * Copyright 2015 Gary Mills
+ */
+
+/*
  * This is a non-recursive version of XDR routine used for db_index_entry
  * type.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/types.h>
 #include <sys/syslog.h>
 #include <stdio.h>
@@ -34,6 +37,7 @@
 #include <memory.h>
 #include "db_index_entry_c.h"
 #include "db_table_c.h"
+#include "xdr_nullptr.h"
 
 bool_t
 xdr_db_index_entry(xdrs, objp)
--- old/usr/src/lib/libnisdb/db_mindex3.cc	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_mindex3.cc	Fri Jul 24 12:28:10 2015
@@ -19,8 +19,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2015 RackTop Systems.
  */
 
 #include <sys/types.h>
@@ -214,7 +217,7 @@
 			logmsg(MSG_NOTIMECHECK, LOG_WARNING,
 			"%s: Error %d creating new thread; using current one",
 				myself, stat);
-			stat = (int)entriesFromLDAPthread(arg);
+			stat = entriesFromLDAPreal(arg);
 			return (stat);
 		}
 
@@ -257,7 +260,7 @@
 #endif	/* FORCE_SYNCHRONOUS */
 	} else {
 		(void) mutex_unlock(&table->mapping.enumLock);
-		stat = (int)entriesFromLDAPthread(arg);
+		stat = entriesFromLDAPreal(arg);
 	}
 
 	return (stat);
@@ -273,7 +276,6 @@
 static void *
 entriesFromLDAPthread(void *voidarg) {
 	__entries_from_ldap_arg_t	*arg;
-	int				stat;
 	db				*dbase;
 	db_table_desc			*tbl = 0;
 	char				*tableName;
@@ -311,7 +313,7 @@
 		tableName = 0;
 	}
 
-	stat = entriesFromLDAPreal(arg);
+	(void) entriesFromLDAPreal(arg);
 
 	(void) __nis_ulock_db_table(arg->tableName, 1, 0,
 					"entriesFromLDAPthread");
@@ -320,7 +322,7 @@
 	if (arg->dirObj != 0)
 		nis_destroy_object(arg->dirObj);
 	sfree(arg);
-	return ((void *)stat);
+	return (NULL);
 }
 
 }
--- old/usr/src/lib/libnisdb/db_mindex_c.x	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_mindex_c.x	Fri Jul 24 12:28:10 2015
@@ -21,10 +21,16 @@
 /*
  *	db_mindex_c.x
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
+#if RPC_XDR
+%#include "ldap_xdr.h"
+%#include "nis_clnt.h"
+#endif /* RPC_XDR */
+
 #if RPC_HDR
 %#ifndef _DB_MINDEX_H
 %#define _DB_MINDEX_H
@@ -89,7 +95,6 @@
 };
 typedef struct xdr_nis_object_s	xdr_nis_object_t;
 
-%extern bool_t	xdr_nis_object();
 #endif /* USINGC */
 #endif /* RPC_HDR */
 
@@ -106,8 +111,6 @@
 %};
 %typedef struct xdr_nis_object_s	xdr_nis_object_t;
 %
-%extern bool_t	xdr_nis_object();
-%
 %class db_mindex {
 %  vers rversion;
 %//  int num_indices;
--- old/usr/src/lib/libnisdb/db_scheme_c.x	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_scheme_c.x	Fri Jul 24 12:28:10 2015
@@ -22,11 +22,14 @@
 /*
  *	db_scheme_c.x
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-%#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#if RPC_XDR
+%#include "ldap_xdr.h"
+#endif /* RPC_XDR */
 
 #if RPC_HDR
 %#ifndef _DB_SCHEMA_H
--- old/usr/src/lib/libnisdb/db_table.cc	Fri Jul 24 12:28:10 2015
+++ new/usr/src/lib/libnisdb/db_table.cc	Fri Jul 24 12:28:10 2015
@@ -24,6 +24,8 @@
  *
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2015 RackTop Systems.
  */
 
 #include <stdio.h>
@@ -74,7 +76,7 @@
 	(void) memcpy(&maxTimeT, b, sizeof (time_t));
 
 	if (maxTimeT < 1)
-		maxTimeT = ~(1<<((8*sizeof (maxTimeT))-1));
+		maxTimeT = ~(1L<<((8*sizeof (maxTimeT))-1));
 }
 #pragma init(__setMaxTimeT)
 }
--- old/usr/src/lib/libnisdb/db_vers_c.x	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/db_vers_c.x	Fri Jul 24 12:28:11 2015
@@ -22,11 +22,14 @@
 /*
  *	db_vers_c.x
  *
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-%#pragma ident	"%Z%%M%	%I%	%E% SMI"
+#if RPC_XDR
+%#include "ldap_xdr.h"
+#endif /* RPC_XDR */
 
 #if RPC_HDR
 %#ifndef _DB_VERS_H
--- old/usr/src/lib/libnisdb/ldap_attr.c	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/ldap_attr.c	Fri Jul 24 12:28:11 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2001-2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <sys/systeminfo.h>
 #include <strings.h>
 #include <rpcsvc/nis.h>
@@ -215,7 +214,7 @@
 	}
 	for (s = c = 0; s < len; s = e+1) {
 		/* Skip blank space, if any */
-		for (0; str[s] == ' ' || str[s] == '\t'; s++);
+		for (; str[s] == ' ' || str[s] == '\t'; s++);
 		/* Find delimiter (comma) or end of string */
 		for (e = s; str[e] != '\0' && str[e] != ','; e++);
 		str[e] = '\0';
@@ -285,7 +284,7 @@
 			return (0);
 		for (s = 2; s < len; s = e+1) {
 			/* Skip past the '(' */
-			for (0; s < len && str[s] != '('; s++);
+			for (; s < len && str[s] != '('; s++);
 			s++;
 			if (s >= len)
 				break;
--- old/usr/src/lib/libnisdb/ldap_map.c	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/ldap_map.c	Fri Jul 24 12:28:11 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -1240,7 +1241,7 @@
 			int wantWrite, int wantObj, char *dbId,
 			int *numMatches) {
 	__nis_table_mapping_t	*r, *x, **tp;
-	int			i, j, k, nm, numap;
+	int			i, nm, numap;
 	char			*myself = "selectTableMapping";
 
 	if (numMatches == 0)
@@ -1419,8 +1420,6 @@
 int
 objToLDAP(__nis_table_mapping_t *t, nis_object *o, entry_obj **ea, int numEa) {
 	__nis_table_mapping_t	**tp;
-	XDR			xdr;
-	char			*objName;
 	int			stat, osize, n, numMatches = 0;
 	void			*buf;
 	__nis_rule_value_t	*rv;
@@ -1545,7 +1544,6 @@
 objFromLDAP(__nis_table_mapping_t *t, nis_object **obj,
 		entry_obj ***eaP, int *numEaP) {
 	__nis_table_mapping_t	**tp;
-	XDR			xdr;
 	nis_object		*o;
 	__nis_rule_value_t	*rv;
 	__nis_ldap_search_t	*ls;
--- old/usr/src/lib/libnisdb/ldap_nisdbquery.c	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/ldap_nisdbquery.c	Fri Jul 24 12:28:11 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -41,6 +42,7 @@
 #include "ldap_nisdbquery.h"
 #include "ldap_attr.h"
 #include "ldap_xdr.h"
+#include "ldap_ldap.h"
 
 
 item *
@@ -224,7 +226,7 @@
 		__nis_rule_value_t **rvP, int *numVals) {
 	db_query		**q;
 	db_qcomp		*qc;
-	int			i, j, n, a, nv, niv, stat, sinum;
+	int			i, j, n, a, nv, niv;
 	__nis_rule_value_t	*rvq;
 	__nis_buffer_t		b = {0, 0};
 	char			*table = 0;
@@ -257,7 +259,6 @@
 
 	/* Create a rule-value from the col=val pairs */
 	for (n = 0; n < num; n++) {
-		char	*name;
 		char	*value;
 
 		if ((value = strchr(index[n], '=')) == 0) {
@@ -272,7 +273,6 @@
 
 		for (a = 0; a < t->numColumns; a++) {
 			if (strcmp(index[n], t->column[a]) == 0) {
-				int		i, len = slen(value)+1;
 
 				/* Add col=val pair to 'rvq' */
 				if (addSCol2RuleValue(index[n], value, rvq)) {
@@ -692,7 +692,7 @@
 	__nis_value_t		*rval, *lval;
 	__nis_mapping_item_t	*litem;
 	int			numItems;
-	int			nq, iqc;
+	int			nq;
 	__nis_obj_attr_t	**attr = 0;
 	char			**dn = 0;
 	int			numDN = 0;
--- old/usr/src/lib/libnisdb/ldap_op.c	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/ldap_op.c	Fri Jul 24 12:28:11 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -515,7 +516,6 @@
 	int			derefOption = LDAP_DEREF_ALWAYS;
 	int			timelimit = proxyInfo.search_time_limit;
 	int			sizelimit = proxyInfo.search_size_limit;
-	char			*myself = "ldapInit";
 
 	if (srv == 0)
 		return (0);
@@ -618,7 +618,6 @@
  */
 static int
 freeCon(__nis_ldap_conn_t *lc) {
-	char			*myself = "freeCon";
 
 	if (!assertExclusive(lc))
 		return (LDAP_PARAM_ERROR);
@@ -1034,7 +1033,7 @@
 	}
 
 	/* Remove leading white space */
-	for (0; *sl == ' ' || *sl == '\t'; sl++);
+	for (; *sl == ' ' || *sl == '\t'; sl++);
 
 	/* Create connection for each server on the list */
 	for (s = sl; *s != '\0'; s = e+1) {
@@ -2227,7 +2226,6 @@
 	__nis_ldap_conn_t	*lc;
 	struct timeval		tv;
 	LDAPMessage		*msg = 0;
-	char			*myself = "ldapModify";
 	int			msgid;
 	int			lderr;
 	char			**referralsp = NULL;
--- old/usr/src/lib/libnisdb/ldap_ruleval.c	Fri Jul 24 12:28:11 2015
+++ new/usr/src/lib/libnisdb/ldap_ruleval.c	Fri Jul 24 12:28:11 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -109,7 +110,7 @@
 growRuleValue(int oldCount, int newCount, __nis_rule_value_t *old,
 		__nis_rule_value_t *rvIn) {
 	__nis_rule_value_t	*rv;
-	int			i, j;
+	int			i;
 	char			*myself = "growRuleValue";
 
 	if (newCount <= 0 || newCount <= oldCount)
@@ -425,8 +426,6 @@
 buildNisPlusRuleValue(__nis_table_mapping_t *t, db_query *q,
 			__nis_rule_value_t *rv) {
 	int			i;
-	__nis_single_value_t	*sv;
-	char			*myself = "buildNisPlusRuleValue";
 
 	if (t == 0 || q == 0)
 		return (0);
@@ -436,9 +435,6 @@
 		return (0);
 
 	for (i = 0; i < q->components.components_len; i++) {
-		int	ic;
-		int	iv, v, dup;
-		int	len;
 
 		/* Ignore out-of-range column index */
 		if (q->components.components_val[i].which_index >=
@@ -617,9 +613,7 @@
 			__nis_rule_value_t *rv,
 			int doAssign, int *stat) {
 	int			i, j;
-	char			**new;
 	__nis_value_t		*rval, *lval;
-	__nis_buffer_t		b = {0, 0};
 	__nis_mapping_item_t	*litem;
 	int			numItems;
 	char			**dn = 0;
@@ -745,7 +739,7 @@
 		/* If we're out of values, repeat the last one */
 		if (j >= rval->numVals)
 			j = (rval->numVals > 0) ? rval->numVals-1 : 0;
-		for (0; j < rval->numVals; j++) {
+		for (; j < rval->numVals; j++) {
 			/*
 			 * If this is the 'dn', and the value ends in a
 			 * comma, append the appropriate search base.
--- old/usr/src/lib/libnisdb/ldap_val.c	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/ldap_val.c	Fri Jul 24 12:28:12 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -2090,7 +2091,7 @@
 matchMappingItem(__nis_mapping_format_t *f, __nis_value_t *inVal,
 		int *numVals, char *sepset, char **outstr) {
 	__nis_value_t		**v = 0;
-	int			i, n, ni, numItems, nf, nv = 0;
+	int			i, n, ni, numItems, nf;
 	char			*str, *valstr;
 	__nis_mapping_format_t	*ftmp;
 	char			*myself = "matchMappingItem";
--- old/usr/src/lib/libnisdb/ldap_xdr.c	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/ldap_xdr.c	Fri Jul 24 12:28:12 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright (c) 2001 by Sun Microsystems, Inc.
  * All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <string.h>
 #include <sys/syslog.h>
 #include <sys/types.h>
@@ -38,7 +37,7 @@
 #include "ldap_xdr.h"
 #include "ldap_util.h"
 
-extern bool_t xdr_nis_object();
+#include "nis_clnt.h"
 
 /*
  * In order not to change the on-disk NIS+ DB format, we need make sure
--- old/usr/src/lib/libnisdb/ldap_xdr.h	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/ldap_xdr.h	Fri Jul 24 12:28:12 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright (c) 2001 by Sun Microsystems, Inc.
  * All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #ifndef	_LDAP_XDR_H
 #define	_LDAP_XDR_H
 
@@ -60,6 +59,10 @@
 void		freeEntryObjArray(entry_obj **ea, int numEa);
 bool_t		sameNisPlusObj(nis_object *o1, nis_object *o2);
 bool_t		sameNisPlusPseudoObj(nis_object *o1, entry_obj *e2);
+bool_t		xdr___nisdb_rwlock_t(XDR *, void *);
+bool_t		xdr___nisdb_flag_t(XDR *, void *);
+bool_t		xdr___nisdb_ptr_t(XDR *, void *);
+bool_t		xdr___nis_table_mapping_t(XDR *, void *);
 
 #ifdef	__cplusplus
 }
--- old/usr/src/lib/libnisdb/nis_db.cc	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/nis_db.cc	Fri Jul 24 12:28:12 2015
@@ -23,6 +23,8 @@
  *
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
+ *
+ * Copyright 2015 RackTop Systems.
  */
 
 
@@ -144,7 +146,7 @@
 bool_t
 db_in_dict_file(char *name)
 {
-	return ((bool_t) InUseDictionary->find_table_desc(name));
+	return (InUseDictionary->find_table_desc(name) != NULL);
 
 }
 
--- old/usr/src/lib/libnisdb/nis_parse_ldap_conf.c	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_conf.c	Fri Jul 24 12:28:12 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -84,7 +85,12 @@
 	__nis_config_t *nis_config, __nis_config_info_t *config_info,
 	__nisdb_table_mapping_t *table_info);
 
+/* Forward declarations */
+int yp_parse_ldap_config_file(const char *, __nis_ldap_proxy_info *,
+    __nis_config_t *, __nis_table_mapping_t **, __nis_config_info_t *,
+    __nisdb_table_mapping_t *, 	__yp_domain_context_t *);
 
+
 /* helper functions */
 static config_key get_attrib_num_cmdline(const char *s,
     const char **begin_s, const char **end_s);
@@ -128,7 +134,6 @@
 					(tls_method_t)NO_VALUE_SET, NULL,
 					NULL, NULL};
 	struct stat		buf;
-	int i = 0;
 
 	p_error = no_parse_error;
 
@@ -412,7 +417,7 @@
 	char		*attr_val;
 	int		defflags;
 	config_key	attrib_num;
-	int 	i, len, attr_len;
+	int 		i, len;
 	void		*defp;
 
 	if ((defp = defopen_r(YP_ETCCONFFILE)) != NULL) {
@@ -646,7 +651,6 @@
 	__yp_domain_context_t	*ypDomains)
 {
 	int	rc = 0;
-	int	numDomains = 0;
 	config_key	attrib_num;
 	int	fd;
 	char	*attr_val = NULL;
@@ -733,7 +737,6 @@
 	char		*attribute_value;
 	int		ret;
 	config_key	attrib_num = no_more_keys;
-	int		found_quote = 0;
 
 	*attr_val = NULL;
 
@@ -808,7 +811,6 @@
 	int			server_port,
 	__nis_config_info_t	*config_info)
 {
-	int		rc		= 0;
 	LDAP		*ld		= NULL;
 	int		ldapVersion	= LDAP_VERSION3;
 	int		derefOption	= LDAP_DEREF_ALWAYS;
--- old/usr/src/lib/libnisdb/nis_parse_ldap_map.c	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_map.c	Fri Jul 24 12:28:12 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2001-2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -36,6 +35,8 @@
 
 #include "ldap_parse.h"
 #include "nis_parse_ldap_conf.h"
+#include "nis_parse_ldap_yp_util.h"
+#include "nis_parse_ldap_util.h"
 
 /* other attribute functions */
 static char *getIndex(const char **s_cur, const char *end_s);
@@ -93,7 +94,6 @@
 	const char		*attrib_end;
 	const char		*db_id_end;
 	const char		*begin_token;
-	const char		*end_token;
 	char			*index_string;
 	__nis_object_dn_t	*objectDN;
 	__nis_table_mapping_t	*t_mapping;
@@ -378,9 +378,6 @@
 	const char 		*s;
 	const char		*attrib_end;
 	int				numDomains = 0;
-	int 			i;
-	char			*tmp_str;
-	int				ret = 0;
 
 	attrib_end = attrib_val + attrib_len;
 	for (s = attrib_val; s < attrib_end; s++) {
@@ -1511,8 +1508,8 @@
 				}
 
 				if (end_token == begin_token + 1 ||
-				    *begin_token == ESCAPE_CHAR &&
-				    end_token == begin_token + 2) {
+				    (*begin_token == ESCAPE_CHAR &&
+				    end_token == begin_token + 2)) {
 					e->type = me_split;
 					e->element.split.item = item;
 					e->element.split.delim = *begin_token;
@@ -1652,9 +1649,9 @@
 			end_token = end_s;
 			s = get_next_token(&begin_token, &end_token, &t);
 			if (s != NULL && t == quoted_string_token &&
-				(end_token == begin_token + 1 ||
-				    *begin_token == ESCAPE_CHAR &&
-				    end_token == begin_token + 2)) {
+			    (end_token == begin_token + 1 ||
+			    (*begin_token == ESCAPE_CHAR &&
+			    end_token == begin_token + 2))) {
 				if (numSubElements != 1 ||
 				    subElement->type == me_extract ||
 				    subElement->type == me_split) {
@@ -2067,8 +2064,8 @@
 				break;
 			}
 			if (end_token == begin_token + 1 ||
-			    *begin_token == ESCAPE_CHAR &&
-			    end_token == begin_token + 2) {
+			    (*begin_token == ESCAPE_CHAR &&
+			    end_token == begin_token + 2)) {
 					/* me_split */
 				delim = (unsigned char)end_token[-1];
 				s = skip_token(s, end_s, close_paren_token);
--- old/usr/src/lib/libnisdb/nis_parse_ldap_util.c	Fri Jul 24 12:28:12 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_util.c	Fri Jul 24 12:28:12 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -61,6 +60,7 @@
 	__nis_mapping_format_t *in);
 bool_t dup_mapping_element(__nis_mapping_element_t *in,
 	__nis_mapping_element_t *out);
+bool_t is_string_ok(char *, int);
 
 extern FILE *cons;
 
--- /dev/null	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_util.h	Fri Jul 24 12:28:13 2015
@@ -0,0 +1,44 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 Gary Mills
+ */
+
+#ifndef _NIS_PARSE_LDAP_UTIL_H
+#define	_NIS_PARSE_LDAP_UTIL_H
+
+/*
+ * Functions defined in nis_parse_ldap_util.c needed elsewhere
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern void *s_malloc(size_t);
+extern bool_t add_column(__nis_table_mapping_t *, const char *);
+extern bool_t dup_index(__nis_index_t *, __nis_index_t *);
+extern bool_t dup_mapping_element(__nis_mapping_element_t *,
+    __nis_mapping_element_t *);
+extern bool_t make_fqdn(__nis_object_dn_t *, const char *);
+extern bool_t make_full_dn(char **, const char *);
+extern void append_dot(char **);
+extern void append_comma(char **);
+extern __nis_mapping_rule_t **dup_mapping_rules(__nis_mapping_rule_t **,
+    int n_rules);
+extern __nis_mapping_rule_t *dup_mapping_rule(__nis_mapping_rule_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _NIS_PARSE_LDAP_UTIL_H */
--- old/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.c	Fri Jul 24 12:28:13 2015
@@ -20,6 +20,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -34,13 +35,14 @@
 
 #include "ldap_parse.h"
 #include "nis_parse_ldap_conf.h"
-#include "nis_parse_ldap_err.h"
+#include "nis_parse_ldap_util.h"
 #include "ldap_util.h"
 
-extern __nis_mapping_rule_t **dup_mapping_rules(
-	__nis_mapping_rule_t **rules, int n_rules);
-extern __nis_mapping_rule_t *dup_mapping_rule(
-	__nis_mapping_rule_t *in);
+/* Forward declarations */
+int getfullmapname(char **, const char *);
+int checkfullmapname(const char *, const char *, __nis_table_mapping_t **,
+    __nis_table_mapping_t **);
+int append_domainContext(__nis_table_mapping_t **, char *, char *);
 
 static int	merge_table_mapping(__nis_table_mapping_t *in,
 	__nis_table_mapping_t *out);
@@ -138,7 +140,6 @@
 	__nis_table_mapping_t *out)
 {
 	int i;
-	int len;
 	int orig_num_rules;
 	int append;
 
@@ -434,7 +435,6 @@
 	__nis_table_mapping_t   *t, *t2;
 	__nis_table_mapping_t   *t_new = NULL, *tg;
 	__nis_table_mapping_t	*prev = NULL;
-	__nis_object_dn_t   *objectDN;
 	char	*objs, *dom;
 	char	*objName = NULL;
 	char	*lasts;
@@ -441,8 +441,6 @@
 	char	*tobj, *alias, *dupalias, *tmp;
 	char	*myself = "second_parser_pass";
 	int	i = 0, len;
-	int	remove_t = 0;
-	int	add_t = 0;
 
 	prev = NULL;
 	for (t = *table_mapping; t != NULL; ) {
--- /dev/null	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/nis_parse_ldap_yp_util.h	Fri Jul 24 12:28:13 2015
@@ -0,0 +1,35 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 Gary Mills
+ */
+
+#ifndef _NIS_PARSE_LDAP_YP_UTIL_H
+#define	_NIS_PARSE_LDAP_YP_UTIL_H
+
+/*
+ * Functions defined in nis_parse_ldap_yp_util.c needed elsewhere
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern int check_domain_specific_order(const char *, config_key,
+    __nis_table_mapping_t *, __yp_domain_context_t *);
+extern void initialize_table_mapping(__nis_table_mapping_t *);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _NIS_PARSE_LDAP_YP_UTIL_H */
--- old/usr/src/lib/libnisdb/nisdb_rw.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/nisdb_rw.c	Fri Jul 24 12:28:13 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright (c) 2001 by Sun Microsystems, Inc.
  * All rights reserved.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 #include <stdio.h>
 #include <rpc/types.h>
 #include <rpc/xdr.h>
@@ -107,8 +106,6 @@
 int
 __nisdb_rw_readlock_ok(__nisdb_rwlock_t *rw) {
 	int		ret;
-	pthread_t	myself = pthread_self();
-	__nisdb_rl_t	*rr;
 
 	if (rw == 0)
 		return (EFAULT);
@@ -139,8 +136,6 @@
 int
 __nisdb_rw_force_writelock(__nisdb_rwlock_t *rw) {
 	int		ret;
-	pthread_t	myself = pthread_self();
-	__nisdb_rl_t	*rr;
 
 	if (rw == 0 || rw->destroyed != 0)
 		return (ESHUTDOWN);
@@ -206,7 +201,7 @@
 	 */
 	if (rw->reader_count > 0) {
 		if ((rr = find_reader(myself, rw)) != 0) {
-			if (rr->count)
+			if (rr->count) {
 				/*
 				 * We're already holding a read lock, so
 				 * if the number of readers equals the number
@@ -216,7 +211,7 @@
 				if (rw->reader_count ==
 						(rw->reader_blocked + 1))
 					all_readers_blocked = 1;
-			else
+			} else {
 				/*
 				 * We're not holding a read lock, so the
 				 * number of readers should equal the number
@@ -225,6 +220,7 @@
 				 */
 				if (rw->reader_count == rw->reader_blocked)
 					all_readers_blocked = 1;
+			}
 		}
 	}
 
@@ -239,11 +235,11 @@
 		 *		- N readers, but all blocked on the mutex
 		 */
 		if (
-			(rw->writer_count == 0 && rw->reader_count == 0) ||
-			((rw->writer_count == 0 || rw->writer.id == myself) &&
-				(rw->reader_count == 0) ||
-				(rw->reader_count == 1 &&
-					rw->reader.id == myself))) {
+		    (rw->writer_count == 0 && rw->reader_count == 0) ||
+		    (((rw->writer_count == 0 || rw->writer.id == myself) &&
+		    (rw->reader_count == 0)) ||
+		    (rw->reader_count == 1 &&
+		    rw->reader.id == myself))) {
 			break;
 		}
 		/*
@@ -648,7 +644,6 @@
 
 	int		ret;
 	pthread_t	myself = pthread_self();
-	__nisdb_rl_t	*rr;
 
 
 	if (rw == 0) {
@@ -674,12 +669,12 @@
 	 * other than this thread. Also, no nested locks may be in
 	 * effect.
 	 */
-	if ((rw->writer_count > 0 &&
-			(rw->writer.id != myself || rw->writer.count != 1) ||
-		(rw->reader_count > 0 &&
-			!(rw->reader_count == 1 && rw->reader.id == myself &&
-				rw->reader.count == 1))) ||
-		(rw->writer_count > 0 && rw->reader_count > 0)) {
+	if (((rw->writer_count > 0 &&
+	    (rw->writer.id != myself || rw->writer.count != 1)) ||
+	    (rw->reader_count > 0 &&
+	    !(rw->reader_count == 1 && rw->reader.id == myself &&
+	    rw->reader.count == 1))) ||
+	    (rw->writer_count > 0 && rw->reader_count > 0)) {
 #ifdef	NISDB_MT_DEBUG
 		abort();
 #endif	/* NISDB_MT_DEBUG */
--- /dev/null	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/xdr_nullptr.h	Fri Jul 24 12:28:13 2015
@@ -0,0 +1,34 @@
+/*
+ * This file and its contents are supplied under the terms of the
+ * Common Development and Distribution License ("CDDL"), version 1.0.
+ * You may only use this file in accordance with the terms of version
+ * 1.0 of the CDDL.
+ *
+ * A full copy of the text of the CDDL should have accompanied this
+ * source.  A copy of the CDDL is also available via the Internet at
+ * http://www.illumos.org/license/CDDL.
+ */
+
+/*
+ * Copyright 2015 Gary Mills
+ */
+
+#ifndef _XDR_NULLPTR_H
+#define	_XDR_NULLPTR_H
+
+/*
+ * This function is used to control serializing and de-serializing of the
+ * database objects.
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern bool_t xdr_nullptr(XDR *, void **);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* _XDR_NULLPTR_H */
--- old/usr/src/lib/libnisdb/yptol/dit_access_utils.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/yptol/dit_access_utils.c	Fri Jul 24 12:28:13 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved.
  */
 
@@ -37,6 +38,7 @@
 #include <ndbm.h>
 #include <strings.h>
 #include <errno.h>
+#include <ctype.h>
 #include "../ldap_util.h"
 #include "../ldap_map.h"
 #include "../ldap_parse.h"
@@ -124,11 +126,9 @@
 
 	char			*sepset;
 	__nis_rule_value_t	*rvq;
-	__nis_mapping_format_t  *ftmp;
 	__nis_value_t		**valA, *tempVal;
 	int			i, j, res, numVals, oldlen, count;
 	char			*str, *oldstr;
-	char			*myself = "processSplitField";
 
 	/* sf will be non NULL */
 
@@ -254,7 +254,7 @@
 	__nis_value_t		**valA;
 	__nis_table_mapping_t	*sf;
 	int			valueLen, comLen, numVals, nr, count = 1;
-	int			i, j, k, l, af;
+	int			i, j, k, l;
 	char			*ipaddr, *ipvalue;
 
 	/*  At this point, 't' is always non NULL */
@@ -645,7 +645,7 @@
 suc_code
 buildNISRuleValue(__nis_table_mapping_t *t, __nis_rule_value_t *rv,
 					char *domain) {
-	int			r, i, j, k, l, index, nrq, res, len;
+	int			r, i, j, k, l, nrq, res, len;
 	int			numItems, splitname, count, statP;
 	__nis_value_t		*rval;
 	__nis_mapping_item_t	*litem;
@@ -1010,9 +1010,9 @@
 	__nis_rule_value_t	*rv_request = 0, *rv_result = 0;
 	__nis_ldap_search_t	*ls;
 	__nis_object_dn_t	*objectDN = NULL;
-	int			i, rc, nr = 0, nv = 0;
+	int			i, rc, nr = 0;
 	datum			*datval = 0;
-	char			*skey, *str, *sipkey;
+	char			*skey, *str;
 	char			*myself = "singleReadFromDIT";
 
 	*statP = SUCCESS;
--- old/usr/src/lib/libnisdb/yptol/lock_update.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/yptol/lock_update.c	Fri Jul 24 12:28:13 2015
@@ -20,12 +20,11 @@
  */
 
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains code supporting the 'update in progress' flag. This is
  *		a near copy of lock flag code (in
@@ -76,8 +75,8 @@
 	 * Initialize cross-process locks in memory-mapped file.
 	 */
 	for (iiter = 0; iiter < MAXHASH; iiter++) {
-		if (rc = mutex_init(&(shmupdatearray->updatenode[iiter]),
-		    USYNC_PROCESS | LOCK_ROBUST, 0)) {
+		if ((rc = mutex_init(&(shmupdatearray->updatenode[iiter]),
+		    USYNC_PROCESS | LOCK_ROBUST, 0)) != 0) {
 			if (rc == EBUSY) {
 				ebusy_cnt++;
 			} else {
--- old/usr/src/lib/libnisdb/yptol/map_conv.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/yptol/map_conv.c	Fri Jul 24 12:28:13 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains functions relating to movement of entire maps.
  */
@@ -44,7 +43,6 @@
  * Switch on parts of ypdefs.h
  */
 USE_YPDBPATH
-USE_DBM
 
 /*
  * Decs
--- old/usr/src/lib/libnisdb/yptol/shim.c	Fri Jul 24 12:28:13 2015
+++ new/usr/src/lib/libnisdb/yptol/shim.c	Fri Jul 24 12:28:13 2015
@@ -19,12 +19,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains the top level shim hook functions. These must have
  *		identical interfaces to the equivalent standard dbm calls.
@@ -51,6 +50,7 @@
 #include "ypdefs.h"
 #include "shim.h"
 #include "yptol.h"
+#include "stubs.h"
 #include "../ldap_parse.h"
 #include "../ldap_util.h"
 
--- old/usr/src/lib/libnisdb/yptol/shim_ancil.c	Fri Jul 24 12:28:14 2015
+++ new/usr/src/lib/libnisdb/yptol/shim_ancil.c	Fri Jul 24 12:28:14 2015
@@ -19,6 +19,7 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
@@ -31,12 +32,6 @@
  * under license from the Regents of the University of California.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
-#ifndef	lint
-static	char sccsid[] = "%Z%%M% %I%     %E% SMI";
-#endif
-
 #include <stdlib.h>
 #include <dirent.h>
 #include <strings.h>
--- old/usr/src/lib/libnisdb/yptol/shim_changepasswd.c	Fri Jul 24 12:28:14 2015
+++ new/usr/src/lib/libnisdb/yptol/shim_changepasswd.c	Fri Jul 24 12:28:14 2015
@@ -19,12 +19,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: This is the N2L equivalent of changepasswd.c. The traditional
  *		version modifies the NIS source files and then initiates a
@@ -70,6 +69,11 @@
 #include "yptol.h"
 #include "../ldap_util.h"
 
+/*
+ * Undocumented external function in libnsl
+ */
+extern int  getdomainname(char *, int);
+
 /* Constants */
 #define	CRYPTPWSIZE CRYPT_MAXCIPHERTEXTLEN
 #define	STRSIZE 100
@@ -433,7 +437,6 @@
 	char	cmdbuf[BUFSIZ];
 	int	map_name_len = 0;
 	int	index, ans = 0;
-	int	res;
 
 	/* If this is a adjunct list check LDAP had some adjunct info */
 	if ((adjunct_flag) && (!pwd->adjunct)) {
@@ -1054,7 +1057,6 @@
 {
 	char *myself = "get_old_info";
 	struct passwd_entry *old_passwd;
-	char	*p;
 	datum	key, data;
 	suc_code res;
 
--- old/usr/src/lib/libnisdb/yptol/shim_lockmap.c	Fri Jul 24 12:28:14 2015
+++ new/usr/src/lib/libnisdb/yptol/shim_lockmap.c	Fri Jul 24 12:28:14 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains a front end to the map locking code. These are called
  *		when a map, or its map_ctrl structure, needs to be locked
@@ -45,6 +44,7 @@
 #include <ndbm.h>
 #include "ypsym.h"
 #include "shim.h"
+#include "stubs.h"
 
 /*
  * FUNCTION : 	lock_map_ctrl()
--- old/usr/src/lib/libnisdb/yptol/ttl_utils.c	Fri Jul 24 12:28:14 2015
+++ new/usr/src/lib/libnisdb/yptol/ttl_utils.c	Fri Jul 24 12:28:14 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains utilities relating to TTL calculation.
  */
@@ -285,7 +284,6 @@
 suc_code
 add_to_timeval(struct timeval *t1, int t2)
 {
-	long usec;
 	struct timeval oldval;
 
 	oldval.tv_sec = t1->tv_sec;
--- old/usr/src/lib/libnisdb/yptol/update.c	Fri Jul 24 12:28:14 2015
+++ new/usr/src/lib/libnisdb/yptol/update.c	Fri Jul 24 12:28:14 2015
@@ -20,12 +20,11 @@
  * CDDL HEADER END
  */
 /*
+ * Copyright 2015 Gary Mills
  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
  * Use is subject to license terms.
  */
 
-#pragma ident	"%Z%%M%	%I%	%E% SMI"
-
 /*
  * DESCRIPTION: Contains the map update thread and related code.
  */
@@ -358,6 +357,8 @@
 	free_map_ctrl(map);
 
 	thr_exit(ret);
+
+	return (NULL);
 }
 
 /*
