diff options
author | Gerald Carter <jerry@samba.org> | 2002-10-04 21:42:04 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2002-10-04 21:42:04 +0000 |
commit | 055e6d1491d56c85f01e70cf83a928fa6492e2aa (patch) | |
tree | 15213b550263aff40bcb8ad893213669104d4d10 /source3/rpc_client | |
parent | 9c1b62c0fd06cc65853269db3c63b169daa90664 (diff) | |
download | samba-055e6d1491d56c85f01e70cf83a928fa6492e2aa.tar.gz samba-055e6d1491d56c85f01e70cf83a928fa6492e2aa.tar.bz2 samba-055e6d1491d56c85f01e70cf83a928fa6492e2aa.zip |
* merge native_mode flag in winbindd_domain struct from app-head
* add some files missing from a previous commit
(This used to be commit 29159c97371c75327e377f9d13406dad46095568)
Diffstat (limited to 'source3/rpc_client')
-rw-r--r-- | source3/rpc_client/cli_pipe.c | 42 |
1 files changed, 11 insertions, 31 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 2732c53e5c..7e1289edff 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -952,65 +952,45 @@ static BOOL rpc_pipe_set_hnd_state(struct cli_state *cli, const char *pipe_name, return state_set; } -#if 0 /* JERRY */ - /**************************************************************************** check the rpc bind acknowledge response ****************************************************************************/ -static BOOL valid_pipe_name(const char *pipe_name, RPC_IFACE *abstract, RPC_IFACE *transfer) +int get_pipe_index( const char *pipe_name ) { int pipe_idx = 0; while (pipe_names[pipe_idx].client_pipe != NULL) { - if (strequal(pipe_name, pipe_names[pipe_idx].client_pipe )) { - DEBUG(5,("Bind Abstract Syntax: ")); - dump_data(5, (char*)&(pipe_names[pipe_idx].abstr_syntax), - sizeof(pipe_names[pipe_idx].abstr_syntax)); - DEBUG(5,("Bind Transfer Syntax: ")); - dump_data(5, (char*)&(pipe_names[pipe_idx].trans_syntax), - sizeof(pipe_names[pipe_idx].trans_syntax)); - - /* copy the required syntaxes out so we can do the right bind */ - *transfer = pipe_names[pipe_idx].trans_syntax; - *abstract = pipe_names[pipe_idx].abstr_syntax; - - return True; - } + if (strequal(pipe_name, pipe_names[pipe_idx].client_pipe )) + return pipe_idx; pipe_idx++; }; - DEBUG(5,("Bind RPC Pipe[%s] unsupported\n", pipe_name)); - return False; + return -1; } -#endif /**************************************************************************** check the rpc bind acknowledge response ****************************************************************************/ -int get_pipe_index( const char *pipe_name ) +char* get_pipe_name_from_index( const int pipe_index ) { - int pipe_idx = 0; - while (pipe_names[pipe_idx].client_pipe != NULL) { - if (strequal(pipe_name, pipe_names[pipe_idx].client_pipe )) - return pipe_idx; - pipe_idx++; - }; + if ( (pipe_index < 0) || (pipe_index >= PI_MAX_PIPES) ) + return NULL; - return -1; + return pipe_names[pipe_index].client_pipe; } /**************************************************************************** check the rpc bind acknowledge response ****************************************************************************/ -static BOOL valid_pipe_name_by_idx(const int pipe_idx, RPC_IFACE *abstract, RPC_IFACE *transfer) +static BOOL valid_pipe_name(const int pipe_idx, RPC_IFACE *abstract, RPC_IFACE *transfer) { if ( pipe_idx >= PI_MAX_PIPES ) { - DEBUG(0,("valid_pipe_name_by_idx: Programmer error! Invalid pipe index [%d]\n", + DEBUG(0,("valid_pipe_name: Programmer error! Invalid pipe index [%d]\n", pipe_idx)); return False; } @@ -1178,7 +1158,7 @@ BOOL rpc_pipe_bind(struct cli_state *cli, const int pipe_idx, char *my_name) DEBUG(5,("Bind RPC Pipe[%x]: %s\n", cli->nt_pipe_fnum, pipe_names[pipe_idx].client_pipe)); - if (!valid_pipe_name_by_idx(pipe_idx, &abstract, &transfer)) + if (!valid_pipe_name(pipe_idx, &abstract, &transfer)) return False; prs_init(&rpc_out, 0, cli->mem_ctx, MARSHALL); |