summaryrefslogtreecommitdiff
path: root/libcli/security
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2012-12-11 02:00:38 +0100
committerMichael Adam <obnox@samba.org>2012-12-11 04:45:54 +0100
commit75729e6703c5b5dff7feefed590086898fc03c74 (patch)
tree81215dbc40775773ca90870ae7d976fe8b9b1014 /libcli/security
parent1d949cb0e51a086006612271d6f08305b68aa09c (diff)
downloadsamba-75729e6703c5b5dff7feefed590086898fc03c74.tar.gz
samba-75729e6703c5b5dff7feefed590086898fc03c74.tar.bz2
samba-75729e6703c5b5dff7feefed590086898fc03c74.zip
libcli/security: implement object_in_list()
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'libcli/security')
-rw-r--r--libcli/security/create_descriptor.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/libcli/security/create_descriptor.c b/libcli/security/create_descriptor.c
index 0cac2e4a5f..1456d84e57 100644
--- a/libcli/security/create_descriptor.c
+++ b/libcli/security/create_descriptor.c
@@ -80,9 +80,30 @@ uint32_t map_generic_rights_ds(uint32_t access_mask)
* and it does not seem to have any influence */
static bool object_in_list(struct GUID *object_list, struct GUID *object)
{
- return true;
+ size_t i;
+
+ if (object_list == NULL) {
+ return true;
+ }
+
+ if (GUID_all_zero(object)) {
+ return true;
+ }
+
+ for (i=0; ; i++) {
+ if (GUID_all_zero(&object_list[i])) {
+ return false;
+ }
+ if (!GUID_equal(&object_list[i], object)) {
+ continue;
+ }
+
+ return true;
+ }
+
+ return false;
}
-
+
/* returns true if the ACE gontains generic information
* that needs to be processed additionally */