Changeset 740 for vendor/current/source4/ntvfs/ipc
- Timestamp:
- Nov 14, 2012, 12:59:34 PM (13 years ago)
- Location:
- vendor/current/source4/ntvfs/ipc
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source4/ntvfs/ipc/ipc_rap.c
r414 r740 21 21 #include "includes.h" 22 22 #include "libcli/raw/interfaces.h" 23 #include " libcli/rap/rap.h"23 #include "../librpc/gen_ndr/rap.h" 24 24 #include "events/events.h" 25 25 #include "ntvfs/ipc/proto.h" … … 125 125 call->mem_ctx = mem_ctx; 126 126 127 call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx , lp_iconv_convenience(lp_ctx));127 call->ndr_pull_param = ndr_pull_init_blob(&trans->in.params, mem_ctx); 128 128 call->ndr_pull_param->flags = RAPNDR_FLAGS; 129 129 130 call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx , lp_iconv_convenience(lp_ctx));130 call->ndr_pull_data = ndr_pull_init_blob(&trans->in.data, mem_ctx); 131 131 call->ndr_pull_data->flags = RAPNDR_FLAGS; 132 132 … … 292 292 case 0: 293 293 NDR_GOTO(ndr_push_bytes(call->ndr_push_data, 294 (const uint8_t *)r.out.info[i].info0. name,295 sizeof(r.out.info[i].info0. name)));294 (const uint8_t *)r.out.info[i].info0.share_name, 295 sizeof(r.out.info[i].info0.share_name))); 296 296 break; 297 297 case 1: 298 298 NDR_GOTO(ndr_push_bytes(call->ndr_push_data, 299 (const uint8_t *)r.out.info[i].info1. name,300 sizeof(r.out.info[i].info1. name)));299 (const uint8_t *)r.out.info[i].info1.share_name, 300 sizeof(r.out.info[i].info1.share_name))); 301 301 NDR_GOTO(ndr_push_uint8(call->ndr_push_data, 302 NDR_SCALARS, r.out.info[i].info1. pad));302 NDR_SCALARS, r.out.info[i].info1.reserved1)); 303 303 NDR_GOTO(ndr_push_uint16(call->ndr_push_data, 304 NDR_SCALARS, r.out.info[i].info1. type));304 NDR_SCALARS, r.out.info[i].info1.share_type)); 305 305 306 306 RAP_GOTO(rap_push_string(call->ndr_push_data, … … 455 455 &call->datadesc)); 456 456 457 call->ndr_push_param = ndr_push_init_ctx(call , lp_iconv_convenience(lp_ctx));458 call->ndr_push_data = ndr_push_init_ctx(call , lp_iconv_convenience(lp_ctx));457 call->ndr_push_param = ndr_push_init_ctx(call); 458 call->ndr_push_data = ndr_push_init_ctx(call); 459 459 460 460 if ((call->ndr_push_param == NULL) || (call->ndr_push_data == NULL)) … … 481 481 result_data = ndr_push_blob(call->ndr_push_data); 482 482 483 final_param = ndr_push_init_ctx(call , lp_iconv_convenience(lp_ctx));484 final_data = ndr_push_init_ctx(call , lp_iconv_convenience(lp_ctx));483 final_param = ndr_push_init_ctx(call); 484 final_data = ndr_push_init_ctx(call); 485 485 486 486 if ((final_param == NULL) || (final_data == NULL)) -
vendor/current/source4/ntvfs/ipc/rap_server.c
r414 r740 21 21 #include "includes.h" 22 22 #include "param/share.h" 23 #include " libcli/rap/rap.h"23 #include "../librpc/gen_ndr/rap.h" 24 24 #include "libcli/raw/interfaces.h" 25 25 #include "librpc/gen_ndr/srvsvc.h" 26 #include "librpc/gen_ndr/dcerpc.h" 26 27 #include "rpc_server/common/common.h" 28 #include "rpc_server/common/share.h" 27 29 #include "param/param.h" 28 30 #include "ntvfs/ipc/ipc.h" … … 47 49 r->out.info = NULL; 48 50 49 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(lp_ctx), event_ctx, lp_ctx, &sctx);51 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(lp_ctx), event_ctx, lp_ctx, &sctx); 50 52 if (!NT_STATUS_IS_OK(nterr)) { 51 53 return nterr; … … 59 61 r->out.available = count; 60 62 r->out.info = talloc_array(mem_ctx, 61 union rap_share enum_info, r->out.available);63 union rap_share_info, r->out.available); 62 64 63 65 for (i = 0, j = 0; i < r->out.available; i++) { … … 66 68 continue; 67 69 } 68 strncpy( r->out.info[j].info1.name,70 strncpy((char *)r->out.info[j].info1.share_name, 69 71 snames[i], 70 sizeof(r->out.info[0].info1. name));71 r->out.info[i].info1. pad= 0;72 r->out.info[i].info1. type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg);72 sizeof(r->out.info[0].info1.share_name)); 73 r->out.info[i].info1.reserved1 = 0; 74 r->out.info[i].info1.share_type = dcesrv_common_get_share_type(mem_ctx, NULL, scfg); 73 75 r->out.info[i].info1.comment = talloc_strdup(mem_ctx, share_string_option(scfg, SHARE_COMMENT, "")); 74 76 talloc_free(scfg); -
vendor/current/source4/ntvfs/ipc/vfs_ipc.c
r414 r740 28 28 #include "../lib/util/dlinklist.h" 29 29 #include "ntvfs/ntvfs.h" 30 #include " libcli/rap/rap.h"30 #include "../librpc/gen_ndr/rap.h" 31 31 #include "ntvfs/ipc/proto.h" 32 32 #include "libcli/raw/ioctl.h" … … 218 218 struct ntvfs_request *req; 219 219 union smb_open *oi; 220 struct netr_SamInfo3 *info3;220 struct auth_session_info_transport *session_info_transport; 221 221 }; 222 222 … … 229 229 { 230 230 while (*name) { 231 if (!isalnum(*name)) return NT_STATUS_INVALID_PARAMETER; 231 if (!isalnum(*name) && *name != '_') { 232 return NT_STATUS_INVALID_PARAMETER; 233 } 232 234 name++; 233 235 } … … 245 247 struct ipc_private *ipriv = talloc_get_type_abort(ntvfs->private_data, 246 248 struct ipc_private); 247 struct smb_iconv_convenience *smb_ic248 = lp_iconv_convenience(ipriv->ntvfs->ctx->lp_ctx);249 249 struct ntvfs_handle *h; 250 250 struct ipc_open_state *state; … … 252 252 const char *fname; 253 253 const char *directory; 254 struct socket_address *client_sa; 255 struct tsocket_address *client_addr; 256 struct socket_address *server_sa; 257 struct tsocket_address *server_addr; 258 int ret; 259 DATA_BLOB delegated_creds = data_blob_null; 254 const struct tsocket_address *client_addr; 255 const struct tsocket_address *server_addr; 260 256 261 257 switch (oi->generic.level) { 262 258 case RAW_OPEN_NTCREATEX: 259 case RAW_OPEN_NTTRANS_CREATE: 263 260 fname = oi->ntcreatex.in.fname; 264 261 break; … … 270 267 break; 271 268 default: 272 status = NT_STATUS_NOT_SUPPORTED; 273 break; 269 return NT_STATUS_NOT_SUPPORTED; 274 270 } 275 271 276 272 directory = talloc_asprintf(req, "%s/np", 277 lp _ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx));273 lpcfg_ncalrpc_dir(ipriv->ntvfs->ctx->lp_ctx)); 278 274 NT_STATUS_HAVE_NO_MEMORY(directory); 279 275 … … 312 308 state->oi = oi; 313 309 314 status = auth_convert_server_info_saminfo3(state, 315 req->session_info->server_info, 316 &state->info3); 310 status = auth_session_info_transport_from_session(state, 311 req->session_info, 312 ipriv->ntvfs->ctx->event_ctx, 313 ipriv->ntvfs->ctx->lp_ctx, 314 &state->session_info_transport); 315 317 316 NT_STATUS_NOT_OK_RETURN(status); 318 317 319 client_sa = ntvfs_get_peer_addr(ntvfs, state); 320 if (!client_sa) { 321 return NT_STATUS_INTERNAL_ERROR; 322 } 323 324 server_sa = ntvfs_get_my_addr(ntvfs, state); 325 if (!server_sa) { 326 return NT_STATUS_INTERNAL_ERROR; 327 } 328 329 ret = tsocket_address_inet_from_strings(state, "ip", 330 client_sa->addr, 331 client_sa->port, 332 &client_addr); 333 if (ret == -1) { 334 status = map_nt_error_from_unix(errno); 335 return status; 336 } 337 338 ret = tsocket_address_inet_from_strings(state, "ip", 339 server_sa->addr, 340 server_sa->port, 341 &server_addr); 342 if (ret == -1) { 343 status = map_nt_error_from_unix(errno); 344 return status; 345 } 346 347 if (req->session_info->credentials) { 348 struct gssapi_creds_container *gcc; 349 OM_uint32 gret; 350 OM_uint32 minor_status; 351 gss_buffer_desc cred_token; 352 353 ret = cli_credentials_get_client_gss_creds(req->session_info->credentials, 354 ipriv->ntvfs->ctx->event_ctx, 355 ipriv->ntvfs->ctx->lp_ctx, 356 &gcc); 357 if (ret) { 358 goto skip; 359 } 360 361 gret = gss_export_cred(&minor_status, 362 gcc->creds, 363 &cred_token); 364 if (gret != GSS_S_COMPLETE) { 365 return NT_STATUS_INTERNAL_ERROR; 366 } 367 368 if (cred_token.length) { 369 delegated_creds = data_blob_talloc(req, 370 cred_token.value, 371 cred_token.length); 372 gss_release_buffer(&minor_status, &cred_token); 373 NT_STATUS_HAVE_NO_MEMORY(delegated_creds.data); 374 } 375 } 376 377 skip: 318 client_addr = ntvfs_get_local_address(ipriv->ntvfs); 319 server_addr = ntvfs_get_remote_address(ipriv->ntvfs); 378 320 379 321 subreq = tstream_npa_connect_send(p, 380 322 ipriv->ntvfs->ctx->event_ctx, 381 smb_ic,382 323 directory, 383 324 fname, … … 386 327 server_addr, 387 328 NULL, 388 state->info3, 389 req->session_info->session_key, 390 delegated_creds); 329 state->session_info_transport); 391 330 NT_STATUS_HAVE_NO_MEMORY(subreq); 392 331 tevent_req_set_callback(subreq, ipc_open_done, state); … … 531 470 s->buf = buf; 532 471 s->len = MIN(len, UINT16_MAX); 533 //DEBUG(0,("readv_next_vector_init[%u 0x%04X]\n", s->len, s->len));534 472 } 535 473 … … 549 487 *_vector = NULL; 550 488 *count = 0; 551 // DEBUG(0,("readv_next_vector done ofs[%u 0x%04X]\n",552 // state->ofs, state->ofs));553 489 return 0; 554 490 } … … 563 499 *_vector = NULL; 564 500 *count = 0; 565 // DEBUG(0,("readv_next_vector short read ofs[%u 0x%04X]\n",566 // state->ofs, state->ofs));567 501 return 0; 568 502 } … … 588 522 } 589 523 590 vector[0].iov_base = state->buf + state->ofs;524 vector[0].iov_base = (char *) (state->buf + state->ofs); 591 525 vector[0].iov_len = wanted; 592 526 … … 928 862 return ntvfs_map_qfileinfo(ntvfs, req, info); 929 863 } 930 931 return NT_STATUS_ACCESS_DENIED;932 864 } 933 865 … … 1041 973 state->req = req; 1042 974 state->trans = trans; 1043 state->writev_iov.iov_base = trans->in.data.data;975 state->writev_iov.iov_base = (char *) trans->in.data.data; 1044 976 state->writev_iov.iov_len = trans->in.data.length; 1045 977 … … 1250 1182 state->req = req; 1251 1183 state->io = io; 1252 state->writev_iov.iov_base = io->smb2.in.out.data;1184 state->writev_iov.iov_base = (char *) io->smb2.in.out.data; 1253 1185 state->writev_iov.iov_len = io->smb2.in.out.length; 1254 1186 … … 1352 1284 return NT_STATUS_ACCESS_DENIED; 1353 1285 } 1354 1355 return NT_STATUS_ACCESS_DENIED;1356 1286 } 1357 1287
Note:
See TracChangeset
for help on using the changeset viewer.