Changeset 745 for trunk/server/source4/rpc_server/srvsvc
- Timestamp:
- Nov 27, 2012, 4:43:17 PM (13 years ago)
- Location:
- trunk/server
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server
- Property svn:mergeinfo changed
/vendor/current merged: 581,587,591,594,597,600,615,618,740
- Property svn:mergeinfo changed
-
trunk/server/source4/rpc_server/srvsvc/dcesrv_srvsvc.c
r414 r745 25 25 #include "librpc/gen_ndr/ndr_srvsvc.h" 26 26 #include "rpc_server/common/common.h" 27 #include "rpc_server/common/share.h" 27 28 #include "auth/auth.h" 28 29 #include "libcli/security/security.h" … … 34 35 struct security_token *t = dce_call->conn->auth_state.session_info->security_token; \ 35 36 if (!security_token_has_builtin_administrators(t) && \ 36 !security_token_has_sid _string(t, SID_BUILTIN_SERVER_OPERATORS)) { \37 !security_token_has_sid(t, &global_sid_Builtin_Server_Operators)) { \ 37 38 return WERR_ACCESS_DENIED; \ 38 39 } \ … … 69 70 return WERR_UNKNOWN_LEVEL; 70 71 } 71 72 return WERR_OK;73 72 } 74 73 … … 94 93 return WERR_UNKNOWN_LEVEL; 95 94 } 96 97 return WERR_UNKNOWN_LEVEL;98 95 } 99 96 … … 141 138 return WERR_UNKNOWN_LEVEL; 142 139 } 143 144 return WERR_UNKNOWN_LEVEL;145 140 } 146 141 … … 166 161 return WERR_UNKNOWN_LEVEL; 167 162 } 168 169 return WERR_UNKNOWN_LEVEL;170 163 } 171 164 … … 195 188 return WERR_UNKNOWN_LEVEL; 196 189 } 197 198 return WERR_UNKNOWN_LEVEL;199 190 } 200 191 … … 252 243 return WERR_UNKNOWN_LEVEL; 253 244 } 254 255 return WERR_UNKNOWN_LEVEL;256 245 } 257 246 … … 289 278 return WERR_UNKNOWN_LEVEL; 290 279 } 291 292 return WERR_UNKNOWN_LEVEL;293 280 } 294 281 … … 314 301 return WERR_UNKNOWN_LEVEL; 315 302 } 316 317 return WERR_UNKNOWN_LEVEL;318 303 } 319 304 … … 391 376 return WERR_UNKNOWN_LEVEL; 392 377 } 393 394 return WERR_UNKNOWN_LEVEL;395 378 } 396 379 … … 432 415 struct share_info *info; 433 416 struct share_context *sctx; 434 int count = 8;435 int i;436 437 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);417 unsigned int count = 8; 418 unsigned int i; 419 420 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 438 421 if (!NT_STATUS_IS_OK(nterr)) { 439 422 return ntstatus_to_werror(nterr); … … 449 432 info[i].type = SHARE_INFO_STRING; 450 433 switch (r->in.info->info2->type) { 451 case 0x00:434 case STYPE_DISKTREE: 452 435 info[i].value = talloc_strdup(info, "DISK"); 453 436 break; 454 case 0x01:437 case STYPE_PRINTQ: 455 438 info[i].value = talloc_strdup(info, "PRINTER"); 456 439 break; 457 case 0x03:440 case STYPE_IPC: 458 441 info[i].value = talloc_strdup(info, "IPC"); 459 442 break; … … 530 513 struct share_info *info; 531 514 struct share_context *sctx; 532 int count = 10;533 int i;534 535 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);515 unsigned int count = 10; 516 unsigned int i; 517 518 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 536 519 if (!NT_STATUS_IS_OK(nterr)) { 537 520 return ntstatus_to_werror(nterr); … … 619 602 return WERR_UNKNOWN_LEVEL; 620 603 } 621 622 return WERR_UNKNOWN_LEVEL;623 604 } 624 605 … … 700 681 return WERR_UNKNOWN_LEVEL; 701 682 } 702 703 return WERR_UNKNOWN_LEVEL;704 683 } 705 684 … … 721 700 */ 722 701 723 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);702 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 724 703 if (!NT_STATUS_IS_OK(nterr)) { 725 704 return ntstatus_to_werror(nterr); … … 734 713 case 0: 735 714 { 736 int i;715 unsigned int i; 737 716 struct srvsvc_NetShareCtr0 *ctr0; 738 717 … … 775 754 case 1: 776 755 { 777 int i;756 unsigned int i; 778 757 struct srvsvc_NetShareCtr1 *ctr1; 779 758 … … 817 796 case 2: 818 797 { 819 int i;798 unsigned int i; 820 799 struct srvsvc_NetShareCtr2 *ctr2; 821 800 … … 861 840 case 501: 862 841 { 863 int i;842 unsigned int i; 864 843 struct srvsvc_NetShareCtr501 *ctr501; 865 844 … … 905 884 case 502: 906 885 { 907 int i;886 unsigned int i; 908 887 struct srvsvc_NetShareCtr502 *ctr502; 909 888 … … 950 929 return WERR_UNKNOWN_LEVEL; 951 930 } 952 953 return WERR_UNKNOWN_LEVEL;954 931 } 955 932 … … 974 951 } 975 952 976 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);953 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 977 954 if (!NT_STATUS_IS_OK(nterr)) { 978 955 return ntstatus_to_werror(nterr); … … 1088 1065 return WERR_UNKNOWN_LEVEL; 1089 1066 } 1090 1091 return WERR_UNKNOWN_LEVEL;1092 1067 } 1093 1068 … … 1103 1078 struct security_descriptor *sd) 1104 1079 { 1105 int i = 0;1080 unsigned int i = 0; 1106 1081 1107 1082 if (level == 501) { … … 1222 1197 W_ERROR_HAVE_NO_MEMORY(info); 1223 1198 1224 ZERO_STRUCT(r->out);1225 1226 1199 if (strcmp("", r->in.share_name) == 0) { 1227 1200 return WERR_INVALID_PARAM; 1228 1201 } 1229 1202 1230 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);1203 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 1231 1204 if (!NT_STATUS_IS_OK(nterr)) { 1232 1205 return ntstatus_to_werror(nterr); … … 1384 1357 char *device; 1385 1358 const char **names; 1386 int count, i; 1359 int count; 1360 int i; 1387 1361 1388 1362 *r->out.type = 0; … … 1405 1379 all_string_sub(device, "\\", "/", 0); 1406 1380 1407 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);1381 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 1408 1382 if (!NT_STATUS_IS_OK(nterr)) { 1409 1383 return ntstatus_to_werror(nterr); … … 1458 1432 { 1459 1433 struct dcesrv_context *dce_ctx = dce_call->conn->dce_ctx; 1460 struct dcerpc_server_info *server_info = lp _dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx);1434 struct dcerpc_server_info *server_info = lpcfg_dcerpc_server_info(mem_ctx, dce_ctx->lp_ctx); 1461 1435 1462 1436 ZERO_STRUCTP(r->out.info); … … 1491 1465 info101->version_minor = server_info->version_minor; 1492 1466 info101->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx); 1493 info101->comment = talloc_strdup(mem_ctx, lp _serverstring(dce_ctx->lp_ctx));1467 info101->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx)); 1494 1468 W_ERROR_HAVE_NO_MEMORY(info101->comment); 1495 1469 … … 1511 1485 info102->version_minor = server_info->version_minor; 1512 1486 info102->server_type = dcesrv_common_get_server_type(mem_ctx, dce_call->event_ctx, dce_ctx); 1513 info102->comment = talloc_strdup(mem_ctx, lp _serverstring(dce_ctx->lp_ctx));1487 info102->comment = talloc_strdup(mem_ctx, lpcfg_serverstring(dce_ctx->lp_ctx)); 1514 1488 W_ERROR_HAVE_NO_MEMORY(info102->comment); 1515 1489 … … 1529 1503 return WERR_UNKNOWN_LEVEL; 1530 1504 } 1531 1532 return WERR_UNKNOWN_LEVEL;1533 1505 } 1534 1506 … … 1577 1549 return WERR_UNKNOWN_LEVEL; 1578 1550 } 1579 1580 return WERR_UNKNOWN_LEVEL;1581 1551 } 1582 1552 … … 1658 1628 return WERR_UNKNOWN_LEVEL; 1659 1629 } 1660 1661 return WERR_UNKNOWN_LEVEL;1662 1630 } 1663 1631 … … 1788 1756 return WERR_INVALID_PARAM; 1789 1757 } 1790 1791 return WERR_INVALID_PARAM;1792 1758 } 1793 1759 … … 1821 1787 */ 1822 1788 1823 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);1789 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 1824 1790 if (!NT_STATUS_IS_OK(nterr)) { 1825 1791 return ntstatus_to_werror(nterr); … … 1834 1800 case 0: 1835 1801 { 1836 int i, y = 0;1837 int count;1802 unsigned int i, y = 0; 1803 unsigned int count; 1838 1804 struct srvsvc_NetShareCtr0 *ctr0; 1839 1805 … … 1886 1852 case 1: 1887 1853 { 1888 int i, y = 0;1889 int count;1854 unsigned int i, y = 0; 1855 unsigned int count; 1890 1856 struct srvsvc_NetShareCtr1 *ctr1; 1891 1857 … … 1938 1904 case 2: 1939 1905 { 1940 int i, y = 0;1941 int count;1906 unsigned int i, y = 0; 1907 unsigned int count; 1942 1908 struct srvsvc_NetShareCtr2 *ctr2; 1943 1909 … … 1992 1958 case 502: 1993 1959 { 1994 int i, y = 0;1995 int count;1960 unsigned int i, y = 0; 1961 unsigned int count; 1996 1962 struct srvsvc_NetShareCtr502 *ctr502; 1997 1963 … … 2047 2013 return WERR_UNKNOWN_LEVEL; 2048 2014 } 2049 2050 return WERR_UNKNOWN_LEVEL;2051 2015 } 2052 2016 … … 2288 2252 struct share_context *sctx; 2289 2253 2290 nterr = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);2254 nterr = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 2291 2255 if (!NT_STATUS_IS_OK(nterr)) { 2292 2256 return ntstatus_to_werror(nterr); -
trunk/server/source4/rpc_server/srvsvc/srvsvc_ntvfs.c
r414 r745 22 22 #include "ntvfs/ntvfs.h" 23 23 #include "rpc_server/dcerpc_server.h" 24 #include "librpc/gen_ndr/ndr_srvsvc.h"25 #include "rpc_server/common/common.h"26 #include "rpc_server/srvsvc/proto.h"27 #include "lib/socket/socket.h"28 24 #include "param/param.h" 29 30 struct socket_address *srvsvc_get_my_addr(void *p, TALLOC_CTX *mem_ctx)31 {32 struct dcesrv_connection *conn = talloc_get_type(p, struct dcesrv_connection);33 return dcesrv_connection_get_my_addr(conn, mem_ctx);34 }35 36 struct socket_address *srvsvc_get_peer_addr(void *p, TALLOC_CTX *mem_ctx)37 {38 struct dcesrv_connection *conn = talloc_get_type(p, struct dcesrv_connection);39 return dcesrv_connection_get_peer_addr(conn, mem_ctx);40 }41 25 42 26 struct srvsvc_ntvfs_ctx { … … 62 46 struct share_config *scfg; 63 47 const char *sharetype; 48 union smb_tcon tcon; 49 const struct tsocket_address *local_address; 50 const struct tsocket_address *remote_address; 64 51 65 status = share_get_context_by_name(mem_ctx, lp _share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx);52 status = share_get_context_by_name(mem_ctx, lpcfg_share_backend(dce_call->conn->dce_ctx->lp_ctx), dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx, &sctx); 66 53 if (!NT_STATUS_IS_OK(status)) { 67 54 return status; … … 115 102 * NOTE: we only set the addr callbacks as we're not interesseted in oplocks or in getting file handles 116 103 */ 117 status = ntvfs_set_addr_callbacks(c->ntvfs, srvsvc_get_my_addr, srvsvc_get_peer_addr, dce_call->conn); 104 local_address = dcesrv_connection_get_local_address(dce_call->conn); 105 remote_address = dcesrv_connection_get_remote_address(dce_call->conn); 106 status = ntvfs_set_addresses(c->ntvfs, local_address, remote_address); 118 107 if (!NT_STATUS_IS_OK(status)) { 119 108 DEBUG(0,("srvsvc_create_ntvfs_context: NTVFS failed to set the addr callbacks!\n")); … … 129 118 130 119 /* Invoke NTVFS connection hook */ 131 status = ntvfs_connect(ntvfs_req, scfg->name); 120 tcon.tcon.level = RAW_TCON_TCON; 121 ZERO_STRUCT(tcon.tcon.in); 122 tcon.tcon.in.service = scfg->name; 123 status = ntvfs_connect(ntvfs_req, &tcon); 132 124 if (!NT_STATUS_IS_OK(status)) { 133 125 DEBUG(0,("srvsvc_create_ntvfs_context: NTVFS ntvfs_connect() failed!\n"));
Note:
See TracChangeset
for help on using the changeset viewer.