summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2011-05-26 10:23:41 +0200
committerMichael Adam <obnox@samba.org>2011-05-30 17:42:27 +0200
commitde10847973faed53ac078edb55ded0fb99329487 (patch)
treec909b39267d855dbbd1c0a474f33d00fba5f5177
parent817c64f5de65c6ba7cc535446279f769d6552618 (diff)
downloadsamba-de10847973faed53ac078edb55ded0fb99329487.tar.gz
samba-de10847973faed53ac078edb55ded0fb99329487.tar.bz2
samba-de10847973faed53ac078edb55ded0fb99329487.zip
s4:torture: fix SEGFAULT in raw.acl.dynamic
Signed-off-by: Michael Adam <obnox@samba.org>
-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);