Changeset 988 for vendor/current/source4/libcli/util
- Timestamp:
- Nov 24, 2016, 1:14:11 PM (9 years ago)
- Location:
- vendor/current/source4/libcli/util
- Files:
-
- 2 deleted
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/libcli/util/clilsa.c
r860 r988 33 33 #include "librpc/gen_ndr/ndr_lsa_c.h" 34 34 #include "libcli/util/clilsa.h" 35 #include "libcli/smb/smbXcli_base.h" 35 36 36 37 struct smblsa_state { 37 struct dcerpc_ pipe *pipe;38 struct dcerpc_binding_handle *binding_handle; 38 39 struct smbcli_tree *ipc_tree; 39 40 struct policy_handle handle; … … 46 47 { 47 48 struct smblsa_state *lsa; 49 struct dcerpc_pipe *lsa_pipe; 48 50 NTSTATUS status; 49 51 struct lsa_OpenPolicy r; … … 69 71 /* connect to IPC$ */ 70 72 tcon.generic.level = RAW_TCON_TCONX; 71 tcon.tconx.in.flags = 0; 73 tcon.tconx.in.flags = TCONX_FLAG_EXTENDED_RESPONSE; 74 tcon.tconx.in.flags |= TCONX_FLAG_EXTENDED_SIGNATURES; 72 75 tcon.tconx.in.password = data_blob(NULL, 0); 73 76 tcon.tconx.in.path = "ipc$"; … … 80 83 lsa->ipc_tree->tid = tcon.tconx.out.tid; 81 84 82 lsa->pipe = dcerpc_pipe_init(lsa, cli->transport->socket->event.ctx); 83 if (lsa->pipe == NULL) { 85 if (tcon.tconx.out.options & SMB_EXTENDED_SIGNATURES) { 86 smb1cli_session_protect_session_key(cli->session->smbXcli); 87 } 88 89 lsa_pipe = dcerpc_pipe_init(lsa, cli->transport->ev); 90 if (lsa_pipe == NULL) { 84 91 talloc_free(lsa); 85 92 return NT_STATUS_NO_MEMORY; … … 87 94 88 95 /* open the LSA pipe */ 89 status = dcerpc_pipe_open_smb(lsa ->pipe, lsa->ipc_tree, NDR_LSARPC_NAME);96 status = dcerpc_pipe_open_smb(lsa_pipe, lsa->ipc_tree, NDR_LSARPC_NAME); 90 97 if (!NT_STATUS_IS_OK(status)) { 91 98 talloc_free(lsa); … … 94 101 95 102 /* bind to the LSA pipe */ 96 status = dcerpc_bind_auth_none(lsa ->pipe, &ndr_table_lsarpc);103 status = dcerpc_bind_auth_none(lsa_pipe, &ndr_table_lsarpc); 97 104 if (!NT_STATUS_IS_OK(status)) { 98 105 talloc_free(lsa); 99 106 return status; 100 107 } 101 108 lsa->binding_handle = lsa_pipe->binding_handle; 102 109 103 110 /* open a lsa policy handle */ … … 119 126 r.out.handle = &lsa->handle; 120 127 121 status = dcerpc_lsa_OpenPolicy_r(lsa-> pipe->binding_handle, lsa, &r);128 status = dcerpc_lsa_OpenPolicy_r(lsa->binding_handle, lsa, &r); 122 129 if (!NT_STATUS_IS_OK(status)) { 123 130 talloc_free(lsa); … … 155 162 r.out.rights = rights; 156 163 157 status = dcerpc_lsa_EnumAccountRights_r(cli->lsa-> pipe->binding_handle, mem_ctx, &r);164 status = dcerpc_lsa_EnumAccountRights_r(cli->lsa->binding_handle, mem_ctx, &r); 158 165 if (!NT_STATUS_IS_OK(status)) { 159 166 return status; … … 244 251 r.out.domains = &domains; 245 252 246 status = dcerpc_lsa_LookupSids_r(cli->lsa-> pipe->binding_handle, mem_ctx2, &r);253 status = dcerpc_lsa_LookupSids_r(cli->lsa->binding_handle, mem_ctx2, &r); 247 254 if (!NT_STATUS_IS_OK(status)) { 248 255 talloc_free(mem_ctx2); … … 319 326 r.out.domains = &domains; 320 327 321 status = dcerpc_lsa_LookupNames_r(cli->lsa-> pipe->binding_handle, mem_ctx2, &r);328 status = dcerpc_lsa_LookupNames_r(cli->lsa->binding_handle, mem_ctx2, &r); 322 329 if (!NT_STATUS_IS_OK(status)) { 323 330 talloc_free(mem_ctx2); … … 368 375 r.in.rights = rights; 369 376 370 status = dcerpc_lsa_AddAccountRights_r(cli->lsa-> pipe->binding_handle, mem_ctx, &r);377 status = dcerpc_lsa_AddAccountRights_r(cli->lsa->binding_handle, mem_ctx, &r); 371 378 if (!NT_STATUS_IS_OK(status)) { 372 379 return status; … … 396 403 r.in.rights = rights; 397 404 398 status = dcerpc_lsa_RemoveAccountRights_r(cli->lsa-> pipe->binding_handle, mem_ctx, &r);405 status = dcerpc_lsa_RemoveAccountRights_r(cli->lsa->binding_handle, mem_ctx, &r); 399 406 if (!NT_STATUS_IS_OK(status)) { 400 407 return status; -
vendor/current/source4/libcli/util/pyerrors.h
r740 r988 23 23 #define PyErr_FromWERROR(err) Py_BuildValue("(i,s)", W_ERROR_V(err), discard_const_p(char, win_errstr(err))) 24 24 25 #define PyErr_FromHRESULT(err) Py_BuildValue("(i,s)", HRES_ERROR_V(err), discard_const_p(char, hresult_errstr_const(err))) 26 25 27 #define PyErr_FromNTSTATUS(status) Py_BuildValue("(i,s)", NT_STATUS_V(status), discard_const_p(char, get_friendly_nt_error_msg(status))) 26 28 … … 39 41 } 40 42 41 #define PyErr_WERROR_IS_ERR_RAISE(status) \ 43 #define PyErr_NTSTATUS_NOT_OK_RAISE(status) \ 44 if (!NT_STATUS_IS_OK(status)) { \ 45 PyErr_SetNTSTATUS(status); \ 46 return NULL; \ 47 } 48 49 #define PyErr_WERROR_NOT_OK_RAISE(status) \ 42 50 if (!W_ERROR_IS_OK(status)) { \ 43 51 PyErr_SetWERROR(status); \
Note:
See TracChangeset
for help on using the changeset viewer.