struct smb2_hnd {
uint64_t fid_persistent;
uint64_t fid_volatile;
+ bool posix; /* Opened with posix context */
};
/*
static NTSTATUS map_smb2_handle_to_fnum(struct cli_state *cli,
uint64_t fid_persistent,
uint64_t fid_volatile,
+ bool posix,
uint16_t *pfnum)
{
int ret;
*owned_h = (struct smb2_hnd){
.fid_persistent = fid_persistent,
.fid_volatile = fid_volatile,
+ .posix = posix,
};
if (idp == NULL) {
struct cli_smb2_create_fnum_state *state = tevent_req_data(
req, struct cli_smb2_create_fnum_state);
uint64_t fid_persistent, fid_volatile;
+ struct smb2_create_blob *posix = NULL;
NTSTATUS status;
status = smb2cli_create_recv(subreq,
return;
}
+ posix = smb2_create_blob_find(&state->in_cblobs,
+ SMB2_CREATE_TAG_POSIX);
+
status = map_smb2_handle_to_fnum(state->cli,
fid_persistent,
fid_volatile,
+ (posix != NULL),
&state->fnum);
if (tevent_req_nterror(req, status)) {
return;
return NT_STATUS_OK;
}
+bool cli_smb2_fnum_is_posix(struct cli_state *cli, uint16_t fnum)
+{
+ struct smb2_hnd *ph = NULL;
+ NTSTATUS status;
+
+ status = map_fnum_to_smb2_handle(cli, fnum, &ph);
+ if (!NT_STATUS_IS_OK(status)) {
+ return false;
+ }
+ return ph->posix;
+}
+
NTSTATUS cli_smb2_create_fnum(
struct cli_state *cli,
const char *fname,
TALLOC_CTX *mem_ctx,
struct smb2_create_blobs *out_cblobs);
+bool cli_smb2_fnum_is_posix(struct cli_state *cli, uint16_t fnum);
+
struct tevent_req *cli_smb2_close_fnum_send(TALLOC_CTX *mem_ctx,
struct tevent_context *ev,
struct cli_state *cli,