]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s3:rpcclient/cli_drsuapi: make use of dcerpc_binding_handle_auth_session_key()
authorStefan Metzmacher <metze@samba.org>
Sat, 14 Sep 2024 13:57:03 +0000 (15:57 +0200)
committerJule Anger <janger@samba.org>
Thu, 12 Jun 2025 11:27:14 +0000 (11:27 +0000)
Note we only need to call this once per connection, not after
each request...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
(cherry picked from commit f75189dee9db486d393cd17c25f5a84ce2d0b889)

source3/rpcclient/cmd_drsuapi.c

index bf87a26a8d55d6fe511d637e950d51fffe279491..3137bc656d2e93316825f0c5363bc89fdf5fe004 100644 (file)
@@ -573,6 +573,14 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
                }
        }
 
+       status = dcerpc_binding_handle_auth_session_key(
+                       b, mem_ctx, &session_key);
+       if (!NT_STATUS_IS_OK(status)) {
+               printf("Failed to get Session Key: %s",
+                       nt_errstr(status));
+               return ntstatus_to_werror(status);
+       }
+
        for (y=0; ;y++) {
 
                if (level == 8) {
@@ -609,13 +617,6 @@ static WERROR cmd_drsuapi_getncchanges(struct rpc_pipe_client *cli,
                        ctr1 = &ctr.ctr2.mszip1.ts->ctr1;
                }
 
-               status = cli_get_session_key(mem_ctx, cli, &session_key);
-               if (!NT_STATUS_IS_OK(status)) {
-                       printf("Failed to get Session Key: %s",
-                               nt_errstr(status));
-                       return ntstatus_to_werror(status);
-               }
-
                if (out_level == 1) {
                        DEBUG(1,("end[%d] tmp_highest_usn: %llu , highest_usn: %llu\n",y,
                                (long long)ctr1->new_highwatermark.tmp_highest_usn,