Oplock mapping code.
***************************************************************/
-static uint8_t flags_to_smb2_oplock(uint32_t create_flags)
+static uint8_t flags_to_smb2_oplock(struct cli_smb2_create_flags create_flags)
{
- if (create_flags & REQUEST_BATCH_OPLOCK) {
+ if (create_flags.batch_oplock) {
return SMB2_OPLOCK_LEVEL_BATCH;
- } else if (create_flags & REQUEST_OPLOCK) {
+ } else if (create_flags.exclusive_oplock) {
return SMB2_OPLOCK_LEVEL_EXCLUSIVE;
}
struct tevent_context *ev,
struct cli_state *cli,
const char *fname_in,
- uint32_t create_flags,
+ struct cli_smb2_create_flags create_flags,
uint32_t impersonation_level,
uint32_t desired_access,
uint32_t file_attributes,
NTSTATUS cli_smb2_create_fnum(
struct cli_state *cli,
const char *fname,
- uint32_t create_flags,
+ struct cli_smb2_create_flags create_flags,
uint32_t impersonation_level,
uint32_t desired_access,
uint32_t file_attributes,
ev, /* ev */
cli, /* cli */
dname, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
state->ev,
state->cli,
state->dname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
state->ev,
state->cli,
state->dname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
state->ev, /* tevent_context */
state->cli, /* cli_struct */
state->fname, /* filename */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_NORMAL, /* file attributes */
state->ev, /* tevent_context */
state->cli, /* cli_struct */
state->fname, /* filename */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
DELETE_ACCESS, /* desired_access */
FILE_ATTRIBUTE_NORMAL, /* file attributes */
ev, /* ev */
cli, /* cli */
parent, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
SEC_DIR_LIST|SEC_DIR_READ_ATTRIBUTE, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file_attributes */
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
/* Maybe a file ? */
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
0, /* file attributes */
/* Maybe a reparse point ? */
status = cli_smb2_create_fnum(cli,
name,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
0, /* file attributes */
ev, /* ev */
cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation_level */
desired_access, /* desired_access */
0, /* file_attributes */
state->ev, /* ev */
state->cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation */
state->desired_access, /* desired_access */
0, /* file_attributes */
state->ev, /* ev */
state->cli, /* cli */
state->name, /* fname */
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0}, /* create_flags */
SMB2_IMPERSONATION_IMPERSONATION, /* impersonation */
state->desired_access, /* desired_access */
0, /* file_attributes */
/* First open the top level directory. */
status = cli_smb2_create_fnum(cli,
path,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
/* First open the top level directory. */
status =
- cli_smb2_create_fnum(cli, "", 0, /* create_flags */
+ cli_smb2_create_fnum(cli, "",
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES, /* desired_access */
FILE_ATTRIBUTE_DIRECTORY, /* file attributes */
state->ev,
state->cli,
state->fname,
- 0, /* create_flags */
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
FILE_READ_ATTRIBUTES,
0, /* file attributes */
status = cli_smb2_create_fnum(cli,
fname,
- SMB2_OPLOCK_LEVEL_NONE,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
SEC_FLAG_SYSTEM_SECURITY, /* desired access */
0, /* file_attributes, */
status = cli_smb2_create_fnum(cli,
fname,
- SMB2_OPLOCK_LEVEL_NONE,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
SEC_FLAG_SYSTEM_SECURITY|
FILE_WRITE_ATTRIBUTES, /* desired access */
status = cli_smb2_create_fnum(cli,
fname,
- SMB2_OPLOCK_LEVEL_NONE,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
SEC_FLAG_SYSTEM_SECURITY|
SEC_STD_WRITE_DAC, /* desired access */
status = cli_smb2_create_fnum(cli,
fname,
- SMB2_OPLOCK_LEVEL_NONE,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
SEC_FLAG_SYSTEM_SECURITY|
FILE_READ_ATTRIBUTES, /* desired access */
status = cli_smb2_create_fnum(
cli,
"\\",
- SMB2_OPLOCK_LEVEL_NONE,
+ (struct cli_smb2_create_flags){0},
SMB2_IMPERSONATION_IMPERSONATION,
SEC_GENERIC_READ, /* desired access */
0, /* file_attributes, */