summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorDavid Disseldorp <ddiss@samba.org>2014-05-28 17:13:32 +0200
committerAndrew Bartlett <abartlet@samba.org>2014-05-29 01:08:25 +0200
commit4de94ad8fd601c6871fa0dd2d51864f77c80b26e (patch)
tree41c49897dc25998d3f17e42279a47eb1e13ba8c4 /libcli/security
parentf1a96f8582d90025f65ddeeb24f1095e1781454d (diff)
downloadsamba-4de94ad8fd601c6871fa0dd2d51864f77c80b26e.tar.gz
libcli/security: cleanup security_ace_equal()
This change cleans up the white-space damage, and converts the single line if-then statements to match Samba's coding conventions. Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/security_descriptor.c28
1 files changed, 20 insertions, 8 deletions
diff --git a/libcli/security/security_descriptor.c b/libcli/security/security_descriptor.c
index 25b316cdd2a..8304b208528 100644
--- a/libcli/security/security_descriptor.c
+++ b/libcli/security/security_descriptor.c
@@ -344,17 +344,29 @@ NTSTATUS security_descriptor_sacl_del(struct security_descriptor *sd,
/*
compare two security ace structures
*/
-bool security_ace_equal(const struct security_ace *ace1,
+bool security_ace_equal(const struct security_ace *ace1,
const struct security_ace *ace2)
{
- if (ace1 == ace2) return true;
- if (!ace1 || !ace2) return false;
- if (ace1->type != ace2->type) return false;
- if (ace1->flags != ace2->flags) return false;
- if (ace1->access_mask != ace2->access_mask) return false;
- if (!dom_sid_equal(&ace1->trustee, &ace2->trustee)) return false;
+ if (ace1 == ace2) {
+ return true;
+ }
+ if ((ace1 == NULL) || (ace2 == NULL)) {
+ return false;
+ }
+ if (ace1->type != ace2->type) {
+ return false;
+ }
+ if (ace1->flags != ace2->flags) {
+ return false;
+ }
+ if (ace1->access_mask != ace2->access_mask) {
+ return false;
+ }
+ if (!dom_sid_equal(&ace1->trustee, &ace2->trustee)) {
+ return false;
+ }
- return true;
+ return true;
}