From: Volker Lendecke Date: Tue, 26 Nov 2024 13:42:39 +0000 (+0100) Subject: lib: Simplify security_descriptor_initialise() with a struct init X-Git-Tag: tdb-1.4.13~422 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e4f57feed07a82276363bd7a77682887b542545d;p=thirdparty%2Fsamba.git lib: Simplify security_descriptor_initialise() with a struct init Rely no the default NULL init. Signed-off-by: Volker Lendecke Reviewed-by: Douglas Bagnall --- diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c index c550d6ed751..a7159e7da7e 100644 --- a/libcli/security/security_descriptor.c +++ b/libcli/security/security_descriptor.c @@ -34,18 +34,17 @@ struct security_descriptor *security_descriptor_initialise(TALLOC_CTX *mem_ctx) if (!sd) { return NULL; } + *sd = (struct security_descriptor){ + .revision = SD_REVISION, - sd->revision = SD_REVISION; - /* we mark as self relative, even though it isn't while it remains - a pointer in memory because this simplifies the ndr code later. - All SDs that we store/emit are in fact SELF_RELATIVE - */ - sd->type = SEC_DESC_SELF_RELATIVE; - - sd->owner_sid = NULL; - sd->group_sid = NULL; - sd->sacl = NULL; - sd->dacl = NULL; + /* + * we mark as self relative, even though it isn't + * while it remains a pointer in memory because this + * simplifies the ndr code later. All SDs that we + * store/emit are in fact SELF_RELATIVE + */ + .type = SEC_DESC_SELF_RELATIVE, + }; return sd; }