summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/torture/raw/acls.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/source4/torture/raw/acls.c b/source4/torture/raw/acls.c
index 53de4e31f4..01ee8be6a9 100644
--- a/source4/torture/raw/acls.c
+++ b/source4/torture/raw/acls.c
@@ -2203,13 +2203,14 @@ static bool test_inheritance_dynamic(struct torture_context *tctx,
smbcli_unlink(cli->tree, fname1);
done:
- torture_comment(tctx, "put back original sd\n");
- set.set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
- set.set_secdesc.in.file.fnum = fnum;
- set.set_secdesc.in.secinfo_flags = SECINFO_DACL;
- set.set_secdesc.in.sd = sd_orig;
- status = smb_raw_setfileinfo(cli->tree, &set);
-
+ if (sd_orig != NULL) {
+ torture_comment(tctx, "put back original sd\n");
+ set.set_secdesc.level = RAW_SFILEINFO_SEC_DESC;
+ set.set_secdesc.in.file.fnum = fnum;
+ set.set_secdesc.in.secinfo_flags = SECINFO_DACL;
+ set.set_secdesc.in.sd = sd_orig;
+ status = smb_raw_setfileinfo(cli->tree, &set);
+ }
smbcli_close(cli->tree, fnum);
smbcli_rmdir(cli->tree, dname);
smb_raw_exit(cli->session);