Ignore:
Timestamp:
Nov 25, 2016, 8:04:54 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/source3/libnet/libnet_join.c

    r988 r989  
    464464        char *spn = NULL;
    465465        bool ok;
     466        const char **netbios_aliases = NULL;
    466467
    467468        /* Find our DN */
     
    522523                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
    523524                        }
     525                }
     526        }
     527
     528        netbios_aliases = lp_netbios_aliases();
     529        if (netbios_aliases != NULL) {
     530                for (; *netbios_aliases != NULL; netbios_aliases++) {
     531                        /*
     532                         * Add HOST/NETBIOSNAME
     533                         */
     534                        spn = talloc_asprintf(mem_ctx, "HOST/%s", *netbios_aliases);
     535                        if (spn == NULL) {
     536                                TALLOC_FREE(spn);
     537                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     538                        }
     539                        if (!strupper_m(spn)) {
     540                                TALLOC_FREE(spn);
     541                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     542                        }
     543
     544                        ok = ads_element_in_array(spn_array, num_spns, spn);
     545                        if (ok) {
     546                                TALLOC_FREE(spn);
     547                                continue;
     548                        }
     549                        ok = add_string_to_array(spn_array, spn,
     550                                                 &spn_array, &num_spns);
     551                        if (!ok) {
     552                                TALLOC_FREE(spn);
     553                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     554                        }
     555                        TALLOC_FREE(spn);
     556
     557                        /*
     558                         * Add HOST/netbiosname.domainname
     559                         */
     560                        if (r->out.dns_domain_name == NULL) {
     561                                continue;
     562                        }
     563                        fstr_sprintf(my_fqdn, "%s.%s",
     564                                     *netbios_aliases,
     565                                     r->out.dns_domain_name);
     566
     567                        spn = talloc_asprintf(mem_ctx, "HOST/%s", my_fqdn);
     568                        if (spn == NULL) {
     569                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     570                        }
     571
     572                        ok = ads_element_in_array(spn_array, num_spns, spn);
     573                        if (ok) {
     574                                TALLOC_FREE(spn);
     575                                continue;
     576                        }
     577                        ok = add_string_to_array(spn_array, spn,
     578                                                 &spn_array, &num_spns);
     579                        if (!ok) {
     580                                TALLOC_FREE(spn);
     581                                return ADS_ERROR_LDAP(LDAP_NO_MEMORY);
     582                        }
     583                        TALLOC_FREE(spn);
    524584                }
    525585        }
     
    22442304        bool valid_workgroup = false;
    22452305        bool valid_realm = false;
     2306        bool ignored_realm = false;
    22462307
    22472308        /* check if configuration is already set correctly */
     
    22632324                        switch (lp_security()) {
    22642325                        case SEC_DOMAIN:
     2326                                if (!valid_realm && lp_winbind_rpc_only()) {
     2327                                        valid_realm = true;
     2328                                        ignored_realm = true;
     2329                                }
    22652330                        case SEC_ADS:
    22662331                                valid_security = true;
     
    22682333
    22692334                        if (valid_workgroup && valid_realm && valid_security) {
     2335                                if (ignored_realm && !r->in.modify_config)
     2336                                {
     2337                                        libnet_join_set_error_string(mem_ctx, r,
     2338                                                "Warning: ignoring realm when "
     2339                                                "joining AD domain with "
     2340                                                "'security=domain' and "
     2341                                                "'winbind rpc only = yes'. "
     2342                                                "(realm set to '%s', "
     2343                                                "should be '%s').", lp_realm(),
     2344                                                r->out.dns_domain_name);
     2345                                }
    22702346                                /* nothing to be done */
    22712347                                return WERR_OK;
     
    24412517        create_local_private_krb5_conf_for_domain(
    24422518                r->out.dns_domain_name, r->out.netbios_domain_name,
    2443                 NULL, smbXcli_conn_remote_sockaddr(cli->conn));
     2519                sitename, smbXcli_conn_remote_sockaddr(cli->conn));
    24442520
    24452521        if (r->out.domain_is_ad &&
Note: See TracChangeset for help on using the changeset viewer.