dsdb: Handle the case when extended rights string is NULL
authorAmitay Isaacs <amitay@gmail.com>
Wed, 2 Nov 2011 03:34:41 +0000 (14:34 +1100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 2 Nov 2011 06:03:40 +0000 (07:03 +0100)
Pair-Programmed-With: Andrew Tridgell <tridge@samba.org>

Signed-off-by: Andrew Tridgell <tridge@samba.org>
Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Nov  2 07:03:40 CET 2011 on sn-devel-104

source4/dsdb/common/dsdb_access.c

index b8784fc62f7bafef83c6ec24254ee3eff54788d1..fd75e77541e4644c6586ffefaefc0849ccfd0739 100644 (file)
@@ -152,9 +152,12 @@ int dsdb_check_access_on_dn(struct ldb_context *ldb,
                "objectSid",
                NULL
        };
-       NTSTATUS status = GUID_from_string(ext_right, &guid);
-       if (!NT_STATUS_IS_OK(status)) {
-               return LDB_ERR_OPERATIONS_ERROR;
+
+       if (ext_right != NULL) {
+               NTSTATUS status = GUID_from_string(ext_right, &guid);
+               if (!NT_STATUS_IS_OK(status)) {
+                       return LDB_ERR_OPERATIONS_ERROR;
+               }
        }
 
        ret = dsdb_search_dn(ldb, mem_ctx, &acl_res, dn, acl_attrs, DSDB_SEARCH_SHOW_DELETED);
@@ -168,6 +171,6 @@ int dsdb_check_access_on_dn(struct ldb_context *ldb,
                                                token,
                                                dn,
                                                access_mask,
-                                               &guid);
+                                               ext_right ? &guid : NULL);
 }