*/
#include "includes.h"
+#include "librpc/gen_ndr/ndr_epmapper.h"
static BOOL test_BindingString(TALLOC_CTX *mem_ctx, const char *binding)
{
struct dcerpc_binding b, b2;
const char *s, *s2;
- struct epm_tower *tower;
+ struct epm_tower tower;
NTSTATUS status;
/* Parse */
/* Convert back to binding and then back to string and compare */
- status = dcerpc_binding_from_tower(mem_ctx, tower, &b2);
+ status = dcerpc_binding_from_tower(mem_ctx, &tower, &b2);
if (NT_STATUS_IS_ERR(status)) {
DEBUG(0, ("Error generating binding from tower for original binding '%s': %s\n", binding, nt_errstr(status)));
return False;
/* Compare to a stripped down version of the binding string because
* the protocol tower doesn't contain the extra option data */
- if (b.options && b.options[0]) {
- b.options[1] = NULL;
- }
+ b.options = NULL;
b.flags = 0;
static const char *test_strings[] = {
"ncacn_np:",
"ncalrpc:",
- "ncalrpc:[Security=Sane]",
+ "ncalrpc:[,Security=Sane]",
"ncacn_np:[rpcecho]",
"ncacn_np:127.0.0.1[rpcecho]",
"ncacn_ip_tcp:127.0.0.1",
+ "ncacn_ip_tcp:127.0.0.1[20]",
+ "ncacn_ip_tcp:127.0.0.1[20,sign]",
+ "ncacn_ip_tcp:127.0.0.1[20,Security=Foobar,sign]",
+ "ncacn_http:127.0.0.1",
+ "ncacn_http:127.0.0.1[78]",
+ "ncacn_http:127.0.0.1[78,ProxyServer=myproxy:3128]",
"ncacn_np:localhost[rpcecho]",
"ncacn_np:[/pipe/rpcecho]",
"ncacn_np:localhost[/pipe/rpcecho,sign,seal]",
"ncadg_ip_udp:",
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_np:localhost",
"308FB580-1EB2-11CA-923B-08002B1075A7@ncacn_ip_tcp:127.0.0.1",
+ "ncacn_unix_stream:[/tmp/epmapper]",
+ "ncalrpc:[IDENTIFIER]",
+ "ncacn_unix_stream:[/tmp/epmapper,sign]",
};
-BOOL torture_local_binding_string(int dummy)
+BOOL torture_local_binding_string(void)
{
BOOL ret = True;
TALLOC_CTX *mem_ctx = talloc_init("test_BindingString");
ret &= test_BindingString(mem_ctx, test_strings[i]);
}
- talloc_destroy(mem_ctx);
+ talloc_free(mem_ctx);
return ret;
}