summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2022-11-29 10:48:25 +0100
committerJeremy Allison <jra@samba.org>2022-12-14 04:32:34 +0000
commitfa8a657b91c123849eb40f74dbce6974ec04338b (patch)
tree8d817232694132e43a3949157e2fb54bd0171175 /source4/auth
parent6b6f8debb5dedf1520a7bedfa0277849f70683dd (diff)
downloadsamba-fa8a657b91c123849eb40f74dbce6974ec04338b.tar.gz
auth4: Save lines with talloc_asprintf_addbuf() in authsam_domain_group_filter()
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/sam.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/source4/auth/sam.c b/source4/auth/sam.c
index f2e5ced6caf..2b18d4dc3c0 100644
--- a/source4/auth/sam.c
+++ b/source4/auth/sam.c
@@ -310,25 +310,19 @@ static NTSTATUS authsam_domain_group_filter(TALLOC_CTX *mem_ctx,
*_filter = NULL;
filter = talloc_strdup(mem_ctx, "(&(objectClass=group)");
- if (filter == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
/*
* Skip all builtin groups, they're added later.
*/
- filter = talloc_asprintf_append_buffer(filter,
- "(!(groupType:1.2.840.113556.1.4.803:=%u))",
- GROUP_TYPE_BUILTIN_LOCAL_GROUP);
- if (filter == NULL) {
- return NT_STATUS_NO_MEMORY;
- }
+ talloc_asprintf_addbuf(&filter,
+ "(!(groupType:1.2.840.113556.1.4.803:=%u))",
+ GROUP_TYPE_BUILTIN_LOCAL_GROUP);
/*
* Only include security groups.
*/
- filter = talloc_asprintf_append_buffer(filter,
- "(groupType:1.2.840.113556.1.4.803:=%u))",
- GROUP_TYPE_SECURITY_ENABLED);
+ talloc_asprintf_addbuf(&filter,
+ "(groupType:1.2.840.113556.1.4.803:=%u))",
+ GROUP_TYPE_SECURITY_ENABLED);
if (filter == NULL) {
return NT_STATUS_NO_MEMORY;
}