struct tevent_context *ev,
struct cli_state *cli,
const char *fname,
- int flags,
- mode_t mode,
- bool is_dir)
+ uint32_t wire_flags,
+ mode_t mode)
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_posix_open_internal_state *state = NULL;
- uint32_t wire_flags = open_flags_to_wire(flags);
req = tevent_req_create(
mem_ctx, &state, struct cli_posix_open_internal_state);
return tevent_req_post(req, ev);
}
- /* Setup data words. */
- if (is_dir) {
- wire_flags |= SMB_O_DIRECTORY;
- }
-
SIVAL(state->data,0,0); /* No oplock. */
SIVAL(state->data,4,wire_flags);
SIVAL(state->data,8,unix_perms_to_wire(mode));
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_posix_open_state *state = NULL;
+ uint32_t wire_flags;
req = tevent_req_create(mem_ctx, &state,
struct cli_posix_open_state);
return NULL;
}
+ wire_flags = open_flags_to_wire(flags);
+
subreq = cli_posix_open_internal_send(
- mem_ctx, ev, cli, fname, flags, mode, false);
+ mem_ctx, ev, cli, fname, wire_flags, mode);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}
{
struct tevent_req *req = NULL, *subreq = NULL;
struct cli_posix_mkdir_state *state = NULL;
+ uint32_t wire_flags;
req = tevent_req_create(
mem_ctx, &state, struct cli_posix_mkdir_state);
state->ev = ev;
state->cli = cli;
+ wire_flags = open_flags_to_wire(O_CREAT) | SMB_O_DIRECTORY;
+
subreq = cli_posix_open_internal_send(
- mem_ctx, ev, cli, fname, O_CREAT, mode, true);
+ mem_ctx, ev, cli, fname, wire_flags, mode);
if (tevent_req_nomem(subreq, req)) {
return tevent_req_post(req, ev);
}