summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
Diffstat (limited to 'source3/rpc_client')
-rw-r--r--source3/rpc_client/cli_connect.c4
-rw-r--r--source3/rpc_client/cli_spoolss.c18
2 files changed, 12 insertions, 10 deletions
diff --git a/source3/rpc_client/cli_connect.c b/source3/rpc_client/cli_connect.c
index 6dcf92c57d..0eceda4c4c 100644
--- a/source3/rpc_client/cli_connect.c
+++ b/source3/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/source3/rpc_client/cli_spoolss.c b/source3/rpc_client/cli_spoolss.c
index 1bfdf6a468..7417e0c0fc 100644
--- a/source3/rpc_client/cli_spoolss.c
+++ b/source3/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)