diff options
author | Stefan Metzmacher <metze@samba.org> | 2012-12-11 02:00:38 +0100 |
---|---|---|
committer | Karolin Seeger <kseeger@samba.org> | 2012-12-11 09:05:08 +0100 |
commit | 3cda521c0800d7ebceb4a583372b0f80f5ba11fc (patch) | |
tree | a5e6138bb7706c9b288f8207ea6c67d6413a568c /libcli | |
parent | bde0414a07f6a25562aee21253a655fc0522180c (diff) | |
download | samba-3cda521c0800d7ebceb4a583372b0f80f5ba11fc.tar.gz |
libcli/security: implement object_in_list()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 75729e6703c5b5dff7feefed590086898fc03c74)
Diffstat (limited to 'libcli')
-rw-r--r-- | libcli/security/create_descriptor.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/libcli/security/create_descriptor.c b/libcli/security/create_descriptor.c index 0cac2e4a5fc..1456d84e57d 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 */ |