From 8ecd5dd52a6bd867f5d117352048ee43ce7254d9 Mon Sep 17 00:00:00 2001 From: Gerald Carter Date: Wed, 9 Aug 2000 20:14:29 +0000 Subject: More work on AddPrinterDriver() and AddPrinterEx() client RPC's Also fixed init_unistr() to deal with a NULL source character string. -jerry --- source/rpc_client/cli_connect.c | 4 ++-- source/rpc_client/cli_spoolss.c | 18 ++++++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'source/rpc_client') diff --git a/source/rpc_client/cli_connect.c b/source/rpc_client/cli_connect.c index 6dcf92c57d5..0eceda4c4cf 100644 --- a/source/rpc_client/cli_connect.c +++ b/source/rpc_client/cli_connect.c @@ -295,7 +295,7 @@ void cli_connection_unlink(struct cli_connection *con) /**************************************************************************** init client state ****************************************************************************/ -BOOL cli_connection_init(const char *srv_name, const char *pipe_name, +BOOL cli_connection_init(const char *srv_name, char *pipe_name, struct cli_connection **con) { return cli_connection_init_auth(srv_name, pipe_name, con, NULL, NULL); @@ -304,7 +304,7 @@ BOOL cli_connection_init(const char *srv_name, const char *pipe_name, /**************************************************************************** init client state ****************************************************************************/ -BOOL cli_connection_init_auth(const char *srv_name, const char *pipe_name, +BOOL cli_connection_init_auth(const char *srv_name, char *pipe_name, struct cli_connection **con, cli_auth_fns * auth, void *auth_creds) { diff --git a/source/rpc_client/cli_spoolss.c b/source/rpc_client/cli_spoolss.c index 1bfdf6a4685..7417e0c0fc6 100644 --- a/source/rpc_client/cli_spoolss.c +++ b/source/rpc_client/cli_spoolss.c @@ -558,9 +558,6 @@ BOOL spoolss_addprinterex(POLICY_HND *hnd, const char* srv_name, PRINTER_INFO_2 - /* memset(srv_name, 0, sizeof(srv_name)); - unistr_to_ascii(srv_name, info2->servername.buffer, sizeof(srv_name)); */ - if (!cli_connection_init(srv_name, PIPE_SPOOLSS, &con)) return NT_STATUS_ACCESS_DENIED; @@ -584,7 +581,9 @@ BOOL spoolss_addprinterex(POLICY_HND *hnd, const char* srv_name, PRINTER_INFO_2 make_spoolss_q_addprinterex(&q_o, srv_name, client_name, - "Administrator", 2, info2); + /* "Administrator", */ + con->pCli_state->user_name, + 2, info2); /* turn parameters into data stream and send the request */ if (spoolss_io_q_addprinterex("", &q_o, &buf, 0) && @@ -592,11 +591,14 @@ BOOL spoolss_addprinterex(POLICY_HND *hnd, const char* srv_name, PRINTER_INFO_2 { ZERO_STRUCT(r_o); - if(!spoolss_io_r_addprinterex("", &r_o, &rbuf, 0)) + if(spoolss_io_r_addprinterex("", &r_o, &rbuf, 0)) { - /* report error code */ - DEBUG(5,("SPOOLSS_ADDPRINTEREX: %s\n", get_nt_error_msg(r_o.status))); - valid_pol = False; + if (r_o.status != NT_STATUS_NO_PROBLEMO) + { + /* report error code */ + DEBUG(0,("SPOOLSS_ADDPRINTEREX: %s\n", get_nt_error_msg(r_o.status))); + valid_pol = False; + } } if (valid_pol) -- cgit