]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
examples:winexe: Initialize Trustee.ptstrName at the right time
authorPavel Filipenský <pfilipensky@samba.org>
Wed, 13 Nov 2024 08:49:47 +0000 (09:49 +0100)
committerJule Anger <janger@samba.org>
Thu, 14 Nov 2024 14:06:52 +0000 (14:06 +0000)
This is a regression of a39cb60 examples:winexe: Fully initialize EXPLICIT_ACCESS

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15752

Signed-off-by: Pavel Filipenský <pfilipensky@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Pavel Filipensky <pfilipensky@samba.org>
Autobuild-Date(master): Wed Nov 13 15:47:40 UTC 2024 on atb-devel-224

(cherry picked from commit 50f3273e8283c9dabeca3c899b90ad831657b12a)

Autobuild-User(v4-21-test): Jule Anger <janger@samba.org>
Autobuild-Date(v4-21-test): Thu Nov 14 14:06:52 UTC 2024 on atb-devel-224

examples/winexe/winexesvc.c

index f993c9a9c69a22f04cdbca9ec8c359c1a76c25d0..ca270a804445ef0faf3ad1fdd14ffdfb69eb5e18 100644 (file)
@@ -68,7 +68,6 @@ static int CreatePipesSA()
                .Trustee = {
                        .TrusteeForm = TRUSTEE_IS_SID,
                        .TrusteeType = TRUSTEE_IS_GROUP,
-                       .ptstrName = (LPTSTR)pAdminSID,
                },
        };
        SID_IDENTIFIER_AUTHORITY SIDAuthNT = {SECURITY_NT_AUTHORITY};
@@ -86,6 +85,8 @@ static int CreatePipesSA()
                return 0;
        }
 
+       ea.Trustee.ptstrName = (LPTSTR)pAdminSID;
+
        /* Create a new ACL that contains the new ACEs */
        dwRes = SetEntriesInAcl(1, &ea, NULL, &pACL);
        if (ERROR_SUCCESS != dwRes) {