From 2a2188591b5ed922d09dc723adcf10f8b8f5e5a0 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 21:56:43 +0200 Subject: Add "desthost" to rpc_pipe_client This reduces the dependency on cli_state (This used to be commit 783afab9c891dd7bcb78895b2a639b6f3a0edf5b) --- source3/libads/ldap_printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c index 05fbc071d8..e2396ce4cf 100644 --- a/source3/libads/ldap_printer.c +++ b/source3/libads/ldap_printer.c @@ -288,7 +288,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli, uint32 i; POLICY_HND pol; - asprintf(&servername, "\\\\%s", cli->cli->desthost); + asprintf(&servername, "\\\\%s", cli->desthost); asprintf(&printername, "%s\\%s", servername, printer); if (!servername || !printername) { DEBUG(3, ("Insufficient memory\n")); -- cgit From 4c857010e7113d99028cf8d7fac5e5b95c400fb3 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 19 Apr 2008 22:05:13 +0200 Subject: Fix two "ignoring asprintf result" warnings (This used to be commit 1d261e78b38e8080ca7122037d33c8ef913a4558) --- source3/libads/ldap_printer.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c index e2396ce4cf..440f979781 100644 --- a/source3/libads/ldap_printer.c +++ b/source3/libads/ldap_printer.c @@ -288,9 +288,8 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli, uint32 i; POLICY_HND pol; - asprintf(&servername, "\\\\%s", cli->desthost); - asprintf(&printername, "%s\\%s", servername, printer); - if (!servername || !printername) { + if ((asprintf(&servername, "\\\\%s", cli->desthost) == -1) + || (asprintf(&printername, "%s\\%s", servername, printer) == -1)) { DEBUG(3, ("Insufficient memory\n")); return WERR_NOMEM; } -- cgit From cf2442bdcb68d75582da98ba15da8928c37fb058 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 20 Apr 2008 00:01:52 +0200 Subject: Use rpc_pipe_client->user_name instead of rpc_pipe_client->cli->user_name Also make sure that rpc_pipe_client->user_name is always talloced. (This used to be commit 3f6c5b99664a75a6f490ee3b6980b89cacf7f579) --- source3/libads/ldap_printer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/libads') diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c index 440f979781..6682ec24d0 100644 --- a/source3/libads/ldap_printer.c +++ b/source3/libads/ldap_printer.c @@ -296,7 +296,7 @@ WERROR get_remote_printer_publishing_data(struct rpc_pipe_client *cli, result = rpccli_spoolss_open_printer_ex(cli, mem_ctx, printername, "", MAXIMUM_ALLOWED_ACCESS, - servername, cli->cli->user_name, &pol); + servername, cli->user_name, &pol); if (!W_ERROR_IS_OK(result)) { DEBUG(3, ("Unable to open printer %s, error is %s.\n", printername, dos_errstr(result))); -- cgit