Changeset 989 for vendor/current/source3/libnet
- Timestamp:
- Nov 25, 2016, 8:04:54 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/libnet/libnet_join.c
r988 r989 464 464 char *spn = NULL; 465 465 bool ok; 466 const char **netbios_aliases = NULL; 466 467 467 468 /* Find our DN */ … … 522 523 return ADS_ERROR_LDAP(LDAP_NO_MEMORY); 523 524 } 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); 524 584 } 525 585 } … … 2244 2304 bool valid_workgroup = false; 2245 2305 bool valid_realm = false; 2306 bool ignored_realm = false; 2246 2307 2247 2308 /* check if configuration is already set correctly */ … … 2263 2324 switch (lp_security()) { 2264 2325 case SEC_DOMAIN: 2326 if (!valid_realm && lp_winbind_rpc_only()) { 2327 valid_realm = true; 2328 ignored_realm = true; 2329 } 2265 2330 case SEC_ADS: 2266 2331 valid_security = true; … … 2268 2333 2269 2334 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 } 2270 2346 /* nothing to be done */ 2271 2347 return WERR_OK; … … 2441 2517 create_local_private_krb5_conf_for_domain( 2442 2518 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)); 2444 2520 2445 2521 if (r->out.domain_is_ad &&
Note:
See TracChangeset
for help on using the changeset viewer.