Ignore:
Timestamp:
Jun 22, 2008, 3:30:02 AM (17 years ago)
Author:
Paul Smedley
Message:

Update trunk to 3.2.0rc2

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/libnet/libnet_join.c

    r136 r137  
    690690                r->out.netbios_domain_name = info->dns.name.string;
    691691                r->out.dns_domain_name = info->dns.dns_domain.string;
    692                 r->out.domain_sid = info->dns.sid;
     692                r->out.domain_sid = sid_dup_talloc(mem_ctx, info->dns.sid);
     693                NT_STATUS_HAVE_NO_MEMORY(r->out.domain_sid);
    693694        }
    694695
     
    703704
    704705                r->out.netbios_domain_name = info->account_domain.name.string;
    705                 r->out.domain_sid = info->account_domain.sid;
     706                r->out.domain_sid = sid_dup_talloc(mem_ctx, info->account_domain.sid);
     707                NT_STATUS_HAVE_NO_MEMORY(r->out.domain_sid);
    706708        }
    707709
     
    11151117        union samr_UserInfo *info = NULL;
    11161118
     1119        ZERO_STRUCT(sam_pol);
     1120        ZERO_STRUCT(domain_pol);
     1121        ZERO_STRUCT(user_pol);
     1122
    11171123        status = cli_full_connection(&cli, NULL,
    11181124                                     r->in.dc_name,
     
    12161222done:
    12171223        if (pipe_hnd) {
    1218                 rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol);
    1219                 rpccli_samr_Close(pipe_hnd, mem_ctx, &sam_pol);
     1224                if (is_valid_policy_hnd(&domain_pol)) {
     1225                        rpccli_samr_Close(pipe_hnd, mem_ctx, &domain_pol);
     1226                }
     1227                if (is_valid_policy_hnd(&sam_pol)) {
     1228                        rpccli_samr_Close(pipe_hnd, mem_ctx, &sam_pol);
     1229                }
    12201230                cli_rpc_pipe_close(pipe_hnd);
    12211231        }
     
    12481258                werr = smbconf_set_global_parameter(ctx, "workgroup",
    12491259                                                    r->in.domain_name);
     1260
     1261                smbconf_delete_global_parameter(ctx, "realm");
    12501262                goto done;
    12511263        }
     
    13211333        }
    13221334
     1335        lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
     1336
    13231337        r->out.modified_config = true;
    13241338        r->out.result = werr;
     
    13461360                return werr;
    13471361        }
     1362
     1363        lp_load(get_dyn_CONFIGFILE(),true,false,false,true);
    13481364
    13491365        r->out.modified_config = true;
     
    17171733****************************************************************/
    17181734
     1735WERROR libnet_join_rollback(TALLOC_CTX *mem_ctx,
     1736                            struct libnet_JoinCtx *r)
     1737{
     1738        WERROR werr;
     1739        struct libnet_UnjoinCtx *u = NULL;
     1740
     1741        werr = libnet_init_UnjoinCtx(mem_ctx, &u);
     1742        if (!W_ERROR_IS_OK(werr)) {
     1743                return werr;
     1744        }
     1745
     1746        u->in.debug             = r->in.debug;
     1747        u->in.dc_name           = r->in.dc_name;
     1748        u->in.domain_name       = r->in.domain_name;
     1749        u->in.admin_account     = r->in.admin_account;
     1750        u->in.admin_password    = r->in.admin_password;
     1751        u->in.modify_config     = r->in.modify_config;
     1752        u->in.unjoin_flags      = WKSSVC_JOIN_FLAGS_JOIN_TYPE |
     1753                                  WKSSVC_JOIN_FLAGS_ACCOUNT_DELETE;
     1754
     1755        werr = libnet_Unjoin(mem_ctx, u);
     1756        TALLOC_FREE(u);
     1757
     1758        return werr;
     1759}
     1760
     1761/****************************************************************
     1762****************************************************************/
     1763
    17191764WERROR libnet_Join(TALLOC_CTX *mem_ctx,
    17201765                   struct libnet_JoinCtx *r)
     
    17361781                        goto done;
    17371782                }
    1738 
     1783        }
     1784
     1785        werr = libnet_join_post_processing(mem_ctx, r);
     1786        if (!W_ERROR_IS_OK(werr)) {
     1787                goto done;
     1788        }
     1789
     1790        if (r->in.join_flags & WKSSVC_JOIN_FLAGS_JOIN_TYPE) {
    17391791                werr = libnet_join_post_verify(mem_ctx, r);
    17401792                if (!W_ERROR_IS_OK(werr)) {
    1741                         goto done;
    1742                 }
    1743         }
    1744 
    1745         werr = libnet_join_post_processing(mem_ctx, r);
    1746         if (!W_ERROR_IS_OK(werr)) {
    1747                 goto done;
    1748         }
     1793                        libnet_join_rollback(mem_ctx, r);
     1794                }
     1795        }
     1796
    17491797 done:
    17501798        r->out.result = werr;
Note: See TracChangeset for help on using the changeset viewer.