From de10847973faed53ac078edb55ded0fb99329487 Mon Sep 17 00:00:00 2001 From: Gregor Beck Date: Thu, 26 May 2011 10:23:41 +0200 Subject: s4:torture: fix SEGFAULT in raw.acl.dynamic Signed-off-by: Michael Adam --- source4/torture/raw/acls.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'source4') 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); -- cgit