Changeset 587 for vendor/current/source3/lib
- Timestamp:
- Jun 29, 2011, 7:36:41 AM (14 years ago)
- Location:
- vendor/current/source3/lib
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
vendor/current/source3/lib/netapi/cm.c
r414 r587 26 26 ********************************************************************/ 27 27 28 struct client_ipc_connection { 29 struct client_ipc_connection *prev, *next; 30 struct cli_state *cli; 31 struct client_pipe_connection *pipe_connections; 32 }; 33 34 struct client_pipe_connection { 35 struct client_pipe_connection *prev, *next; 36 struct rpc_pipe_client *pipe; 37 }; 38 39 /******************************************************************** 40 ********************************************************************/ 41 42 static struct client_ipc_connection *ipc_cm_find( 43 struct libnetapi_private_ctx *priv_ctx, const char *server_name) 44 { 45 struct client_ipc_connection *p; 46 47 for (p = priv_ctx->ipc_connections; p; p = p->next) { 48 if (strequal(p->cli->desthost, server_name)) { 49 return p; 50 } 51 } 52 53 return NULL; 54 } 55 56 /******************************************************************** 57 ********************************************************************/ 58 28 59 static WERROR libnetapi_open_ipc_connection(struct libnetapi_ctx *ctx, 29 60 const char *server_name, 30 struct cli_state **cli) 31 { 61 struct client_ipc_connection **pp) 62 { 63 struct libnetapi_private_ctx *priv_ctx = 64 (struct libnetapi_private_ctx *)ctx->private_data; 32 65 struct user_auth_info *auth_info = NULL; 33 66 struct cli_state *cli_ipc = NULL; 34 35 if (!ctx || !cli || !server_name) { 67 struct client_ipc_connection *p; 68 69 if (!ctx || !pp || !server_name) { 36 70 return WERR_INVALID_PARAM; 37 71 } 38 72 39 auth_info = user_auth_info_init(NULL); 73 p = ipc_cm_find(priv_ctx, server_name); 74 if (p) { 75 *pp = p; 76 return WERR_OK; 77 } 78 79 auth_info = user_auth_info_init(ctx); 40 80 if (!auth_info) { 41 81 return WERR_NOMEM; … … 79 119 } 80 120 81 *cli = cli_ipc; 121 p = TALLOC_ZERO_P(ctx, struct client_ipc_connection); 122 if (p == NULL) { 123 return WERR_NOMEM; 124 } 125 126 p->cli = cli_ipc; 127 DLIST_ADD(priv_ctx->ipc_connections, p); 128 129 *pp = p; 82 130 83 131 return WERR_OK; … … 87 135 ********************************************************************/ 88 136 89 struct client_pipe_connection {90 struct client_pipe_connection *prev, *next;91 struct rpc_pipe_client *pipe;92 struct cli_state *cli;93 };94 95 static struct client_pipe_connection *pipe_connections;96 97 /********************************************************************98 ********************************************************************/99 100 137 WERROR libnetapi_shutdown_cm(struct libnetapi_ctx *ctx) 101 138 { 102 struct client_pipe_connection *p; 103 104 for (p = pipe_connections; p; p = p->next) { 139 struct libnetapi_private_ctx *priv_ctx = 140 (struct libnetapi_private_ctx *)ctx->private_data; 141 struct client_ipc_connection *p; 142 143 for (p = priv_ctx->ipc_connections; p; p = p->next) { 105 144 cli_shutdown(p->cli); 106 145 } … … 112 151 ********************************************************************/ 113 152 114 static NTSTATUS pipe_cm_find(struct cli _state *cli,153 static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc, 115 154 const struct ndr_syntax_id *interface, 116 155 struct rpc_pipe_client **presult) … … 118 157 struct client_pipe_connection *p; 119 158 120 for (p = pipe_connections; p; p = p->next) {159 for (p = ipc->pipe_connections; p; p = p->next) { 121 160 122 161 if (!rpc_pipe_np_smb_conn(p->pipe)) { … … 124 163 } 125 164 126 if (strequal( cli->desthost, p->pipe->desthost)165 if (strequal(ipc->cli->desthost, p->pipe->desthost) 127 166 && ndr_syntax_id_equal(&p->pipe->abstract_syntax, 128 167 interface)) { … … 139 178 140 179 static NTSTATUS pipe_cm_connect(TALLOC_CTX *mem_ctx, 141 struct cli _state *cli,180 struct client_ipc_connection *ipc, 142 181 const struct ndr_syntax_id *interface, 143 182 struct rpc_pipe_client **presult) … … 151 190 } 152 191 153 status = cli_rpc_pipe_open_noauth( cli, interface, &p->pipe);192 status = cli_rpc_pipe_open_noauth(ipc->cli, interface, &p->pipe); 154 193 if (!NT_STATUS_IS_OK(status)) { 155 194 TALLOC_FREE(p); … … 157 196 } 158 197 159 p->cli = cli; 160 DLIST_ADD(pipe_connections, p); 198 DLIST_ADD(ipc->pipe_connections, p); 161 199 162 200 *presult = p->pipe; … … 168 206 169 207 static NTSTATUS pipe_cm_open(TALLOC_CTX *ctx, 170 struct cli _state *cli,208 struct client_ipc_connection *ipc, 171 209 const struct ndr_syntax_id *interface, 172 210 struct rpc_pipe_client **presult) 173 211 { 174 if (NT_STATUS_IS_OK(pipe_cm_find( cli, interface, presult))) {212 if (NT_STATUS_IS_OK(pipe_cm_find(ipc, interface, presult))) { 175 213 return NT_STATUS_OK; 176 214 } 177 215 178 return pipe_cm_connect(ctx, cli, interface, presult);216 return pipe_cm_connect(ctx, ipc, interface, presult); 179 217 } 180 218 … … 190 228 NTSTATUS status; 191 229 WERROR werr; 192 struct cli _state *cli= NULL;230 struct client_ipc_connection *ipc = NULL; 193 231 194 232 if (!presult) { … … 196 234 } 197 235 198 werr = libnetapi_open_ipc_connection(ctx, server_name, & cli);236 werr = libnetapi_open_ipc_connection(ctx, server_name, &ipc); 199 237 if (!W_ERROR_IS_OK(werr)) { 200 238 return werr; 201 239 } 202 240 203 status = pipe_cm_open(ctx, cli, interface, &result);241 status = pipe_cm_open(ctx, ipc, interface, &result); 204 242 if (!NT_STATUS_IS_OK(status)) { 205 243 libnetapi_set_error_string(ctx, "failed to open PIPE %s: %s", -
vendor/current/source3/lib/netapi/netapi_private.h
r414 r587 44 44 } samr; 45 45 46 struct client_ipc_connection *ipc_connections; 46 47 }; 47 48 -
vendor/current/source3/lib/system.c
r427 r587 535 535 dst->st_ex_ctime = get_ctimespec(src); 536 536 make_create_timespec(src, dst, fake_dir_create_times); 537 #ifdef HAVE_STAT_ST_BLKSIZE 537 538 dst->st_ex_blksize = src->st_blksize; 539 #else 540 dst->st_ex_blksize = STAT_ST_BLOCKSIZE; 541 #endif 542 543 #ifdef HAVE_STAT_ST_BLOCKS 538 544 dst->st_ex_blocks = src->st_blocks; 545 #else 546 dst->st_ex_blocks = src->st_size / dst->st_ex_blksize + 1; 547 #endif 539 548 540 549 #ifdef HAVE_STAT_ST_FLAGS -
vendor/current/source3/lib/tdb_validate.c
r414 r587 193 193 DEBUG(5, ("tdb_validate_open called for tdb '%s'\n", tdb_path)); 194 194 195 tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RD ONLY, 0);195 tdb = tdb_open_log(tdb_path, 0, TDB_DEFAULT, O_RDWR, 0); 196 196 if (!tdb) { 197 197 DEBUG(1, ("Error opening tdb %s\n", tdb_path));
Note:
See TracChangeset
for help on using the changeset viewer.