]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libsmb: Slightly clarify format in set/get_secdesc
authorVolker Lendecke <vl@samba.org>
Tue, 13 May 2025 09:31:12 +0000 (11:31 +0200)
committerVolker Lendecke <vl@samba.org>
Tue, 2 Sep 2025 08:08:29 +0000 (08:08 +0000)
We have reserved fields after those 16-bit ones. With little endian
those are set to 0 with PUSH_LE32. That is unnecessary here, the
fields are already set to 0. This patch is not for efficiency, I just
got a bit confused by the subtlety.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
source3/libsmb/clisecdesc.c

index 32558c148c9b111e9d8b50f3c50878e68729fc42..e6c31cfb49fbea8eda88e05d5dc0fabe272b00a1 100644 (file)
@@ -69,7 +69,8 @@ struct tevent_req *cli_query_security_descriptor_send(
                return req;
        }
 
-       PUSH_LE_U32(state->param, 0, fnum);
+       PUSH_LE_U16(state->param, 0, fnum);
+       /* 2 bytes reserved, set to 0 by tevent_req_create */
        PUSH_LE_U32(state->param, 4, sec_info);
 
        subreq = cli_trans_send(
@@ -268,8 +269,9 @@ struct tevent_req *cli_set_security_descriptor_send(
                return req;
        }
 
-       SIVAL(state->param, 0, fnum);
-       SIVAL(state->param, 4, sec_info);
+       PUSH_LE_U16(state->param, 0, fnum);
+       /* 2 bytes reserved, set to 0 by tevent_req_create */
+       PUSH_LE_U32(state->param, 4, sec_info);
 
        subreq = cli_trans_send(
                state,          /* mem_ctx */