Changeset 137 for trunk/samba/source/libnet/libnet_join.c
- Timestamp:
- Jun 22, 2008, 3:30:02 AM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/samba/source/libnet/libnet_join.c
r136 r137 690 690 r->out.netbios_domain_name = info->dns.name.string; 691 691 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); 693 694 } 694 695 … … 703 704 704 705 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); 706 708 } 707 709 … … 1115 1117 union samr_UserInfo *info = NULL; 1116 1118 1119 ZERO_STRUCT(sam_pol); 1120 ZERO_STRUCT(domain_pol); 1121 ZERO_STRUCT(user_pol); 1122 1117 1123 status = cli_full_connection(&cli, NULL, 1118 1124 r->in.dc_name, … … 1216 1222 done: 1217 1223 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 } 1220 1230 cli_rpc_pipe_close(pipe_hnd); 1221 1231 } … … 1248 1258 werr = smbconf_set_global_parameter(ctx, "workgroup", 1249 1259 r->in.domain_name); 1260 1261 smbconf_delete_global_parameter(ctx, "realm"); 1250 1262 goto done; 1251 1263 } … … 1321 1333 } 1322 1334 1335 lp_load(get_dyn_CONFIGFILE(),true,false,false,true); 1336 1323 1337 r->out.modified_config = true; 1324 1338 r->out.result = werr; … … 1346 1360 return werr; 1347 1361 } 1362 1363 lp_load(get_dyn_CONFIGFILE(),true,false,false,true); 1348 1364 1349 1365 r->out.modified_config = true; … … 1717 1733 ****************************************************************/ 1718 1734 1735 WERROR 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 1719 1764 WERROR libnet_Join(TALLOC_CTX *mem_ctx, 1720 1765 struct libnet_JoinCtx *r) … … 1736 1781 goto done; 1737 1782 } 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) { 1739 1791 werr = libnet_join_post_verify(mem_ctx, r); 1740 1792 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 1749 1797 done: 1750 1798 r->out.result = werr;
Note:
See TracChangeset
for help on using the changeset viewer.