summaryrefslogtreecommitdiff
path: root/libcli
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-04-14 17:44:54 +0200
committerJeremy Allison <jra@samba.org>2021-04-19 18:18:32 +0000
commitdab8e9eb4a704b141ff4355560cf94db45093793 (patch)
treee4d8144d6d3a68d238c266d7d7f3210ee5343d9f /libcli
parent015cfe2ecdfa18835cacbaeab3bc04eb08dd54b8 (diff)
downloadsamba-dab8e9eb4a704b141ff4355560cf94db45093793.tar.gz
libcli: Simplify sddl_encode_ace()
Use GUID_buf_string() instead of GUID_string() for encoding objects, no need to check for NULL anymore. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
Diffstat (limited to 'libcli')
-rw-r--r--libcli/security/sddl.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/libcli/security/sddl.c b/libcli/security/sddl.c
index 47223515a62..618b2a91be5 100644
--- a/libcli/security/sddl.c
+++ b/libcli/security/sddl.c
@@ -506,6 +506,7 @@ static char *sddl_encode_ace(TALLOC_CTX *mem_ctx, const struct security_ace *ace
{
char *sddl = NULL;
TALLOC_CTX *tmp_ctx;
+ struct GUID_txt_buf object_buf, iobject_buf;
const char *sddl_type="", *sddl_flags="", *sddl_mask="",
*sddl_object="", *sddl_iobject="", *sddl_trustee="";
@@ -540,19 +541,18 @@ static char *sddl_encode_ace(TALLOC_CTX *mem_ctx, const struct security_ace *ace
ace->type == SEC_ACE_TYPE_ACCESS_DENIED_OBJECT ||
ace->type == SEC_ACE_TYPE_SYSTEM_AUDIT_OBJECT ||
ace->type == SEC_ACE_TYPE_SYSTEM_ALARM_OBJECT) {
+ const struct security_ace_object *object = &ace->object.object;
+
if (ace->object.object.flags & SEC_ACE_OBJECT_TYPE_PRESENT) {
- sddl_object = GUID_string(
- tmp_ctx, &ace->object.object.type.type);
- if (sddl_object == NULL) {
- goto failed;
- }
+ sddl_object = GUID_buf_string(
+ &object->type.type, &object_buf);
}
- if (ace->object.object.flags & SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
- sddl_iobject = GUID_string(tmp_ctx, &ace->object.object.inherited_type.inherited_type);
- if (sddl_iobject == NULL) {
- goto failed;
- }
+ if (ace->object.object.flags &
+ SEC_ACE_INHERITED_OBJECT_TYPE_PRESENT) {
+ sddl_iobject = GUID_buf_string(
+ &object->inherited_type.inherited_type,
+ &iobject_buf);
}
}