Print this page
NEX-20549 smb AD join broken if no site name
Reviewed by: Evan Layton <evan.layton@nexenta.com>
Reviewed by: Matt Barden <matt.barden@nexenta.com>
NEX-19665 Several door servers don't properly handle exiting threads
Review by: Gordon Ross <gordon.ross@nexenta.com>
Review by: Evan Layton <evan.layton@nexenta.com>
Merge with illumos-gate 8dcafc606a22eddb15cded4783cf27221c4404b3 (htable whitespace)
NEX-2750 idmapd spams console with "ignoring preferred_dc value"
NEX-2225 Unable to join NexentaStor to 2008 AD
NEX-2302 Need a way to control the idmap rediscovery interval
NEX-1810 extended security Kerberos (inbound)
NEX-1852 re-enable Kerberos-style AD join
NEX-1638 Updated DC Locator
 Includes work by: matt.barden@nexenta.com, kevin.crowe@nexenta.com
SMB-56 extended security NTLMSSP, inbound (lint)
SMB-56 extended security NTLMSSP, inbound
OS-7 Add cache timeout settings to idmapd manifest, increase defaults
re #13190 rb4312 idmapd error -9961 (No AD servers)

@@ -18,11 +18,11 @@
  *
  * CDDL HEADER END
  */
 /*
  * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
+ * Copyright 2019 Nexenta Systems, Inc.  All rights reserved.
  */
 
 
 /*
  * Config routines common to idmap(1M) and idmapd(1M)

@@ -43,10 +43,11 @@
 #include <sys/u8_textprep.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
 #include <netdb.h>
 #include <note.h>
+#include <limits.h>
 #include "idmapd.h"
 #include "addisc.h"
 
 #define MACHINE_SID_LEN         (9 + 3 * 11)
 #define FMRI_BASE               "svc:/system/idmap"

@@ -75,10 +76,15 @@
  * really short TTL (which it never should, but be defensive)
  * (not configurable) seconds.
  */
 #define MIN_REDISCOVERY_INTERVAL        60
 
+/*
+ * Max number of concurrent door calls
+ */
+#define MAX_THREADS_DEFAULT     40
+
 enum event_type {
         EVENT_NOTHING,  /* Woke up for no good reason */
         EVENT_TIMEOUT,  /* Timeout expired */
         EVENT_ROUTING,  /* An interesting routing event happened */
         EVENT_POKED,    /* Requested from degrade_svc() */

@@ -1599,10 +1605,19 @@
         rc = get_val_int(handles, "list_size_limit",
             &pgcfg->list_size_limit, SCF_TYPE_COUNT);
         if (rc != 0)
                 (*errors)++;
 
+        rc = get_val_int(handles, "max_threads",
+            &pgcfg->max_threads, SCF_TYPE_COUNT);
+        if (rc != 0)
+                (*errors)++;
+        if (pgcfg->max_threads == 0)
+                pgcfg->max_threads = MAX_THREADS_DEFAULT;
+        if (pgcfg->max_threads > UINT_MAX)
+                pgcfg->max_threads = UINT_MAX;
+
         rc = get_val_int(handles, "id_cache_timeout",
             &pgcfg->id_cache_timeout, SCF_TYPE_COUNT);
         if (rc != 0)
                 (*errors)++;
         if (pgcfg->id_cache_timeout == 0)

@@ -1629,14 +1644,15 @@
         else {
                 if (pgcfg->domain_name != NULL &&
                     pgcfg->domain_name[0] == '\0') {
                         free(pgcfg->domain_name);
                         pgcfg->domain_name = NULL;
+                } else {
+                        pgcfg->domain_name_auto_disc = B_FALSE;
                 }
                 (void) ad_disc_set_DomainName(handles->ad_ctx,
                     pgcfg->domain_name);
-                pgcfg->domain_name_auto_disc = B_FALSE;
         }
 
         rc = get_val_astring(handles, "default_domain",
             &pgcfg->default_domain);
         if (rc != 0) {

@@ -1725,20 +1741,34 @@
 
         rc = get_val_astring(handles, "forest_name", &pgcfg->forest_name);
         if (rc != 0)
                 (*errors)++;
         else {
+                if (pgcfg->forest_name != NULL &&
+                    pgcfg->forest_name[0] == '\0') {
+                        free(pgcfg->forest_name);
+                        pgcfg->forest_name = NULL;
+                } else {
+                        pgcfg->forest_name_auto_disc = B_FALSE;
+                }
                 (void) ad_disc_set_ForestName(handles->ad_ctx,
                     pgcfg->forest_name);
-                pgcfg->forest_name_auto_disc = B_FALSE;
         }
 
         rc = get_val_astring(handles, "site_name", &pgcfg->site_name);
         if (rc != 0)
                 (*errors)++;
-        else
+        else {
+                if (pgcfg->site_name != NULL &&
+                    pgcfg->site_name[0] == '\0') {
+                        free(pgcfg->site_name);
+                        pgcfg->site_name = NULL;
+                } else {
+                        pgcfg->site_name_auto_disc = B_FALSE;
+                }
                 (void) ad_disc_set_SiteName(handles->ad_ctx, pgcfg->site_name);
+        }
 
         rc = get_val_ds(handles, "global_catalog", 3268,
             &pgcfg->global_catalog);
         if (rc != 0)
                 (*errors)++;

@@ -2196,10 +2226,13 @@
         /* Non-discoverable props updated here */
 
         changed += update_uint64(&live_pgcfg->list_size_limit,
             &new_pgcfg.list_size_limit, "list_size_limit");
 
+        changed += update_uint64(&live_pgcfg->max_threads,
+            &new_pgcfg.max_threads, "max_threads");
+
         changed += update_uint64(&live_pgcfg->id_cache_timeout,
             &new_pgcfg.id_cache_timeout, "id_cache_timeout");
 
         changed += update_uint64(&live_pgcfg->name_cache_timeout,
             &new_pgcfg.name_cache_timeout, "name_cache_timeout");