Move setting of psd->dacl->revision and protect against null SD's. (cherry picked...
authorJeremy Allison <jra@samba.org>
Tue, 9 Oct 2012 19:45:30 +0000 (12:45 -0700)
committerKarolin Seeger <kseeger@samba.org>
Mon, 3 Dec 2012 11:47:01 +0000 (12:47 +0100)
source3/rpc_server/srvsvc/srv_srvsvc_nt.c

index 107e459a0091896b1d1e085a7d8c309c796962b9..2b03f092e51438b8eb4339a3c5cef91911b91d77 100644 (file)
@@ -2100,6 +2100,10 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
                goto error_exit;
        }
 
+       if (psd && psd->dacl) {
+               psd->dacl->revision = NT4_ACL_REVISION;
+       }
+
        sd_size = ndr_size_security_descriptor(psd, 0);
 
        sd_buf = talloc_zero(p->mem_ctx, struct sec_desc_buf);
@@ -2113,8 +2117,6 @@ WERROR _srvsvc_NetGetFileSecurity(struct pipes_struct *p,
 
        *r->out.sd_buf = sd_buf;
 
-       psd->dacl->revision = NT4_ACL_REVISION;
-
        close_file(NULL, fsp, NORMAL_CLOSE);
        vfs_ChDir(conn, oldcwd);
        SMB_VFS_DISCONNECT(conn);