This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
- the Free Software Foundation; either version 2 of the License, or
+ the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, write to the Free Software
- Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "includes.h"
*/
static void pipe_dead(struct dcerpc_connection *c, NTSTATUS status)
{
- struct smb2_private *smb = c->transport.private;
+ struct smb2_private *smb = c->transport.private_data;
if (smb->dead) {
return;
NTSTATUS status;
state = talloc_get_type(req->async.private, struct smb2_read_state);
- smb = talloc_get_type(state->c->transport.private, struct smb2_private);
+ smb = talloc_get_type(state->c->transport.private_data, struct smb2_private);
status = smb2_read_recv(req, state, &io);
if (NT_STATUS_IS_ERR(status)) {
return;
}
- status = data_blob_append(state, &state->data,
- io.out.data.data, io.out.data.length);
- if (NT_STATUS_IS_ERR(status)) {
- pipe_dead(state->c, status);
+ if (!data_blob_append(state, &state->data,
+ io.out.data.data, io.out.data.length)) {
+ pipe_dead(state->c, NT_STATUS_NO_MEMORY);
talloc_free(state);
return;
}
*/
static NTSTATUS send_read_request_continue(struct dcerpc_connection *c, DATA_BLOB *blob)
{
- struct smb2_private *smb = c->transport.private;
+ struct smb2_private *smb = c->transport.private_data;
struct smb2_read io;
struct smb2_read_state *state;
struct smb2_request *req;
*/
static NTSTATUS send_read_request(struct dcerpc_connection *c)
{
- struct smb2_private *smb = c->transport.private;
+ struct smb2_private *smb = c->transport.private_data;
if (smb->dead) {
return NT_STATUS_CONNECTION_DISCONNECTED;
*/
static NTSTATUS smb2_send_trans_request(struct dcerpc_connection *c, DATA_BLOB *blob)
{
- struct smb2_private *smb = talloc_get_type(c->transport.private,
+ struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
struct smb2_ioctl io;
struct smb2_trans_state *state;
static NTSTATUS smb2_send_request(struct dcerpc_connection *c, DATA_BLOB *blob,
BOOL trigger_read)
{
- struct smb2_private *smb = c->transport.private;
+ struct smb2_private *smb = c->transport.private_data;
struct smb2_write io;
struct smb2_request *req;
*/
static NTSTATUS smb2_shutdown_pipe(struct dcerpc_connection *c, NTSTATUS status)
{
- struct smb2_private *smb = c->transport.private;
+ struct smb2_private *smb = c->transport.private_data;
struct smb2_close io;
struct smb2_request *req;
*/
static const char *smb2_peer_name(struct dcerpc_connection *c)
{
- struct smb2_private *smb = talloc_get_type(c->transport.private,
+ struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
return smb->server_name;
}
*/
static const char *smb2_target_hostname(struct dcerpc_connection *c)
{
- struct smb2_private *smb = talloc_get_type(c->transport.private,
+ struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
return smb->tree->session->transport->socket->hostname;
}
*/
static NTSTATUS smb2_session_key(struct dcerpc_connection *c, DATA_BLOB *session_key)
{
- struct smb2_private *smb = talloc_get_type(c->transport.private,
+ struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
*session_key = smb->tree->session->session_key;
if (session_key->data == NULL) {
fill in the transport methods
*/
c->transport.transport = NCACN_NP;
- c->transport.private = NULL;
+ c->transport.private_data = NULL;
c->transport.shutdown_pipe = smb2_shutdown_pipe;
c->transport.peer_name = smb2_peer_name;
c->transport.target_hostname = smb2_target_hostname;
if (composite_nomem(smb->server_name, ctx)) return;
smb->dead = false;
- c->transport.private = smb;
+ c->transport.private_data = smb;
composite_done(ctx);
}
*/
struct smb2_tree *dcerpc_smb2_tree(struct dcerpc_connection *c)
{
- struct smb2_private *smb = talloc_get_type(c->transport.private,
+ struct smb2_private *smb = talloc_get_type(c->transport.private_data,
struct smb2_private);
return smb->tree;
}