Bug 6283 - (smbtorture test) torture_samba3_checkfsp() should initialize impersonation level in a NT CreateAndX request
Summary: (smbtorture test) torture_samba3_checkfsp() should initialize impersonation l...
Status: RESOLVED FIXED
Alias: None
Product: Samba 4.0
Classification: Unclassified
Component: Other (show other bugs)
Version: unspecified
Hardware: x64 Linux
: P3 minor (vote)
Target Milestone: ---
Assignee: Andrew Bartlett
QA Contact: Andrew Bartlett
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-04-21 20:00 UTC by Long Li
Modified: 2009-06-29 08:13 UTC (History)
1 user (show)

See Also:


Attachments
Patch to add the "impersonation level" option in the test (1.79 KB, patch)
2009-06-19 15:45 UTC, Matthias Dieter Wallnöfer
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Long Li 2009-04-21 20:00:03 UTC
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.
Comment 1 Matthias Dieter Wallnöfer 2009-06-12 14:55:52 UTC
Is it possible for you to write a patch? So our work would be quicker to handle this.
Comment 2 Matthias Dieter Wallnöfer 2009-06-19 15:45:29 UTC
Created attachment 4332 [details]
Patch to add the "impersonation level" option in the test

Specify the impersonation level option according to the reporter comment.
Comment 3 Matthias Dieter Wallnöfer 2009-06-29 08:13:51 UTC
Patch applied, should therefore be fixed.