From: Volker Lendecke Date: Thu, 22 Aug 2013 15:04:03 +0000 (+0000) Subject: libsmb2: Fix opening the rootdirectory, part 2 X-Git-Tag: talloc-2.1.0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ad8a1e2a6ee126596abe992bc39da3b8ea1b4f9b;p=thirdparty%2Fsamba.git libsmb2: Fix opening the rootdirectory, part 2 smb2_push_o16s16_blob is wrong for the blob.data==NULL case. It does not do the same magic that the rest of the routine does with regards to padding_fix. padding_fix is wrong in its own respect, with a 0-length blob we end up with a negative padding fix. It's wrong, but it seems to work. Why am I doing this? I want to make smb2.getinfo work against w2k12. smb2_util_roothandle() always gives NT_STATUS_INVALID_PARAMETER without this and the preceding fix. Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source4/torture/smb2/util.c b/source4/torture/smb2/util.c index cb9a5277372..4ffcfea1d18 100644 --- a/source4/torture/smb2/util.c +++ b/source4/torture/smb2/util.c @@ -485,7 +485,7 @@ NTSTATUS smb2_util_roothandle(struct smb2_tree *tree, struct smb2_handle *handle io.in.create_disposition = NTCREATEX_DISP_OPEN; io.in.share_access = NTCREATEX_SHARE_ACCESS_READ|NTCREATEX_SHARE_ACCESS_DELETE; io.in.create_options = NTCREATEX_OPTIONS_ASYNC_ALERT; - io.in.fname = NULL; + io.in.fname = ""; status = smb2_create(tree, tree, &io); NT_STATUS_NOT_OK_RETURN(status);