libgpo: make use of cli_full_connection_creds()
authorStefan Metzmacher <metze@samba.org>
Wed, 7 Dec 2016 06:30:39 +0000 (07:30 +0100)
committerStefan Metzmacher <metze@samba.org>
Mon, 18 Feb 2019 12:47:21 +0000 (13:47 +0100)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
libgpo/gpo_fetch.c

index 08a7b2ac7d7608beac693da366ace7580fbb8739..7ea78830cdcebcf7c6432ae8dbac31b05c179b6b 100644 (file)
@@ -122,18 +122,30 @@ static NTSTATUS gpo_connect_server(ADS_STRUCT *ads,
                                    const char *server, const char *service, void *ret_cli)
 {
        NTSTATUS result;
-       struct cli_state *cli;
+       struct cli_credentials *creds = NULL;
+       struct cli_state *cli = NULL;
+
+       creds = cli_session_creds_init(NULL,
+                                      ads->auth._user_name,
+                                      NULL, /* domain (use default) */
+                                      NULL, /* realm (use default) */
+                                      ads->auth._password,
+                                      true, /* use_kerberos */
+                                      true, /* fallback_after_kerberos */
+                                      false, /* use_ccache */
+                                      false); /* pw_nt_hash */
+       if (creds == NULL) {
+               return NT_STATUS_NO_MEMORY;
+       }
 
-       result = cli_full_connection(&cli,
+       result = cli_full_connection_creds(&cli,
                        lp_netbios_name(),
                        server,
                        NULL, 0,
                        service, "A:",
-                       ads->auth._user_name, NULL,
-                       ads->auth._password,
-                       CLI_FULL_CONNECTION_USE_KERBEROS |
-                       CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS,
+                       creds, 0,
                        SMB_SIGNING_REQUIRED);
+       TALLOC_FREE(creds);
        if (!NT_STATUS_IS_OK(result)) {
                DEBUG(10,("check_refresh_gpo: "
                                "failed to connect: %s\n",