libcli/security: fix handling of deny type ACEs in access_check_max_allowed()
authorRalph Boehme <slow@samba.org>
Fri, 1 Mar 2019 17:57:23 +0000 (18:57 +0100)
committerKarolin Seeger <kseeger@samba.org>
Mon, 11 Mar 2019 07:55:38 +0000 (07:55 +0000)
Deny ACEs must always be evaluated against explicitly granted rights
from previous ACEs.

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 8d355dd9769e8990ce998b4c9f28977669b43616)

libcli/security/access_check.c
selftest/knownfail.d/smb2.acls [deleted file]

index d1d57eecef2355e799bae7023691ccc7f80f0ad6..322f4fdb0c64d572d76b667c632e9421428e797b 100644 (file)
@@ -173,7 +173,7 @@ static uint32_t access_check_max_allowed(const struct security_descriptor *sd,
                        break;
                case SEC_ACE_TYPE_ACCESS_DENIED:
                case SEC_ACE_TYPE_ACCESS_DENIED_OBJECT:
-                       denied |= ace->access_mask;
+                       denied |= ~granted & ace->access_mask;
                        break;
                default:        /* Other ACE types not handled/supported */
                        break;
diff --git a/selftest/knownfail.d/smb2.acls b/selftest/knownfail.d/smb2.acls
deleted file mode 100644 (file)
index b76a3c7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-^samba3.smb2.acls.OWNER-RIGHTS-DENY1\(ad_dc\)
-^samba3.smb2.acls.OWNER-RIGHTS-DENY1\(nt4_dc\)
-^samba3.smb2.acls.DENY1\(ad_dc\)
-^samba3.smb2.acls.DENY1\(nt4_dc\)