const char *pipe_name;
uint16 fnum;
struct dcesrv_state *pipe_state;
+ uint16 ipc_state;
} *pipe_list;
};
while (p->pipe_name[0] == '\\') {
p->pipe_name++;
}
+ p->ipc_state = 0x5ff;
/*
we're all set, now ask the dcerpc server subsystem to open the
ZERO_STRUCT(oi->ntcreatex.out);
oi->ntcreatex.out.fnum = p->fnum;
+ oi->ntcreatex.out.ipc_state = p->ipc_state;
return NT_STATUS_OK;
}
}
-/* SMBtrans - used to provide access to SMB pipes */
-static NTSTATUS ipc_trans(struct request_context *req, struct smb_trans2 *trans)
+/* SMBtrans - handle a DCERPC command */
+static NTSTATUS ipc_dcerpc_cmd(struct request_context *req, struct smb_trans2 *trans)
{
struct pipe_state *p;
struct ipc_private *private = req->conn->ntvfs_private;
NTSTATUS status;
-
- if (trans->in.setup_count != 2 ||
- trans->in.setup[0] != TRANSACT_DCERPCCMD) {
- return NT_STATUS_INVALID_PARAMETER;
- }
/* the fnum is in setup[1] */
p = pipe_state_find(private, trans->in.setup[1]);
}
+/* SMBtrans - set named pipe state */
+static NTSTATUS ipc_set_nm_pipe_state(struct request_context *req, struct smb_trans2 *trans)
+{
+ struct pipe_state *p;
+ struct ipc_private *private = req->conn->ntvfs_private;
+
+ /* the fnum is in setup[1] */
+ p = pipe_state_find(private, trans->in.setup[1]);
+ if (!p) {
+ return NT_STATUS_INVALID_HANDLE;
+ }
+
+ if (trans->in.params.length != 2) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+ p->ipc_state = SVAL(trans->in.params.data, 0);
+
+ trans->out.setup_count = 0;
+ trans->out.setup = NULL;
+ trans->out.params = data_blob(NULL, 0);
+ trans->out.data = data_blob(NULL, 0);
+
+ return NT_STATUS_OK;
+}
+
+
+/* SMBtrans - used to provide access to SMB pipes */
+static NTSTATUS ipc_trans(struct request_context *req, struct smb_trans2 *trans)
+{
+ NTSTATUS status;
+
+ if (trans->in.setup_count != 2) {
+ return NT_STATUS_INVALID_PARAMETER;
+ }
+
+ switch (trans->in.setup[0]) {
+ case TRANSACT_SETNAMEDPIPEHANDLESTATE:
+ status = ipc_set_nm_pipe_state(req, trans);
+ break;
+ case TRANSACT_DCERPCCMD:
+ status = ipc_dcerpc_cmd(req, trans);
+ break;
+ default:
+ status = NT_STATUS_INVALID_PARAMETER;
+ break;
+ }
+
+ return status;
+}
+
+
/*
initialialise the IPC backend, registering ourselves with the ntvfs subsystem
twr->floors[3].lhs.info.lhs_data = data_blob(NULL, 0);
twr->floors[3].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\PIPE\\%s",
e->endpoint.info.smb_pipe);
- twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data);
+ twr->floors[3].rhs.rhs_data.length = strlen(twr->floors[3].rhs.rhs_data.data)+1;
/* on an NetBIOS link ... */
twr->floors[4].lhs.protocol = EPM_PROTOCOL_NETBIOS;
twr->floors[4].lhs.info.lhs_data = data_blob(NULL, 0);
twr->floors[4].rhs.rhs_data.data = talloc_asprintf(mem_ctx, "\\\\%s",
lp_netbios_name());
- twr->floors[4].rhs.rhs_data.length = strlen(twr->floors[4].rhs.rhs_data.data);
+ twr->floors[4].rhs.rhs_data.length = strlen(twr->floors[4].rhs.rhs_data.data)+1;
return True;
}
if (num_ents == 0) {
r->out.entries = NULL;
+ r->out.status = EPMAPPER_STATUS_NO_MORE_ENTRIES;
+ ZERO_STRUCTP(r->out.entry_handle);
+ dcesrv_handle_destroy(dce, h);
return NT_STATUS_OK;
}
for (i=0;i<num_ents;i++) {
ZERO_STRUCT(r->out.entries[i].object);
- r->out.entries[i].annotation = "";
+ r->out.entries[i].annotation = eps->e[i].name;
r->out.entries[i].tower = talloc_p(mem_ctx, struct epm_twr_t);
if (!r->out.entries[i].tower) {
return NT_STATUS_NO_MEMORY;
failed:
r->out.num_towers = 0;
- r->out.status = EPMAPPER_MAP_FAILED;
+ r->out.status = EPMAPPER_STATUS_NO_MORE_ENTRIES;
r->out.towers->twr = NULL;
return NT_STATUS_OK;