summaryrefslogtreecommitdiff
path: root/source4/librpc
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-27 16:22:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:48 -0500
commitd658de65d32e6746ac51aeb4da7aa74b3da40c2b (patch)
tree3057af6864b3eb0b26d523aa4c100213380551f5 /source4/librpc
parent8270e1e31071d23915cc3aa408ad6c7074ea1c11 (diff)
downloadsamba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.tar.gz
samba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.tar.bz2
samba-d658de65d32e6746ac51aeb4da7aa74b3da40c2b.zip
r12512: Use GUID structs in API functions everywhere rather then converting back and
forth between GUID structs and strings in several places. (This used to be commit 3564e2f967ef72d6301b4f7e9a311cebcded4d75)
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/idl/krb5pac.idl1
-rw-r--r--source4/librpc/rpc/dcerpc.c4
-rw-r--r--source4/librpc/rpc/dcerpc.h2
-rw-r--r--source4/librpc/rpc/dcerpc_util.c31
4 files changed, 15 insertions, 23 deletions
diff --git a/source4/librpc/idl/krb5pac.idl b/source4/librpc/idl/krb5pac.idl
index dd3eedc7a7..0d614493ed 100644
--- a/source4/librpc/idl/krb5pac.idl
+++ b/source4/librpc/idl/krb5pac.idl
@@ -5,7 +5,6 @@
#include "idl_types.h"
[
- uuid("1-2-3-4"),
version(0.0),
pointer_default(unique),
depends(security,netlogon)
diff --git a/source4/librpc/rpc/dcerpc.c b/source4/librpc/rpc/dcerpc.c
index b947b4aa5c..10093cfcbb 100644
--- a/source4/librpc/rpc/dcerpc.c
+++ b/source4/librpc/rpc/dcerpc.c
@@ -796,9 +796,7 @@ NTSTATUS dcerpc_init_syntaxes(const struct dcerpc_interface_table *table,
{
NTSTATUS status;
- status = GUID_from_string(table->uuid, &syntax->uuid);
- if (!NT_STATUS_IS_OK(status)) return status;
-
+ syntax->uuid = table->uuid;
syntax->if_version = table->if_version;
status = GUID_from_string(NDR_GUID, &transfer_syntax->uuid);
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index 5f13ba3081..058bef1ddf 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -168,7 +168,7 @@ struct dcerpc_authservice_list {
struct dcerpc_interface_table {
const char *name;
- const char *uuid;
+ struct GUID uuid;
uint32_t if_version;
const char *helpstring;
uint32_t num_calls;
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 080f5dee6b..3a1e3c6cff 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -34,11 +34,11 @@
/*
find the pipe name for a local IDL interface
*/
-const char *idl_pipe_name(const char *uuid, uint32_t if_version)
+const char *idl_pipe_name(const struct GUID *uuid, uint32_t if_version)
{
const struct dcerpc_interface_list *l;
for (l=librpc_dcerpc_pipes();l;l=l->next) {
- if (strcasecmp(l->table->uuid, uuid) == 0 &&
+ if (GUID_equal(&l->table->uuid, uuid) &&
l->table->if_version == if_version) {
return l->table->name;
}
@@ -49,11 +49,11 @@ const char *idl_pipe_name(const char *uuid, uint32_t if_version)
/*
find the number of calls defined by local IDL
*/
-int idl_num_calls(const char *uuid, uint32_t if_version)
+int idl_num_calls(const struct GUID *uuid, uint32_t if_version)
{
const struct dcerpc_interface_list *l;
for (l=librpc_dcerpc_pipes();l;l=l->next){
- if (strcasecmp(l->table->uuid, uuid) == 0 &&
+ if (GUID_equal(&l->table->uuid, uuid) &&
l->table->if_version == if_version) {
return l->table->num_calls;
}
@@ -79,11 +79,11 @@ const struct dcerpc_interface_table *idl_iface_by_name(const char *name)
/*
find a dcerpc interface by uuid
*/
-const struct dcerpc_interface_table *idl_iface_by_uuid(const char *uuid)
+const struct dcerpc_interface_table *idl_iface_by_uuid(const struct GUID *uuid)
{
const struct dcerpc_interface_list *l;
for (l=librpc_dcerpc_pipes();l;l=l->next) {
- if (strcasecmp(l->table->uuid, uuid) == 0) {
+ if (GUID_equal(&l->table->uuid, uuid)) {
return l->table;
}
}
@@ -883,11 +883,7 @@ NTSTATUS dcerpc_epm_map_binding(TALLOC_CTX *mem_ctx, struct dcerpc_binding *bind
ZERO_STRUCT(handle);
ZERO_STRUCT(guid);
- status = GUID_from_string(table->uuid, &binding->object);
- if (NT_STATUS_IS_ERR(status)) {
- return status;
- }
-
+ binding->object = table->uuid;
binding->object_version = table->if_version;
status = dcerpc_binding_build_tower(p, binding, &twr.tower);
@@ -998,7 +994,9 @@ NTSTATUS dcerpc_pipe_auth(struct dcerpc_pipe *p,
}
if (!NT_STATUS_IS_OK(status)) {
- DEBUG(0,("Failed to bind to uuid %s - %s\n", table->uuid, nt_errstr(status)));
+ char *uuid_str = GUID_string(p, &table->uuid);
+ DEBUG(0,("Failed to bind to uuid %s - %s\n", uuid_str, nt_errstr(status)));
+ talloc_free(uuid_str);
}
talloc_free(tmp_ctx);
return status;
@@ -1119,7 +1117,8 @@ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
p->conn->event_ctx);
if (!NT_STATUS_IS_OK(status)) {
DEBUG(0,("Failed to map DCERPC endpoint for '%s' - %s\n",
- table->uuid, nt_errstr(status)));
+ GUID_string(tmp_ctx, &table->uuid), nt_errstr(status)));
+ talloc_free(tmp_ctx);
return status;
}
DEBUG(2,("Mapped to DCERPC endpoint %s\n", binding->endpoint));
@@ -1338,11 +1337,7 @@ NTSTATUS dcerpc_secondary_context(struct dcerpc_pipe *p,
p2->context_id = ++p->conn->next_context_id;
- status = GUID_from_string(table->uuid, &p2->syntax.uuid);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(p2);
- return status;
- }
+ p2->syntax.uuid = table->uuid;
p2->syntax.if_version = table->if_version;
status = GUID_from_string(NDR_GUID, &p2->transfer_syntax.uuid);