1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-29 21:47:30 +03:00

Add server_info to pipes_struct

This commit is contained in:
Volker Lendecke 2008-06-24 14:18:55 +02:00
parent fee770e5d0
commit d621867bb8
5 changed files with 39 additions and 0 deletions

View File

@ -1334,6 +1334,22 @@ struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
return dst;
}
/*
* Set a new session key. Used in the rpc server where we have to override the
* SMB level session key with SystemLibraryDTC
*/
bool server_info_set_session_key(struct auth_serversupplied_info *info,
DATA_BLOB session_key)
{
TALLOC_FREE(info->user_session_key.data);
info->user_session_key = data_blob_talloc(
info, session_key.data, session_key.length);
return (info->user_session_key.data != NULL);
}
static auth_serversupplied_info *guest_info = NULL;
bool init_guest_info(void)

View File

@ -215,6 +215,8 @@ typedef struct pipes_struct {
uint16 vuid; /* points to the unauthenticated user that opened this pipe. */
struct auth_serversupplied_info *server_info;
fstring name;
fstring pipe_srv_name;

View File

@ -122,6 +122,8 @@ NTSTATUS make_serverinfo_from_username(TALLOC_CTX *mem_ctx,
struct auth_serversupplied_info *copy_serverinfo(TALLOC_CTX *mem_ctx,
auth_serversupplied_info *src);
bool init_guest_info(void);
bool server_info_set_session_key(struct auth_serversupplied_info *info,
DATA_BLOB session_key);
NTSTATUS make_server_info_guest(TALLOC_CTX *mem_ctx,
auth_serversupplied_info **server_info);
bool copy_current_user(struct current_user *dst, struct current_user *src);

View File

@ -694,6 +694,16 @@ static bool pipe_ntlmssp_verify_final(pipes_struct *p, DATA_BLOB *p_resp_blob)
return False;
}
TALLOC_FREE(p->server_info);
p->server_info = copy_serverinfo(p, a->server_info);
if (p->server_info == NULL) {
DEBUG(0, ("copy_serverinfo failed\n"));
return false;
}
server_info_set_session_key(p->server_info, p->session_key);
return True;
}

View File

@ -314,6 +314,15 @@ static void *make_internal_rpc_pipe_p(const char *pipe_name,
return NULL;
}
p->server_info = copy_serverinfo(p, conn->server_info);
if (p->server_info == NULL) {
DEBUG(0, ("open_rpc_pipe_p: copy_serverinfo failed\n"));
talloc_destroy(p->mem_ctx);
close_policy_by_pipe(p);
TALLOC_FREE(p);
return NULL;
}
DLIST_ADD(InternalPipes, p);
memcpy(p->client_address, conn->client_address,