s3:rpc_server/spoolss: make use of cli_credentials_init_anon()
authorStefan Metzmacher <metze@samba.org>
Mon, 11 Nov 2019 14:02:11 +0000 (15:02 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 28 May 2020 06:43:38 +0000 (06:43 +0000)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/rpc_server/spoolss/srv_spoolss_nt.c

index c4583fb4c324c7487e6b8926e93d465f6da71cb6..8b6a803a910b0bb1284493cbaece75ede6fe1d48 100644 (file)
@@ -2449,6 +2449,7 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe, struct c
        NTSTATUS ret;
        struct sockaddr_storage rm_addr;
        char addr[INET6_ADDRSTRLEN];
+       struct cli_credentials *anon_creds = NULL;
 
        if ( is_zero_addr(client_ss) ) {
                DEBUG(2,("spoolss_connect_to_client: resolving %s\n",
@@ -2471,14 +2472,17 @@ static bool spoolss_connect_to_client(struct rpc_pipe_client **pp_pipe, struct c
                return false;
        }
 
+       anon_creds = cli_credentials_init_anon(NULL);
+       if (anon_creds == NULL) {
+               DBG_ERR("cli_credentials_init_anon() failed\n");
+               return false;
+       }
+
        /* setup the connection */
-       ret = cli_full_connection( pp_cli, lp_netbios_name(), remote_machine,
+       ret = cli_full_connection_creds( pp_cli, lp_netbios_name(), remote_machine,
                &rm_addr, 0, "IPC$", "IPC",
-               "", /* username */
-               "", /* domain */
-               "", /* password */
-               0, lp_client_signing());
-
+               anon_creds, 0, SMB_SIGNING_OFF);
+       TALLOC_FREE(anon_creds);
        if ( !NT_STATUS_IS_OK( ret ) ) {
                DEBUG(2,("spoolss_connect_to_client: connection to [%s] failed!\n",
                        remote_machine ));