Ignore:
Timestamp:
Nov 27, 2012, 4:43:17 PM (13 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: updated trunk to 3.6.0

Location:
trunk/server
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server

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

    r596 r745  
    2323#include "includes.h"
    2424#include "utils/net.h"
     25
    2526#include "librpc/gen_ndr/ndr_krb5pac.h"
    26 #include "../librpc/gen_ndr/cli_spoolss.h"
     27#include "../librpc/gen_ndr/_spoolss.h"
    2728#include "nsswitch/libwbclient/wbclient.h"
     29
     30
     31
     32
     33
     34
     35
     36
     37
     38
     39
    2840
    2941#ifdef HAVE_ADS
     
    104116        printf(_("Domain Controller:\t%s\n"), reply.pdc_dns_name);
    105117
    106         printf(_("Pre-Win2k Domain:\t%s\n"), reply.domain);
     118        printf(_("Pre-Win2k Domain:\t%s\n"), reply.domain);
    107119        printf(_("Pre-Win2k Hostname:\t%s\n"), reply.pdc_name);
    108120
     
    402414        }
    403415
    404         d_printf(_("Workgroup: %s\n"), reply.domain);
     416        d_printf(_("Workgroup: %s\n"), reply.domain);
    405417
    406418        ads_destroy(&ads);
     
    476488                ou_str = SMB_STRDUP(c->opt_container);
    477489        } else {
    478                 ou_str = ads_default_ou_string(ads, WELL_KNOWN_GUID_USERS);
     490                ou_str = ads_default_ou_string(ads, );
    479491        }
    480492
     
    540552        char *primary_group;
    541553        char *escaped_user;
    542         DOM_SID primary_group_sid;
     554        primary_group_sid;
    543555        uint32_t group_rid;
    544556        enum wbcSidType type;
     
    770782                ou_str = SMB_STRDUP(c->opt_container);
    771783        } else {
    772                 ou_str = ads_default_ou_string(ads, WELL_KNOWN_GUID_USERS);
     784                ou_str = ads_default_ou_string(ads, );
    773785        }
    774786
     
    959971        }
    960972
     973
     974
     975
     976
     977
     978
    961979        werr = libnet_init_UnjoinCtx(ctx, &r);
    962980        if (!W_ERROR_IS_OK(werr)) {
     
    978996                                  WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE;
    979997        r->in.delete_machine_account = true;
     998
    980999
    9811000        werr = libnet_Unjoin(ctx, r);
     
    11041123
    11051124#if defined(WITH_DNS_UPDATES)
    1106 #include "dns.h"
     1125#include "dns.h"
    11071126DNS_ERROR DoDNSUpdate(char *pszServerName,
    11081127                      const char *pszDomainName, const char *pszHostName,
     
    11161135{
    11171136        struct dns_rr_ns *nameservers = NULL;
    1118         int ns_count = 0;
     1137        int ns_count = 0;
    11191138        NTSTATUS status = NT_STATUS_UNSUCCESSFUL;
    11201139        DNS_ERROR dns_err;
     
    11811200        }
    11821201
    1183         /* Now perform the dns update - we'll try non-secure and if we fail,
    1184            we'll follow it up with a secure update */
    1185 
    1186         fstrcpy( dns_server, nameservers[0].hostname );
    1187 
    1188         dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, num_addrs);
    1189         if (!ERR_DNS_IS_OK(dns_err)) {
     1202        for (i=0; i < ns_count; i++) {
     1203
     1204                /* Now perform the dns update - we'll try non-secure and if we fail,
     1205                   we'll follow it up with a secure update */
     1206
     1207                fstrcpy( dns_server, nameservers[i].hostname );
     1208
     1209                dns_err = DoDNSUpdate(dns_server, dnsdomain, machine_name, addrs, num_addrs);
     1210                if (ERR_DNS_IS_OK(dns_err)) {
     1211                        status = NT_STATUS_OK;
     1212                        goto done;
     1213                }
     1214
     1215                if (ERR_DNS_EQUAL(dns_err, ERROR_DNS_INVALID_NAME_SERVER) ||
     1216                    ERR_DNS_EQUAL(dns_err, ERROR_DNS_CONNECTION_FAILED) ||
     1217                    ERR_DNS_EQUAL(dns_err, ERROR_DNS_SOCKET_ERROR)) {
     1218                        DEBUG(1,("retrying DNS update with next nameserver after receiving %s\n",
     1219                                dns_errstr(dns_err)));
     1220                        continue;
     1221                }
     1222
     1223                d_printf(_("DNS Update for %s failed: %s\n"),
     1224                        machine_name, dns_errstr(dns_err));
    11901225                status = NT_STATUS_UNSUCCESSFUL;
     1226
    11911227        }
    11921228
     
    13481384                d_fprintf(stderr, _("Please supply a valid domain name\n"));
    13491385                werr = WERR_INVALID_PARAM;
     1386
     1387
     1388
     1389
     1390
     1391
     1392
    13501393                goto fail;
    13511394        }
     
    13681411                                  WKSSVC_JOIN_FLAGS_ACCOUNT_CREATE |
    13691412                                  WKSSVC_JOIN_FLAGS_DOMAIN_JOIN_IF_JOINED;
     1413
    13701414
    13711415        werr = libnet_Join(ctx, r);
     1416
     1417
     1418
     1419
     1420
    13721421        if (!W_ERROR_IS_OK(werr)) {
    13731422                goto fail;
     
    14381487                ads_destroy(&ads_dns);
    14391488        }
     1489
     1490
    14401491#endif
    14411492
    1442 done:
    14431493        TALLOC_FREE(r);
    14441494        TALLOC_FREE( ctx );
     
    15831633        err = do_gethostbyname(argv[0], argv[1]);
    15841634
    1585         d_printf(_("do_gethostbyname returned %d\n"), ERROR_DNS_V(err));
     1635        d_printf(_("do_gethostbyname returned %s (%d)\n"),
     1636                dns_errstr(err), ERROR_DNS_V(err));
    15861637#endif
    15871638        return 0;
     
    17831834                                        c->opt_password ? c->opt_password : "",
    17841835                                        CLI_FULL_CONNECTION_USE_KERBEROS,
    1785                                         Undefined, NULL);
     1836                                        Undefined);
    17861837
    17871838        if (NT_STATUS_IS_ERR(nt_status)) {
    1788                 d_fprintf(stderr, _("Unable to open a connnection to %s to "
     1839                d_fprintf(stderr, _("Unable to open a connection to %s to "
    17891840                                    "obtain data for %s\n"),
    17901841                          servername, printername);
     
    18351886        nt_status = cli_rpc_pipe_open_noauth(cli, &ndr_table_spoolss.syntax_id, &pipe_hnd);
    18361887        if (!NT_STATUS_IS_OK(nt_status)) {
    1837                 d_fprintf(stderr, _("Unable to open a connnection to the spoolss pipe on %s\n"),
     1888                d_fprintf(stderr, _("Unable to open a connection to the spoolss pipe on %s\n"),
    18381889                         servername);
    18391890                SAFE_FREE(prt_dn);
     
    22652316        const char **attrs;
    22662317        LDAPMessage *res = NULL;
    2267         DOM_SID sid;
     2318        sid;
    22682319
    22692320        if (argc < 1 || c->display_usage) {
     
    24632514static int net_ads_kerberos_pac(struct net_context *c, int argc, const char **argv)
    24642515{
    2465         struct PAC_DATA *pac = NULL;
    24662516        struct PAC_LOGON_INFO *info = NULL;
    24672517        TALLOC_CTX *mem_ctx = NULL;
     
    24932543                                     c->opt_user_name,
    24942544                                     c->opt_password,
    2495                                      0,
     2545                                     0,
    24962546                                     NULL,
    24972547                                     NULL,
     
    25012551                                     2592000, /* one month */
    25022552                                     impersonate_princ_s,
    2503                                      &pac);
     2553                                     &);
    25042554        if (!NT_STATUS_IS_OK(status)) {
    25052555                d_printf(_("failed to query kerberos PAC: %s\n"),
     
    25082558        }
    25092559
    2510         info = get_logon_info_from_pac(pac);
    25112560        if (info) {
    25122561                const char *s;
     
    27942843}
    27952844
     2845
     2846
     2847
     2848
     2849
    27962850/* this one shouldn't display a message */
    27972851int net_ads_check(struct net_context *c)
Note: See TracChangeset for help on using the changeset viewer.