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)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/idmap/idmapd/idmap_config.c
          +++ new/usr/src/cmd/idmap/idmapd/idmap_config.c
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright (c) 2007, 2010, Oracle and/or its affiliates. All rights reserved.
  23      - * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
       23 + * Copyright 2019 Nexenta Systems, Inc.  All rights reserved.
  24   24   */
  25   25  
  26   26  
  27   27  /*
  28   28   * Config routines common to idmap(1M) and idmapd(1M)
  29   29   */
  30   30  
  31   31  #include <stdlib.h>
  32   32  #include <strings.h>
  33   33  #include <libintl.h>
↓ open down ↓ 4 lines elided ↑ open up ↑
  38   38  #include <uuid/uuid.h>
  39   39  #include <pthread.h>
  40   40  #include <port.h>
  41   41  #include <sys/socket.h>
  42   42  #include <net/route.h>
  43   43  #include <sys/u8_textprep.h>
  44   44  #include <netinet/in.h>
  45   45  #include <arpa/inet.h>
  46   46  #include <netdb.h>
  47   47  #include <note.h>
       48 +#include <limits.h>
  48   49  #include "idmapd.h"
  49   50  #include "addisc.h"
  50   51  
  51   52  #define MACHINE_SID_LEN         (9 + 3 * 11)
  52   53  #define FMRI_BASE               "svc:/system/idmap"
  53   54  #define CONFIG_PG               "config"
  54   55  #define DEBUG_PG                "debug"
  55   56  #define RECONFIGURE             1
  56   57  #define POKE_AUTO_DISCOVERY     2
  57   58  #define KICK_AUTO_DISCOVERY     3
↓ open down ↓ 12 lines elided ↑ open up ↑
  70   71   */
  71   72  #define REDISCOVERY_INTERVAL_DEFAULT    3600
  72   73  
  73   74  /*
  74   75   * Mininum time between rediscovery runs, in case adutils gives us a
  75   76   * really short TTL (which it never should, but be defensive)
  76   77   * (not configurable) seconds.
  77   78   */
  78   79  #define MIN_REDISCOVERY_INTERVAL        60
  79   80  
       81 +/*
       82 + * Max number of concurrent door calls
       83 + */
       84 +#define MAX_THREADS_DEFAULT     40
       85 +
  80   86  enum event_type {
  81   87          EVENT_NOTHING,  /* Woke up for no good reason */
  82   88          EVENT_TIMEOUT,  /* Timeout expired */
  83   89          EVENT_ROUTING,  /* An interesting routing event happened */
  84   90          EVENT_POKED,    /* Requested from degrade_svc() */
  85   91          EVENT_KICKED,   /* Force rediscovery, i.e. DC failed. */
  86   92          EVENT_REFRESH,  /* SMF refresh */
  87   93  };
  88   94  
  89   95  
↓ open down ↓ 1504 lines elided ↑ open up ↑
1594 1600                      s);
1595 1601                  (*errors)++;
1596 1602          }
1597 1603          free(s);
1598 1604  
1599 1605          rc = get_val_int(handles, "list_size_limit",
1600 1606              &pgcfg->list_size_limit, SCF_TYPE_COUNT);
1601 1607          if (rc != 0)
1602 1608                  (*errors)++;
1603 1609  
     1610 +        rc = get_val_int(handles, "max_threads",
     1611 +            &pgcfg->max_threads, SCF_TYPE_COUNT);
     1612 +        if (rc != 0)
     1613 +                (*errors)++;
     1614 +        if (pgcfg->max_threads == 0)
     1615 +                pgcfg->max_threads = MAX_THREADS_DEFAULT;
     1616 +        if (pgcfg->max_threads > UINT_MAX)
     1617 +                pgcfg->max_threads = UINT_MAX;
     1618 +
1604 1619          rc = get_val_int(handles, "id_cache_timeout",
1605 1620              &pgcfg->id_cache_timeout, SCF_TYPE_COUNT);
1606 1621          if (rc != 0)
1607 1622                  (*errors)++;
1608 1623          if (pgcfg->id_cache_timeout == 0)
1609 1624                  pgcfg->id_cache_timeout = ID_CACHE_TMO_DEFAULT;
1610 1625  
1611 1626          rc = get_val_int(handles, "name_cache_timeout",
1612 1627              &pgcfg->name_cache_timeout, SCF_TYPE_COUNT);
1613 1628          if (rc != 0)
↓ open down ↓ 10 lines elided ↑ open up ↑
1624 1639  
1625 1640          rc = get_val_astring(handles, "domain_name",
1626 1641              &pgcfg->domain_name);
1627 1642          if (rc != 0)
1628 1643                  (*errors)++;
1629 1644          else {
1630 1645                  if (pgcfg->domain_name != NULL &&
1631 1646                      pgcfg->domain_name[0] == '\0') {
1632 1647                          free(pgcfg->domain_name);
1633 1648                          pgcfg->domain_name = NULL;
     1649 +                } else {
     1650 +                        pgcfg->domain_name_auto_disc = B_FALSE;
1634 1651                  }
1635 1652                  (void) ad_disc_set_DomainName(handles->ad_ctx,
1636 1653                      pgcfg->domain_name);
1637      -                pgcfg->domain_name_auto_disc = B_FALSE;
1638 1654          }
1639 1655  
1640 1656          rc = get_val_astring(handles, "default_domain",
1641 1657              &pgcfg->default_domain);
1642 1658          if (rc != 0) {
1643 1659                  /*
1644 1660                   * SCF failures fetching config/default_domain we treat
1645 1661                   * as fatal as they may leave ID mapping rules that
1646 1662                   * match unqualified winnames flapping in the wind.
1647 1663                   */
↓ open down ↓ 72 lines elided ↑ open up ↑
1720 1736          else {
1721 1737                  (void) ad_disc_set_PreferredDC(handles->ad_ctx,
1722 1738                      pgcfg->preferred_dc);
1723 1739                  pgcfg->preferred_dc_auto_disc = B_FALSE;
1724 1740          }
1725 1741  
1726 1742          rc = get_val_astring(handles, "forest_name", &pgcfg->forest_name);
1727 1743          if (rc != 0)
1728 1744                  (*errors)++;
1729 1745          else {
     1746 +                if (pgcfg->forest_name != NULL &&
     1747 +                    pgcfg->forest_name[0] == '\0') {
     1748 +                        free(pgcfg->forest_name);
     1749 +                        pgcfg->forest_name = NULL;
     1750 +                } else {
     1751 +                        pgcfg->forest_name_auto_disc = B_FALSE;
     1752 +                }
1730 1753                  (void) ad_disc_set_ForestName(handles->ad_ctx,
1731 1754                      pgcfg->forest_name);
1732      -                pgcfg->forest_name_auto_disc = B_FALSE;
1733 1755          }
1734 1756  
1735 1757          rc = get_val_astring(handles, "site_name", &pgcfg->site_name);
1736 1758          if (rc != 0)
1737 1759                  (*errors)++;
1738      -        else
     1760 +        else {
     1761 +                if (pgcfg->site_name != NULL &&
     1762 +                    pgcfg->site_name[0] == '\0') {
     1763 +                        free(pgcfg->site_name);
     1764 +                        pgcfg->site_name = NULL;
     1765 +                } else {
     1766 +                        pgcfg->site_name_auto_disc = B_FALSE;
     1767 +                }
1739 1768                  (void) ad_disc_set_SiteName(handles->ad_ctx, pgcfg->site_name);
     1769 +        }
1740 1770  
1741 1771          rc = get_val_ds(handles, "global_catalog", 3268,
1742 1772              &pgcfg->global_catalog);
1743 1773          if (rc != 0)
1744 1774                  (*errors)++;
1745 1775          else {
1746 1776                  (void) ad_disc_set_GlobalCatalog(handles->ad_ctx,
1747 1777                      pgcfg->global_catalog);
1748 1778                  pgcfg->global_catalog_auto_disc = B_FALSE;
1749 1779          }
↓ open down ↓ 441 lines elided ↑ open up ↑
2191 2221                  (void) mutex_unlock(&_idmapdstate.addisc_lk);
2192 2222          } else {
2193 2223                  WRLOCK_CONFIG();
2194 2224          }
2195 2225  
2196 2226          /* Non-discoverable props updated here */
2197 2227  
2198 2228          changed += update_uint64(&live_pgcfg->list_size_limit,
2199 2229              &new_pgcfg.list_size_limit, "list_size_limit");
2200 2230  
     2231 +        changed += update_uint64(&live_pgcfg->max_threads,
     2232 +            &new_pgcfg.max_threads, "max_threads");
     2233 +
2201 2234          changed += update_uint64(&live_pgcfg->id_cache_timeout,
2202 2235              &new_pgcfg.id_cache_timeout, "id_cache_timeout");
2203 2236  
2204 2237          changed += update_uint64(&live_pgcfg->name_cache_timeout,
2205 2238              &new_pgcfg.name_cache_timeout, "name_cache_timeout");
2206 2239  
2207 2240          changed += update_uint64(&live_pgcfg->rediscovery_interval,
2208 2241              &new_pgcfg.rediscovery_interval, "rediscovery_interval");
2209 2242  
2210 2243          changed += update_string(&live_pgcfg->machine_sid,
↓ open down ↓ 523 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX