Пример #1
0
/*
  find the pipe name for a local IDL interface
*/
const char *ndr_interface_name(const struct GUID *uuid, uint32_t if_version)
{
	const struct ndr_interface_list *l;
	for (l=ndr_table_list();l;l=l->next) {
		if (GUID_equal(&l->table->syntax_id.uuid, uuid) &&
		    l->table->syntax_id.if_version == if_version) {
			return l->table->name;
		}
	}
	return "UNKNOWN";
}
Пример #2
0
static bool remote_op_interface_by_uuid(struct dcesrv_interface *iface, const struct GUID *uuid, uint32_t if_version)
{
	const struct ndr_interface_list *l;

	for (l=ndr_table_list();l;l=l->next) {
		if (l->table->syntax_id.if_version == if_version &&
			GUID_equal(&l->table->syntax_id.uuid, uuid)==0) {
			return remote_fill_interface(iface, l->table);
		}
	}

	return false;	
}
Пример #3
0
bool torture_rpc_mgmt(struct torture_context *torture)
{
        NTSTATUS status;
        struct dcerpc_pipe *p;
	TALLOC_CTX *mem_ctx, *loop_ctx;
	bool ret = true;
	const struct ndr_interface_list *l;
	struct dcerpc_binding *b;

	mem_ctx = talloc_init("torture_rpc_mgmt");

	status = torture_rpc_binding(torture, &b);
	if (!NT_STATUS_IS_OK(status)) {
		talloc_free(mem_ctx);
		return false;
	}

	for (l=ndr_table_list();l;l=l->next) {		
		loop_ctx = talloc_named(mem_ctx, 0, "torture_rpc_mgmt loop context");
		
		/* some interfaces are not mappable */
		if (l->table->num_calls == 0 ||
		    strcmp(l->table->name, "mgmt") == 0) {
			talloc_free(loop_ctx);
			continue;
		}

		printf("\nTesting pipe '%s'\n", l->table->name);

		status = dcerpc_epm_map_binding(loop_ctx, b, l->table, NULL, torture->lp_ctx);
		if (!NT_STATUS_IS_OK(status)) {
			printf("Failed to map port for uuid %s\n", 
				   GUID_string(loop_ctx, &l->table->syntax_id.uuid));
			talloc_free(loop_ctx);
			continue;
		}

		lp_set_cmdline(torture->lp_ctx, "torture:binding", dcerpc_binding_string(loop_ctx, b));

		status = torture_rpc_connection(torture, &p, &ndr_table_mgmt);
		if (NT_STATUS_EQUAL(status, NT_STATUS_OBJECT_NAME_NOT_FOUND)) {
			printf("Interface not available - skipping\n");
			talloc_free(loop_ctx);
			continue;
		}

		if (!NT_STATUS_IS_OK(status)) {
			talloc_free(loop_ctx);
			ret = false;
			continue;
		}

		if (!test_is_server_listening(p, loop_ctx)) {
			ret = false;
		}

		if (!test_stop_server_listening(p, loop_ctx)) {
			ret = false;
		}

		if (!test_inq_stats(p, loop_ctx)) {
			ret = false;
		}

		if (!test_inq_princ_name(p, loop_ctx)) {
			ret = false;
		}

		if (!test_inq_if_ids(torture, p, loop_ctx, NULL, NULL)) {
			ret = false;
		}

	}

	return ret;
}