Ignore:
Timestamp:
May 13, 2014, 11:39:04 AM (11 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update trunk to 3.6.23

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

  • trunk/server/source3/utils/net_ads.c

    r751 r862  
    3838#include "../libcli/security/security.h"
    3939#include "libsmb/libsmb.h"
     40#include "utils/net_dns.h"
    4041
    4142#ifdef HAVE_ADS
     
    11241125#if defined(WITH_DNS_UPDATES)
    11251126#include "../lib/addns/dns.h"
    1126 DNS_ERROR DoDNSUpdate(char *pszServerName,
    1127                       const char *pszDomainName, const char *pszHostName,
    1128                       const struct sockaddr_storage *sslist,
    1129                       size_t num_addrs );
    1130 
    1131 static NTSTATUS net_update_dns_internal(TALLOC_CTX *ctx, ADS_STRUCT *ads,
     1127
     1128static NTSTATUS net_update_dns_internal(struct net_context *c,
     1129                                        TALLOC_CTX *ctx, ADS_STRUCT *ads,
    11321130                                        const char *machine_name,
    11331131                                        const struct sockaddr_storage *addrs,
     
    11911189
    11921190                if ( !NT_STATUS_IS_OK(status) || (ns_count == 0)) {
    1193                         DEBUG(3,("net_ads_join: Failed to find name server for the %s "
     1191                        DEBUG(3,("net_update_dns_internal: Failed to find name server for the %s "
    11941192                         "realm\n", ads->config.realm));
    11951193                        goto done;
     
    12021200        for (i=0; i < ns_count; i++) {
    12031201
     1202                uint32_t flags = DNS_UPDATE_SIGNED |
     1203                                 DNS_UPDATE_UNSIGNED |
     1204                                 DNS_UPDATE_UNSIGNED_SUFFICIENT |
     1205                                 DNS_UPDATE_PROBE |
     1206                                 DNS_UPDATE_PROBE_SUFFICIENT;
     1207
     1208                if (c->opt_force) {
     1209                        flags &= ~DNS_UPDATE_PROBE_SUFFICIENT;
     1210                        flags &= ~DNS_UPDATE_UNSIGNED_SUFFICIENT;
     1211                }
     1212
     1213                status = NT_STATUS_UNSUCCESSFUL;
     1214
    12041215                /* Now perform the dns update - we'll try non-secure and if we fail,
    12051216                   we'll follow it up with a secure update */
     
    12071218                fstrcpy( dns_server, nameservers[i].hostname );
    12081219
    1209                 dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, num_addrs);
     1220                dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, num_addrs, flags);
    12101221                if (ERR_DNS_IS_OK(dns_err)) {
    12111222                        status = NT_STATUS_OK;
     
    12341245}
    12351246
    1236 static NTSTATUS net_update_dns_ext(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
     1247static NTSTATUS net_update_dns_ext(struct net_context *c,
     1248                                   TALLOC_CTX *mem_ctx, ADS_STRUCT *ads,
    12371249                                   const char *hostname,
    12381250                                   struct sockaddr_storage *iplist,
     
    12641276        }
    12651277
    1266         status = net_update_dns_internal(mem_ctx, ads, machine_name,
     1278        status = net_update_dns_internal(c, mem_ctx, ads, machine_name,
    12671279                                         iplist, num_addrs);
    12681280
     
    12711283}
    12721284
    1273 static NTSTATUS net_update_dns(TALLOC_CTX *mem_ctx, ADS_STRUCT *ads, const char *hostname)
     1285static NTSTATUS net_update_dns(struct net_context *c, TALLOC_CTX *mem_ctx, ADS_STRUCT *ads, const char *hostname)
    12741286{
    12751287        NTSTATUS status;
    12761288
    1277         status = net_update_dns_ext(mem_ctx, ads, hostname, NULL, 0);
     1289        status = net_update_dns_ext(c, mem_ctx, ads, hostname, NULL, 0);
    12781290        return status;
    12791291}
     
    14371449
    14381450        if (r->out.dns_domain_name) {
    1439                 d_printf(_("Joined '%s' to realm '%s'\n"), r->in.machine_name,
     1451                d_printf(_("Joined '%s' to dns domain '%s'\n"), r->in.machine_name,
    14401452                        r->out.dns_domain_name);
    14411453        } else {
     
    14801492                }
    14811493
    1482                 if ( !ads_dns || !NT_STATUS_IS_OK(net_update_dns( ctx, ads_dns, NULL)) ) {
     1494                if ( !ads_dns || !NT_STATUS_IS_OK(net_update_dns(c, ctx, ads_dns, NULL)) ) {
    14831495                        d_fprintf( stderr, _("DNS update failed!\n") );
    14841496                }
     
    15851597        }
    15861598
    1587         ntstatus = net_update_dns_ext(ctx, ads, hostname, addrs, num_addrs);
     1599        ntstatus = net_update_dns_ext(c, ctx, ads, hostname, addrs, num_addrs);
    15881600        if (!NT_STATUS_IS_OK(ntstatus)) {
    15891601                d_fprintf( stderr, _("DNS update failed!\n") );
     
    16051617#endif
    16061618}
    1607 
    1608 #if defined(WITH_DNS_UPDATES)
    1609 DNS_ERROR do_gethostbyname(const char *server, const char *host);
    1610 #endif
    16111619
    16121620static int net_ads_dns_gethostbyname(struct net_context *c, int argc, const char **argv)
Note: See TracChangeset for help on using the changeset viewer.