summaryrefslogtreecommitdiff
path: root/source3/rpc_client
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2000-08-09 20:14:29 +0000
committerGerald Carter <jerry@samba.org>2000-08-09 20:14:29 +0000
commita08d4448964641150cad0e6b3fb0055602ef79be (patch)
tree42eccb835f29754e1f9eafff5d0718e60994cd46 /source3/rpc_client
parente3048cfc0b324ec5ab825efe87eaa97cc9504c09 (diff)
downloadsamba-a08d4448964641150cad0e6b3fb0055602ef79be.tar.gz
samba-a08d4448964641150cad0e6b3fb0055602ef79be.tar.bz2
samba-a08d4448964641150cad0e6b3fb0055602ef79be.zip
More work on AddPrinterDriver() and AddPrinterEx() client RPC's
Also fixed init_unistr() to deal with a NULL source character string. -jerry (This used to be commit 8ecd5dd52a6bd867f5d117352048ee43ce7254d9)
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)