summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-20 11:04:31 +0200
committerVolker Lendecke <vl@samba.org>2008-07-20 17:37:14 +0200
commit55f84c05bdb33f9c97bb71240e02a8f5a77b3355 (patch)
tree0b74852ba151245ab1dc8abcc15b34a4b789b26d
parent99526d391dc274eb87cfd0b393363d8ceafccda9 (diff)
downloadsamba-55f84c05bdb33f9c97bb71240e02a8f5a77b3355.tar.gz
samba-55f84c05bdb33f9c97bb71240e02a8f5a77b3355.tar.bz2
samba-55f84c05bdb33f9c97bb71240e02a8f5a77b3355.zip
Refactoring: Change calling conventions for cli_rpc_pipe_open_krb5
Pass in ndr_syntax_id instead of pipe_idx, return NTSTATUS (This used to be commit f2656e5c2e700523ead7a62734d203ad0caaff0c)
-rw-r--r--source3/include/proto.h14
-rw-r--r--source3/rpc_client/cli_pipe.c47
2 files changed, 31 insertions, 30 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index ab09462a9f..2612953051 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -7140,13 +7140,13 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
enum pipe_auth_level auth_level,
const char *domain,
struct rpc_pipe_client **presult);
-struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
- int pipe_idx,
- enum pipe_auth_level auth_level,
- const char *service_princ,
- const char *username,
- const char *password,
- NTSTATUS *perr);
+NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
+ const struct ndr_syntax_id *interface,
+ enum pipe_auth_level auth_level,
+ const char *service_princ,
+ const char *username,
+ const char *password,
+ struct rpc_pipe_client **presult);
NTSTATUS cli_get_session_key(TALLOC_CTX *mem_ctx,
struct rpc_pipe_client *cli,
DATA_BLOB *session_key);
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index e9a9480e35..b5a188ed76 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -3408,45 +3408,46 @@ NTSTATUS cli_rpc_pipe_open_schannel(struct cli_state *cli,
NULL so long as the caller has a TGT.
****************************************************************************/
-struct rpc_pipe_client *cli_rpc_pipe_open_krb5(struct cli_state *cli,
- int pipe_idx,
- enum pipe_auth_level auth_level,
- const char *service_princ,
- const char *username,
- const char *password,
- NTSTATUS *perr)
+NTSTATUS cli_rpc_pipe_open_krb5(struct cli_state *cli,
+ const struct ndr_syntax_id *interface,
+ enum pipe_auth_level auth_level,
+ const char *service_princ,
+ const char *username,
+ const char *password,
+ struct rpc_pipe_client **presult)
{
#ifdef HAVE_KRB5
struct rpc_pipe_client *result;
struct cli_pipe_auth_data *auth;
+ NTSTATUS status;
- *perr = cli_rpc_pipe_open(cli, pipe_names[pipe_idx].abstr_syntax,
- &result);
- if (!NT_STATUS_IS_OK(*perr)) {
- return NULL;
+ status = cli_rpc_pipe_open(cli, interface, &result);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
}
- *perr = rpccli_kerberos_bind_data(result, auth_level, service_princ,
- username, password, &auth);
- if (!NT_STATUS_IS_OK(*perr)) {
+ status = rpccli_kerberos_bind_data(result, auth_level, service_princ,
+ username, password, &auth);
+ if (!NT_STATUS_IS_OK(status)) {
DEBUG(0, ("rpccli_kerberos_bind_data returned %s\n",
- nt_errstr(*perr)));
+ nt_errstr(status)));
TALLOC_FREE(result);
- return NULL;
+ return status;
}
- *perr = rpc_pipe_bind(result, auth);
- if (!NT_STATUS_IS_OK(*perr)) {
- DEBUG(0, ("cli_rpc_pipe_open_krb5: cli_rpc_pipe_bind failed with error %s\n",
- nt_errstr(*perr) ));
+ status = rpc_pipe_bind(result, auth);
+ if (!NT_STATUS_IS_OK(status)) {
+ DEBUG(0, ("cli_rpc_pipe_open_krb5: cli_rpc_pipe_bind failed "
+ "with error %s\n", nt_errstr(status)));
TALLOC_FREE(result);
- return NULL;
+ return status;
}
- return result;
+ *presult = result;
+ return NT_STATUS_OK;
#else
DEBUG(0,("cli_rpc_pipe_open_krb5: kerberos not found at compile time.\n"));
- return NULL;
+ return NT_STATUS_NOT_IMPLEMENTED;
#endif
}