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

    r751 r862  
    338338}
    339339
     340void winbind_msg_domain_offline(struct messaging_context *msg_ctx,
     341                                void *private_data,
     342                                uint32_t msg_type,
     343                                struct server_id server_id,
     344                                DATA_BLOB *data)
     345{
     346        const char *domain_name = (const char *)data->data;
     347        struct winbindd_domain *domain;
     348
     349        domain = find_domain_from_name_noinit(domain_name);
     350        if (domain == NULL) {
     351                return;
     352        }
     353
     354        domain->online = false;
     355
     356        DEBUG(10, ("Domain %s is marked as offline now.\n",
     357                   domain_name));
     358}
     359
     360void winbind_msg_domain_online(struct messaging_context *msg_ctx,
     361                                void *private_data,
     362                                uint32_t msg_type,
     363                                struct server_id server_id,
     364                                DATA_BLOB *data)
     365{
     366        const char *domain_name = (const char *)data->data;
     367        struct winbindd_domain *domain;
     368
     369        domain = find_domain_from_name_noinit(domain_name);
     370        if (domain == NULL) {
     371                return;
     372        }
     373
     374        domain->online = true;
     375
     376        DEBUG(10, ("Domain %s is marked as online now.\n",
     377                   domain_name));
     378}
     379
    340380/****************************************************************
    341381 Set domain offline and also add handler to put us back online
     
    345385void set_domain_offline(struct winbindd_domain *domain)
    346386{
     387        pid_t parent_pid = getppid();
     388
    347389        DEBUG(10,("set_domain_offline: called for domain %s\n",
    348390                domain->name ));
     
    391433        DEBUG(10,("set_domain_offline: added event handler for domain %s\n",
    392434                domain->name ));
     435
     436        /* Send a message to the parent that the domain is offline. */
     437        if (parent_pid > 1 && !domain->internal) {
     438                messaging_send_buf(winbind_messaging_context(),
     439                                   pid_to_procid(parent_pid),
     440                                   MSG_WINBIND_DOMAIN_OFFLINE,
     441                                   (uint8 *)domain->name,
     442                                   strlen(domain->name) + 1);
     443        }
    393444
    394445        /* Send an offline message to the idmap child when our
     
    416467static void set_domain_online(struct winbindd_domain *domain)
    417468{
     469        pid_t parent_pid = getppid();
     470
    418471        DEBUG(10,("set_domain_online: called for domain %s\n",
    419472                domain->name ));
     
    466519
    467520        domain->online = True;
     521
     522        /* Send a message to the parent that the domain is online. */
     523        if (parent_pid > 1 && !domain->internal) {
     524                messaging_send_buf(winbind_messaging_context(),
     525                                   pid_to_procid(parent_pid),
     526                                   MSG_WINBIND_DOMAIN_ONLINE,
     527                                   (uint8 *)domain->name,
     528                                   strlen(domain->name) + 1);
     529        }
    468530
    469531        /* Send an online message to the idmap child when our
     
    10241086                result = cli_set_domain((*cli), domain->name);
    10251087                if (!NT_STATUS_IS_OK(result)) {
     1088                        SAFE_FREE(ipc_username);
     1089                        SAFE_FREE(ipc_domain);
     1090                        SAFE_FREE(ipc_password);
    10261091                        return result;
    10271092                }
     
    16031668                result = cm_prepare_connection(domain, fd, domain->dcname,
    16041669                        &new_conn->cli, &retry);
     1670                if (!NT_STATUS_IS_OK(result)) {
     1671                        /* Don't leak the smb connection socket */
     1672                        close(fd);
     1673                }
    16051674
    16061675                if (!retry)
     
    25652634
    25662635/****************************************************************************
     2636Open a LSA connection to a DC, suiteable for LSA lookup calls.
     2637****************************************************************************/
     2638
     2639NTSTATUS cm_connect_lsat(struct winbindd_domain *domain,
     2640                         TALLOC_CTX *mem_ctx,
     2641                         struct rpc_pipe_client **cli,
     2642                         struct policy_handle *lsa_policy)
     2643{
     2644        NTSTATUS status;
     2645
     2646        if (domain->can_do_ncacn_ip_tcp) {
     2647                status = cm_connect_lsa_tcp(domain, mem_ctx, cli);
     2648                if (NT_STATUS_EQUAL(status, NT_STATUS_ACCESS_DENIED) ||
     2649                    NT_STATUS_EQUAL(status, NT_STATUS_RPC_SEC_PKG_ERROR) ||
     2650                    NT_STATUS_EQUAL(status, NT_STATUS_NETWORK_ACCESS_DENIED)) {
     2651                        invalidate_cm_connection(&domain->conn);
     2652                        status = cm_connect_lsa_tcp(domain, mem_ctx, cli);
     2653                }
     2654                if (NT_STATUS_IS_OK(status)) {
     2655                        return status;
     2656                }
     2657
     2658                /*
     2659                 * we tried twice to connect via ncan_ip_tcp and schannel and
     2660                 * failed - maybe it is a trusted domain we can't connect to ?
     2661                 * do not try tcp next time - gd
     2662                 */
     2663                domain->can_do_ncacn_ip_tcp = false;
     2664        }
     2665
     2666        status = cm_connect_lsa(domain, mem_ctx, cli, lsa_policy);
     2667
     2668        return status;
     2669}
     2670
     2671/****************************************************************************
    25672672 Open the netlogon pipe to this DC. Use schannel if specified in client conf.
    25682673 session key stored in conn->netlogon_pipe->dc->sess_key.
Note: See TracChangeset for help on using the changeset viewer.