summaryrefslogtreecommitdiff
path: root/source3/libnet
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-07-29 12:55:19 +0200
committerMichael Adam <obnox@samba.org>2008-08-01 16:04:42 +0200
commit31c67f939f37bb77a55dcbb28d8e2f17555131e1 (patch)
tree13e149e69e2bbff3d977c07cddb2b0a6974c80f9 /source3/libnet
parent7d7e8907ca8720a5803e367f2fbedd582defbe15 (diff)
downloadsamba-31c67f939f37bb77a55dcbb28d8e2f17555131e1.tar.gz
samba-31c67f939f37bb77a55dcbb28d8e2f17555131e1.tar.bz2
samba-31c67f939f37bb77a55dcbb28d8e2f17555131e1.zip
dssync keytab: add parsing and logging of servicePrincipalName-s
As with the userPrincipalName, this is for debugging purposes only (for now..). Michael (This used to be commit 7a1d526cba4c93bb858a60d04b6486507fc25398)
Diffstat (limited to 'source3/libnet')
-rw-r--r--source3/libnet/libnet_dssync_keytab.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/source3/libnet/libnet_dssync_keytab.c b/source3/libnet/libnet_dssync_keytab.c
index 6784326baf..0d17fdad3d 100644
--- a/source3/libnet/libnet_dssync_keytab.c
+++ b/source3/libnet/libnet_dssync_keytab.c
@@ -171,6 +171,8 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
bool got_pwd = false;
char *upn = NULL;
+ char **spn = NULL;
+ uint32_t num_spns = 0;
char *name = NULL;
uint32_t kvno = 0;
uint32_t uacc = 0;
@@ -185,6 +187,19 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
attr = &cur->object.attribute_ctr.attributes[i];
+ if (attr->attid == DRSUAPI_ATTRIBUTE_servicePrincipalName) {
+ uint32_t count;
+ num_spns = attr->value_ctr.num_values;
+ spn = TALLOC_ARRAY(mem_ctx, char *, num_spns);
+ for (count = 0; count < num_spns; count++) {
+ blob = attr->value_ctr.values[count].blob;
+ pull_string_talloc(spn, NULL, 0,
+ &spn[count],
+ blob->data, blob->length,
+ STR_UNICODE);
+ }
+ }
+
if (attr->value_ctr.num_values != 1) {
continue;
}
@@ -258,6 +273,13 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
if (upn) {
DEBUGADD(1,(", upn: %s", upn));
}
+ if (num_spns > 0) {
+ DEBUGADD(1, (", spns: ["));
+ for (i = 0; i < num_spns; i++) {
+ DEBUGADD(1, ("%s%s", spn[i],
+ (i+1 == num_spns)?"]":", "));
+ }
+ }
DEBUGADD(1,("\n"));
status = add_to_keytab_entries(mem_ctx, ctx, kvno, name, NULL,