--- old/usr/src/lib/smbsrv/libmlsvc/common/libmlsvc.h	Sun Mar 18 01:12:55 2018
+++ new/usr/src/lib/smbsrv/libmlsvc/common/libmlsvc.h	Sun Mar 18 01:12:55 2018
@@ -127,21 +127,6 @@
 	uint32_t high_part;
 } ms_luid_t;
 
-/*
- * Information about a server as reported by NetServerGetInfo.
- * The SV_PLATFORM and SV_TYPE definitions are in srvsvc.ndl.
- */
-typedef struct srvsvc_server_info {
-	uint32_t	sv_platform_id;
-	char		*sv_name;
-	uint32_t	sv_version_major;
-	uint32_t	sv_version_minor;
-	uint32_t	sv_type;
-	char		*sv_comment;
-	uint32_t	sv_os;
-} srvsvc_server_info_t;
-
-int srvsvc_net_server_getinfo(char *, char *, srvsvc_server_info_t *);
 int srvsvc_net_remote_tod(char *, char *, struct timeval *, struct tm *);
 
 
@@ -156,7 +141,6 @@
 typedef struct mlsvc_handle {
 	ndr_hdid_t			handle;
 	ndr_client_t			*clnt;
-	srvsvc_server_info_t		svinfo;
 } mlsvc_handle_t;
 
 void ndr_rpc_init(void);
@@ -165,8 +149,6 @@
 void ndr_rpc_unbind(mlsvc_handle_t *);
 int ndr_rpc_call(mlsvc_handle_t *, int, void *);
 void ndr_rpc_set_nonull(mlsvc_handle_t *);
-const srvsvc_server_info_t *ndr_rpc_server_info(mlsvc_handle_t *);
-uint32_t ndr_rpc_server_os(mlsvc_handle_t *);
 int ndr_rpc_get_ssnkey(mlsvc_handle_t *, unsigned char *, size_t);
 void *ndr_rpc_malloc(mlsvc_handle_t *, size_t);
 ndr_heap_t *ndr_rpc_get_heap(mlsvc_handle_t *);
--- old/usr/src/lib/smbsrv/libmlsvc/common/lsar_clnt.c	Sun Mar 18 01:12:55 2018
+++ new/usr/src/lib/smbsrv/libmlsvc/common/lsar_clnt.c	Sun Mar 18 01:12:55 2018
@@ -383,7 +383,6 @@
 		lsar_lookup_names1
 	};
 
-	const srvsvc_server_info_t	*svinfo;
 	lsa_names_t	names;
 	char		*p;
 	uint32_t	length;
@@ -396,20 +395,15 @@
 
 	bzero(info, sizeof (smb_account_t));
 
-	svinfo = ndr_rpc_server_info(lsa_handle);
-	if (svinfo->sv_os == NATIVE_OS_WIN2000 &&
-	    svinfo->sv_version_major == 5 && svinfo->sv_version_minor == 0) {
-		/*
-		 * Windows 2000 doesn't like an LSA lookup for
-		 * DOMAIN\Administrator.
-		 */
-		if ((p = strchr(name, '\\')) != 0) {
-			++p;
+	/*
+	 * Windows 2000 (or later) doesn't like an LSA lookup for
+	 * DOMAIN\Administrator.
+	 */
+	if ((p = strchr(name, '\\')) != 0) {
+		++p;
 
-			if (strcasecmp(p, "administrator") == 0)
-				name = p;
-		}
-
+		if (strcasecmp(p, "administrator") == 0)
+			name = p;
 	}
 
 	length = smb_wcequiv_strlen(name);
@@ -418,17 +412,12 @@
 	names.name[0].str = (unsigned char *)name;
 	names.n_entry = 1;
 
-	if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000) {
-		for (i = 0; i < n_op; ++i) {
-			ndr_rpc_set_nonull(lsa_handle);
-			status = (*ops[i])(lsa_handle, &names, info);
-
-			if (status != NT_STATUS_INVALID_PARAMETER)
-				break;
-		}
-	} else {
+	for (i = 0; i < n_op; ++i) {
 		ndr_rpc_set_nonull(lsa_handle);
-		status = lsar_lookup_names1(lsa_handle, &names, info);
+		status = (*ops[i])(lsa_handle, &names, info);
+
+		if (status != NT_STATUS_INVALID_PARAMETER)
+			break;
 	}
 
 	if (status == NT_STATUS_SUCCESS) {
@@ -726,10 +715,8 @@
 	smb_sid_tostr(sid, sidbuf);
 	smb_tracef("%s", sidbuf);
 
-	if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000)
-		status = lsar_lookup_sids2(lsa_handle, (lsa_sid_t *)sid,
-		    account);
-	else
+	status = lsar_lookup_sids2(lsa_handle, (lsa_sid_t *)sid, account);
+	if (status == RPC_NT_PROCNUM_OUT_OF_RANGE)
 		status = lsar_lookup_sids1(lsa_handle, (lsa_sid_t *)sid,
 		    account);
 
@@ -1167,8 +1154,7 @@
 	(void) memcpy(&arg.handle, lsa_handle, sizeof (mslsa_handle_t));
 
 	length = smb_wcequiv_strlen(name);
-	if (ndr_rpc_server_os(lsa_handle) == NATIVE_OS_WIN2000)
-		length += sizeof (smb_wchar_t);
+	length += sizeof (smb_wchar_t);
 
 	arg.name.length = length;
 	arg.name.allosize = length;
--- old/usr/src/lib/smbsrv/libmlsvc/common/mlsvc_client.c	Sun Mar 18 01:12:55 2018
+++ new/usr/src/lib/smbsrv/libmlsvc/common/mlsvc_client.c	Sun Mar 18 01:12:55 2018
@@ -86,7 +86,6 @@
 	struct smb_ctx		*ctx = NULL;
 	ndr_client_t		*clnt = NULL;
 	ndr_service_t		*svc;
-	srvsvc_server_info_t	svinfo;
 	DWORD			status;
 	int			fd = -1;
 	int			rc;
@@ -100,19 +99,6 @@
 		return (NT_STATUS_INTERNAL_ERROR);
 
 	/*
-	 * Set the default based on the assumption that most
-	 * servers will be Windows 2000 or later.  This used to
-	 * try to get the actual server version, but that RPC
-	 * is not necessarily allowed anymore, so don't bother.
-	 */
-	bzero(&svinfo, sizeof (srvsvc_server_info_t));
-	svinfo.sv_platform_id = SV_PLATFORM_ID_NT;
-	svinfo.sv_version_major = 5;
-	svinfo.sv_version_minor = 0;
-	svinfo.sv_type = SV_TYPE_DEFAULT;
-	svinfo.sv_os = NATIVE_OS_WIN2000;
-
-	/*
 	 * Some callers pass this when they want a NULL session.
 	 * Todo: have callers pass an empty string for that.
 	 */
@@ -191,7 +177,6 @@
 	 */
 	bzero(&handle->handle, sizeof (ndr_hdid_t));
 	handle->clnt = clnt;
-	bcopy(&svinfo, &handle->svinfo, sizeof (srvsvc_server_info_t));
 
 	/*
 	 * Do the OtW RPC bind.
@@ -303,24 +288,6 @@
 }
 
 /*
- * Return a reference to the server info.
- */
-const srvsvc_server_info_t *
-ndr_rpc_server_info(mlsvc_handle_t *handle)
-{
-	return (&handle->svinfo);
-}
-
-/*
- * Return the RPC server OS level.
- */
-uint32_t
-ndr_rpc_server_os(mlsvc_handle_t *handle)
-{
-	return (handle->svinfo.sv_os);
-}
-
-/*
  * Get the session key from a bound RPC client handle.
  *
  * The key returned is the 16-byte "user session key"
@@ -421,7 +388,6 @@
 ndr_inherit_handle(mlsvc_handle_t *child, mlsvc_handle_t *parent)
 {
 	child->clnt = parent->clnt;
-	bcopy(&parent->svinfo, &child->svinfo, sizeof (srvsvc_server_info_t));
 }
 
 void
--- old/usr/src/lib/smbsrv/libmlsvc/common/netr_auth.c	Sun Mar 18 01:12:55 2018
+++ new/usr/src/lib/smbsrv/libmlsvc/common/netr_auth.c	Sun Mar 18 01:12:55 2018
@@ -191,6 +191,10 @@
 	return (0);
 }
 
+uint32_t netr_server_auth2_flags =
+    NETR_NEGOTIATE_BASE_FLAGS |
+    NETR_NEGOTIATE_STRONGKEY_FLAG;
+
 /*
  * netr_server_authenticate2
  */
@@ -216,10 +220,9 @@
 	arg.account_name = (unsigned char *)account_name;
 	arg.account_type = NETR_WKSTA_TRUST_ACCOUNT_TYPE;
 	arg.hostname = (unsigned char *)netr_info->hostname;
-	arg.negotiate_flags = NETR_NEGOTIATE_BASE_FLAGS;
+	arg.negotiate_flags = netr_server_auth2_flags;
 
-	if (ndr_rpc_server_os(netr_handle) == NATIVE_OS_WIN2000) {
-		arg.negotiate_flags |= NETR_NEGOTIATE_STRONGKEY_FLAG;
+	if (arg.negotiate_flags & NETR_NEGOTIATE_STRONGKEY_FLAG) {
 		if (netr_gen_skey128(netr_info) != SMBAUTH_SUCCESS)
 			return (-1);
 	} else {
--- old/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_clnt.c	Sun Mar 18 01:12:55 2018
+++ new/usr/src/lib/smbsrv/libmlsvc/common/srvsvc_clnt.c	Sun Mar 18 01:12:55 2018
@@ -350,68 +350,6 @@
 }
 
 /*
- * Windows 95+ and Windows NT4.0 both report the version as 4.0.
- * Windows 2000+ reports the version as 5.x.
- */
-int
-srvsvc_net_server_getinfo(char *server, char *domain,
-    srvsvc_server_info_t *svinfo)
-{
-	mlsvc_handle_t handle;
-	struct mslm_NetServerGetInfo arg;
-	struct mslm_SERVER_INFO_101 *sv101;
-	int len, opnum, rc;
-	char user[SMB_USERNAME_MAXLEN];
-
-	smb_ipc_get_user(user, SMB_USERNAME_MAXLEN);
-
-	if (srvsvc_open(server, domain, user, &handle) != 0)
-		return (-1);
-
-	opnum = SRVSVC_OPNUM_NetServerGetInfo;
-	bzero(&arg, sizeof (arg));
-
-	len = strlen(server) + 4;
-	arg.servername = ndr_rpc_malloc(&handle, len);
-	if (arg.servername == NULL)
-		return (-1);
-
-	(void) snprintf((char *)arg.servername, len, "\\\\%s", server);
-	arg.level = 101;
-
-	rc = ndr_rpc_call(&handle, opnum, &arg);
-	if ((rc != 0) || (arg.status != 0)) {
-		srvsvc_close(&handle);
-		return (-1);
-	}
-
-	sv101 = arg.result.bufptr.bufptr101;
-
-	bzero(svinfo, sizeof (srvsvc_server_info_t));
-	svinfo->sv_platform_id = sv101->sv101_platform_id;
-	svinfo->sv_version_major = sv101->sv101_version_major;
-	svinfo->sv_version_minor = sv101->sv101_version_minor;
-	svinfo->sv_type = sv101->sv101_type;
-	if (sv101->sv101_name)
-		svinfo->sv_name = strdup((char *)sv101->sv101_name);
-	if (sv101->sv101_comment)
-		svinfo->sv_comment = strdup((char *)sv101->sv101_comment);
-
-	if (svinfo->sv_type & SV_TYPE_WFW)
-		svinfo->sv_os = NATIVE_OS_WIN95;
-	if (svinfo->sv_type & SV_TYPE_WINDOWS)
-		svinfo->sv_os = NATIVE_OS_WIN95;
-	if ((svinfo->sv_type & SV_TYPE_NT) ||
-	    (svinfo->sv_type & SV_TYPE_SERVER_NT))
-		svinfo->sv_os = NATIVE_OS_WINNT;
-	if (svinfo->sv_version_major > 4)
-		svinfo->sv_os = NATIVE_OS_WIN2000;
-
-	srvsvc_close(&handle);
-	return (0);
-}
-
-/*
  * Compare the time here with the remote time on the server
  * and report clock skew.
  */
@@ -587,40 +525,4 @@
 
 	srvsvc_close(&handle);
 	return (0);
-}
-
-void
-srvsvc_net_test(char *server, char *domain, char *netname)
-{
-	smb_domainex_t di;
-	srvsvc_server_info_t svinfo;
-
-	(void) smb_tracef("%s %s %s", server, domain, netname);
-
-	if (smb_domain_getinfo(&di)) {
-		server = di.d_dci.dc_name;
-		domain = di.d_primary.di_nbname;
-	}
-
-	if (srvsvc_net_server_getinfo(server, domain, &svinfo) == 0) {
-		smb_tracef("NetServerGetInfo: %s %s (%d.%d) id=%d type=0x%08x",
-		    svinfo.sv_name ? svinfo.sv_name : "NULL",
-		    svinfo.sv_comment ? svinfo.sv_comment : "NULL",
-		    svinfo.sv_version_major, svinfo.sv_version_minor,
-		    svinfo.sv_platform_id, svinfo.sv_type);
-
-		free(svinfo.sv_name);
-		free(svinfo.sv_comment);
-	}
-
-	(void) srvsvc_net_share_get_info(server, domain, netname);
-#if 0
-	/*
-	 * The NetSessionEnum server-side definition was updated.
-	 * Disabled until the client-side has been updated.
-	 */
-	(void) srvsvc_net_session_enum(server, domain, netname);
-#endif
-	(void) srvsvc_net_connect_enum(server, domain, netname, 0);
-	(void) srvsvc_net_connect_enum(server, domain, netname, 1);
 }
