Be compatible with the asn1 principal format.
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1953 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
22
admin/ank.c
22
admin/ank.c
@@ -27,14 +27,22 @@ doit(char *principal, int mod)
|
|||||||
fprintf(stderr, "Entry not found in database\n");
|
fprintf(stderr, "Entry not found in database\n");
|
||||||
return;
|
return;
|
||||||
}else{
|
}else{
|
||||||
krb5_data *realm;
|
krb5_realm *realm;
|
||||||
|
|
||||||
realm = krb5_princ_realm(context, ent.principal);
|
realm = krb5_princ_realm(context, ent.principal);
|
||||||
|
#ifdef USE_ASN1_PRINCIPAL
|
||||||
|
krb5_build_principal(context, &def.principal,
|
||||||
|
strlen(*realm),
|
||||||
|
*realm,
|
||||||
|
"default",
|
||||||
|
NULL);
|
||||||
|
#else
|
||||||
krb5_build_principal(context, &def.principal,
|
krb5_build_principal(context, &def.principal,
|
||||||
realm->length,
|
realm->length,
|
||||||
realm->data,
|
realm->data,
|
||||||
"default",
|
"default",
|
||||||
NULL);
|
NULL);
|
||||||
|
#endif
|
||||||
if(db->fetch(context, db, &def)){
|
if(db->fetch(context, db, &def)){
|
||||||
/* XXX */
|
/* XXX */
|
||||||
}
|
}
|
||||||
@@ -83,11 +91,23 @@ doit(char *principal, int mod)
|
|||||||
ent.kvno++;
|
ent.kvno++;
|
||||||
}
|
}
|
||||||
ent.last_change = time(NULL);
|
ent.last_change = time(NULL);
|
||||||
|
{
|
||||||
|
krb5_realm *realm = krb5_princ_realm(context, ent.principal);
|
||||||
|
|
||||||
|
#ifdef USE_ASN1_PRINCIPAL
|
||||||
|
krb5_build_principal(context, &ent.changed_by,
|
||||||
|
strlen(*realm),
|
||||||
|
*realm,
|
||||||
|
"kadmin",
|
||||||
|
NULL);
|
||||||
|
#else
|
||||||
krb5_build_principal(context, &ent.changed_by,
|
krb5_build_principal(context, &ent.changed_by,
|
||||||
krb5_princ_realm(context, ent.principal)->length,
|
krb5_princ_realm(context, ent.principal)->length,
|
||||||
krb5_princ_realm(context, ent.principal)->data,
|
krb5_princ_realm(context, ent.principal)->data,
|
||||||
"kadmin",
|
"kadmin",
|
||||||
NULL);
|
NULL);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
err = db->store(context, db, &ent);
|
err = db->store(context, db, &ent);
|
||||||
if(err == -1){
|
if(err == -1){
|
||||||
perror("dbput");
|
perror("dbput");
|
||||||
|
Reference in New Issue
Block a user