The test code should initialize impersonation level in a NT CreateAndX request. A SMB server may return BAD_IMPERSONATION_LEVEL (specified in SMB doc) if a random value is used. The following code is taken from torture_samba3_checkfsp() in source4/torture/raw/samba3misc.c /* Open the directory */ { union smb_open io; io.generic.level = RAW_OPEN_NTCREATEX; io.ntcreatex.in.flags = NTCREATEX_FLAGS_EXTENDED; io.ntcreatex.in.root_fid = 0; io.ntcreatex.in.security_flags = 0; io.ntcreatex.in.open_disposition = NTCREATEX_DISP_CREATE; io.ntcreatex.in.access_mask = SEC_RIGHTS_FILE_ALL; io.ntcreatex.in.alloc_size = 0; io.ntcreatex.in.file_attr = FILE_ATTRIBUTE_DIRECTORY; io.ntcreatex.in.share_access = NTCREATEX_SHARE_ACCESS_NONE; io.ntcreatex.in.open_disposition = NTCREATEX_DISP_OPEN; io.ntcreatex.in.create_options = 0; io.ntcreatex.in.impersonation = 0; io.ntcreatex.in.fname = dirname; status = smb_raw_open(cli->tree, mem_ctx, &io); if (!NT_STATUS_IS_OK(status)) { d_printf("smb_open on the directory failed: %s\n", nt_errstr(status)); ret = false; goto done; } fnum = io.ntcreatex.out.file.fnum; } the code should set io.ntcreatex.in.impersonation to a value before calling smb_raw_open.
Is it possible for you to write a patch? So our work would be quicker to handle this.
Created attachment 4332 [details] Patch to add the "impersonation level" option in the test Specify the impersonation level option according to the reporter comment.
Patch applied, should therefore be fixed.