s4: check the sacl and dacl pointers on the old sd
authorAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Tue, 1 Jun 2010 12:05:02 +0000 (15:05 +0300)
committerAnatoliy Atanasov <anatoliy.atanasov@postpath.com>
Tue, 1 Jun 2010 13:52:46 +0000 (16:52 +0300)
source4/dsdb/samdb/ldb_modules/descriptor.c

index 6c9baaa13a1d0a7c2cea9deb213e3a17bb4a7504..cfab5a0f9a4272b5cf6b7e18dbd7da05dc42019f 100644 (file)
@@ -176,7 +176,7 @@ static struct security_descriptor *descr_handle_sd_flags(TALLOC_CTX *mem_ctx,
                        SEC_DESC_SACL_AUTO_INHERITED|SEC_DESC_SACL_PROTECTED |
                        SEC_DESC_SERVER_SECURITY);
        } 
-       else if (old_sd) {
+       else if (old_sd && old_sd->sacl) {
                final_sd->sacl = security_acl_dup(mem_ctx,old_sd->sacl);
                final_sd->type |= old_sd->type & (SEC_DESC_SACL_PRESENT |
                        SEC_DESC_SACL_DEFAULTED|SEC_DESC_SACL_AUTO_INHERIT_REQ |
@@ -191,7 +191,7 @@ static struct security_descriptor *descr_handle_sd_flags(TALLOC_CTX *mem_ctx,
                        SEC_DESC_DACL_AUTO_INHERITED|SEC_DESC_DACL_PROTECTED |
                        SEC_DESC_DACL_TRUSTED);
        } 
-       else if (old_sd) {
+       else if (old_sd && old_sd->dacl) {
                final_sd->dacl = security_acl_dup(mem_ctx,old_sd->dacl);
                final_sd->type |= old_sd->type & (SEC_DESC_DACL_PRESENT |
                        SEC_DESC_DACL_DEFAULTED|SEC_DESC_DACL_AUTO_INHERIT_REQ |