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/winbindd/winbindd_misc.c

    r414 r745  
    2323#include "includes.h"
    2424#include "winbindd.h"
    25 #include "../librpc/gen_ndr/cli_netlogon.h"
    2625
    2726#undef DBGC_CLASS
     
    131130        }
    132131
     132        state->response->data.num_entries = num_domains;
     133
    133134        extra_data_len = strlen(extra_data);
    134135        if (extra_data_len > 0) {
     
    204205                state->response->length += extra_data_len+1;
    205206        }
    206 
    207         return WINBINDD_OK;
    208 }
    209 
    210 /* This is the child-only version of --sequence. It only allows for a single
    211  * domain (ie "our" one) to be displayed. */
    212 
    213 enum winbindd_result winbindd_dual_show_sequence(struct winbindd_domain *domain,
    214                                                  struct winbindd_cli_state *state)
    215 {
    216         DEBUG(3, ("[%5lu]: show sequence\n", (unsigned long)state->pid));
    217 
    218         /* Ensure null termination */
    219         state->request->domain_name[sizeof(state->request->domain_name)-1]='\0';
    220 
    221         domain->methods->sequence_number(domain, &domain->sequence_number);
    222 
    223         state->response->data.sequence_number =
    224                 domain->sequence_number;
    225207
    226208        return WINBINDD_OK;
     
    333315}
    334316
     317void winbindd_dc_info(struct winbindd_cli_state *cli)
     318{
     319        struct winbindd_domain *domain;
     320        char *dc_name, *dc_ip;
     321
     322        cli->request->domain_name[sizeof(cli->request->domain_name)-1] = '\0';
     323
     324        DEBUG(3, ("[%5lu]: domain_info [%s]\n", (unsigned long)cli->pid,
     325                  cli->request->domain_name));
     326
     327        if (cli->request->domain_name[0] != '\0') {
     328                domain = find_domain_from_name_noinit(
     329                        cli->request->domain_name);
     330                DEBUG(10, ("Could not find domain %s\n",
     331                           cli->request->domain_name));
     332                if (domain == NULL) {
     333                        request_error(cli);
     334                        return;
     335                }
     336        } else {
     337                domain = find_our_domain();
     338        }
     339
     340        if (!fetch_current_dc_from_gencache(
     341                    talloc_tos(), domain->name, &dc_name, &dc_ip)) {
     342                DEBUG(10, ("fetch_current_dc_from_gencache(%s) failed\n",
     343                           domain->name));
     344                request_error(cli);
     345                return;
     346        }
     347
     348        cli->response->data.num_entries = 1;
     349        cli->response->extra_data.data = talloc_asprintf(
     350                cli->mem_ctx, "%s\n%s\n", dc_name, dc_ip);
     351
     352        TALLOC_FREE(dc_name);
     353        TALLOC_FREE(dc_ip);
     354
     355        if (cli->response->extra_data.data == NULL) {
     356                request_error(cli);
     357                return;
     358        }
     359
     360        /* must add one to length to copy the 0 for string termination */
     361        cli->response->length +=
     362                strlen((char *)cli->response->extra_data.data) + 1;
     363
     364        request_ok(cli);
     365}
     366
    335367/* List various tidbits of information */
    336368
Note: See TracChangeset for help on using the changeset viewer.