diff options
author | Simo Sorce <idra@samba.org> | 2010-02-12 16:24:22 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2010-02-12 16:39:33 -0500 |
commit | 30797cec7d826a75e6e458829fc3b2203d841ba3 (patch) | |
tree | 7330f1fe3da80ccb96d515b95f1d4a93d1c24b21 /source4/kdc/db-glue.c | |
parent | 2e2b7e82592dc5dbb818b621cafafdab05796a12 (diff) | |
download | samba-30797cec7d826a75e6e458829fc3b2203d841ba3.tar.gz samba-30797cec7d826a75e6e458829fc3b2203d841ba3.tar.xz samba-30797cec7d826a75e6e458829fc3b2203d841ba3.zip |
s4:kdc Fill in created_by principal field
Diffstat (limited to 'source4/kdc/db-glue.c')
-rw-r--r-- | source4/kdc/db-glue.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source4/kdc/db-glue.c b/source4/kdc/db-glue.c index 9db5119da53..4fc94f8669f 100644 --- a/source4/kdc/db-glue.c +++ b/source4/kdc/db-glue.c @@ -751,7 +751,7 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context, { struct loadparm_context *lp_ctx = kdc_db_ctx->lp_ctx; const char *dnsdomain; - char *realm; + char *realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx)); DATA_BLOB password_utf16; struct samr_Password password_hash; const struct ldb_val *password_val; @@ -781,19 +781,22 @@ static krb5_error_code samba_kdc_trust_message2entry(krb5_context context, /* use 'whenCreated' */ entry_ex->entry.created_by.time = ldb_msg_find_krb5time_ldap_time(msg, "whenCreated", 0); - /* use '???' */ - entry_ex->entry.created_by.principal = NULL; + /* use 'kadmin' for now (needed by mit_samba) */ + krb5_make_principal(context, + &entry_ex->entry.created_by.principal, + realm, "kadmin", NULL); entry_ex->entry.valid_start = NULL; trust_direction_flags = ldb_msg_find_attr_as_int(msg, "trustDirection", 0); if (direction == INBOUND) { - realm = strupper_talloc(mem_ctx, lp_realm(lp_ctx)); password_val = ldb_msg_find_ldb_val(msg, "trustAuthIncoming"); } else { /* OUTBOUND */ dnsdomain = ldb_msg_find_attr_as_string(msg, "trustPartner", NULL); + /* replace realm */ + talloc_free(realm); realm = strupper_talloc(mem_ctx, dnsdomain); password_val = ldb_msg_find_ldb_val(msg, "trustAuthOutgoing"); } |