1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-27 22:50:26 +03:00

s3: smbd: Add "enum brl_flavour" to struct smbd_lock_element.

Initialized correctly but not yet used.
Will allow 'brl_flavour' to be removed from lock calls.
This will allow SMB2 POSIX handles to call with POSIX_LOCK
flavour instead of always using WINDOWS_LOCK (as now).

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Noel Power <npower@samba.org>
This commit is contained in:
Jeremy Allison 2021-11-16 14:26:44 -08:00 committed by Noel Power
parent 099c62a654
commit 9a0212800c
4 changed files with 10 additions and 0 deletions

View File

@ -67,6 +67,7 @@ struct smbd_lock_element {
struct GUID req_guid;
uint64_t smblctx;
enum brl_type brltype;
enum brl_flavour lock_flav;
uint64_t offset;
uint64_t count;
};

View File

@ -3794,6 +3794,7 @@ void reply_lockread(struct smb_request *req)
.req_guid = smbd_request_guid(req, 0),
.smblctx = req->smbpid,
.brltype = WRITE_LOCK,
.lock_flav = WINDOWS_LOCK,
.count = SVAL(req->vwv+1, 0),
.offset = IVAL_TO_SMB_OFF_T(req->vwv+2, 0),
};
@ -4823,6 +4824,7 @@ void reply_writeunlock(struct smb_request *req)
.req_guid = smbd_request_guid(req, 0),
.smblctx = req->smbpid,
.brltype = UNLOCK_LOCK,
.lock_flav = WINDOWS_LOCK,
.offset = startpos,
.count = numtowrite,
};
@ -6000,6 +6002,7 @@ void reply_lock(struct smb_request *req)
.req_guid = smbd_request_guid(req, 0),
.smblctx = req->smbpid,
.brltype = WRITE_LOCK,
.lock_flav = WINDOWS_LOCK,
.count = IVAL(req->vwv+1, 0),
.offset = IVAL(req->vwv+3, 0),
};
@ -6092,6 +6095,7 @@ void reply_unlock(struct smb_request *req)
.req_guid = smbd_request_guid(req, 0),
.smblctx = req->smbpid,
.brltype = UNLOCK_LOCK,
.lock_flav = WINDOWS_LOCK,
.offset = IVAL(req->vwv+3, 0),
.count = IVAL(req->vwv+1, 0),
};
@ -8316,6 +8320,7 @@ void reply_lockingX(struct smb_request *req)
ulocks[i].offset = get_lock_offset(
data, i, large_file_format);
ulocks[i].brltype = UNLOCK_LOCK;
ulocks[i].lock_flav = WINDOWS_LOCK;
}
/*
@ -8371,6 +8376,7 @@ void reply_lockingX(struct smb_request *req)
locks[i].count = get_lock_count(data, i, large_file_format);
locks[i].offset = get_lock_offset(data, i, large_file_format);
locks[i].brltype = brltype;
locks[i].lock_flav = WINDOWS_LOCK;
}
if (locktype & LOCKING_ANDX_CANCEL_LOCK) {

View File

@ -441,6 +441,7 @@ static struct tevent_req *smbd_smb2_lock_send(TALLOC_CTX *mem_ctx,
} else {
locks[i].brltype = UNLOCK_LOCK;
}
locks[i].lock_flav = WINDOWS_LOCK;
DBG_DEBUG("index %"PRIu16" offset=%"PRIu64", count=%"PRIu64", "
"smblctx = %"PRIu64" type %d\n",

View File

@ -7673,6 +7673,7 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
.req_guid = smbd_request_guid(req, 0),
.smblctx = smblctx,
.brltype = UNLOCK_LOCK,
.lock_flav = POSIX_LOCK,
.offset = offset,
.count = count,
};
@ -7689,6 +7690,7 @@ static NTSTATUS smb_set_posix_lock(connection_struct *conn,
.req_guid = smbd_request_guid(req, 0),
.smblctx = smblctx,
.brltype = lock_type,
.lock_flav = POSIX_LOCK,
.count = count,
.offset = offset,
};