mirror of
https://github.com/samba-team/samba.git
synced 2024-12-23 17:34:34 +03:00
r11759: fix up the SEC_SHARE handling, when we want to support that later
we need to fake a smbsrv_session for each smbsrv_tcon... metze
This commit is contained in:
parent
ba897e537b
commit
5b5fb17720
@ -459,7 +459,6 @@ static void switch_message(int type, struct smbsrv_request *req)
|
||||
{
|
||||
int flags;
|
||||
struct smbsrv_connection *smb_conn = req->smb_conn;
|
||||
uint16_t session_tag;
|
||||
NTSTATUS status;
|
||||
|
||||
type &= 0xff;
|
||||
@ -476,24 +475,19 @@ static void switch_message(int type, struct smbsrv_request *req)
|
||||
|
||||
req->tcon = smbsrv_tcon_find(smb_conn, SVAL(req->in.hdr,HDR_TID));
|
||||
|
||||
if (req->session == NULL) {
|
||||
if (!req->session) {
|
||||
/* setup the user context for this request if it
|
||||
hasn't already been initialised (to cope with SMB
|
||||
chaining) */
|
||||
|
||||
/* In share mode security we must ignore the vuid. */
|
||||
if (smb_conn->config.security == SEC_SHARE) {
|
||||
session_tag = UID_FIELD_INVALID;
|
||||
} else {
|
||||
session_tag = SVAL(req->in.hdr,HDR_UID);
|
||||
}
|
||||
|
||||
req->session = smbsrv_session_find(req->smb_conn, session_tag);
|
||||
if (req->session) {
|
||||
req->session->vuid = session_tag;
|
||||
if (req->tcon) {
|
||||
req->session = req->tcon->sec_share.session;
|
||||
}
|
||||
} else {
|
||||
session_tag = req->session->vuid;
|
||||
req->session = smbsrv_session_find(req->smb_conn, SVAL(req->in.hdr,HDR_UID));
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG(3,("switch message %s (task_id %d)\n",smb_fn_name(type), req->smb_conn->connection->server_id));
|
||||
|
@ -106,9 +106,7 @@ struct smbsrv_session *smbsrv_register_session(struct smbsrv_connection *smb_con
|
||||
int i;
|
||||
|
||||
/* Ensure no vuid gets registered in share level security. */
|
||||
/* TODO: replace lp_security with a flag in smbsrv_connection */
|
||||
if (lp_security() == SEC_SHARE)
|
||||
return UID_FIELD_INVALID;
|
||||
if (smb_conn->config.security == SEC_SHARE) return NULL;
|
||||
|
||||
sess = talloc(smb_conn, struct smbsrv_session);
|
||||
if (sess == NULL) {
|
||||
|
@ -80,6 +80,12 @@ struct smbsrv_tcon {
|
||||
/* the reported device type */
|
||||
char *dev_type;
|
||||
|
||||
/* some stuff to support share level security */
|
||||
struct {
|
||||
/* in share level security we need to fake up a session */
|
||||
struct smbsrv_session *session;
|
||||
} sec_share;
|
||||
|
||||
struct timeval connect_time;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user