(kadm5_s_get_principal): set life, rlife to INT_MAX as a fallback.

handle not having any creator.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8214 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-05-12 15:25:23 +00:00
parent b1853e3fe6
commit c46407cd43

View File

@@ -78,8 +78,12 @@ kadm5_s_get_principal(void *server_handle,
out->attributes |= ent.flags.server ? 0 : KRB5_KDB_DISALLOW_SVR; out->attributes |= ent.flags.server ? 0 : KRB5_KDB_DISALLOW_SVR;
out->attributes |= ent.flags.change_pw ? KRB5_KDB_PWCHANGE_SERVICE : 0; out->attributes |= ent.flags.change_pw ? KRB5_KDB_PWCHANGE_SERVICE : 0;
} }
if(mask & KADM5_MAX_LIFE && ent.max_life) if(mask & KADM5_MAX_LIFE) {
out->max_life = *ent.max_life; if(ent.max_life)
out->max_life = *ent.max_life;
else
out->max_life = INT_MAX;
}
if(mask & KADM5_MOD_TIME) { if(mask & KADM5_MOD_TIME) {
if(ent.modified_by) if(ent.modified_by)
out->mod_date = ent.modified_by->time; out->mod_date = ent.modified_by->time;
@@ -92,10 +96,12 @@ kadm5_s_get_principal(void *server_handle,
ret = krb5_copy_principal(context->context, ret = krb5_copy_principal(context->context,
ent.modified_by->principal, ent.modified_by->principal,
&out->mod_name); &out->mod_name);
} else } else if(ent.created_by.principal != NULL)
ret = krb5_copy_principal(context->context, ret = krb5_copy_principal(context->context,
ent.created_by.principal, ent.created_by.principal,
&out->mod_name); &out->mod_name);
else
out->mod_name = NULL;
} }
if(ret) if(ret)
goto out; goto out;
@@ -115,8 +121,12 @@ kadm5_s_get_principal(void *server_handle,
/* XXX implement */; /* XXX implement */;
if(mask & KADM5_POLICY) if(mask & KADM5_POLICY)
out->policy = NULL; out->policy = NULL;
if(mask & KADM5_MAX_RLIFE && ent.max_renew) if(mask & KADM5_MAX_RLIFE) {
out->max_renewable_life = *ent.max_renew; if(ent.max_renew)
out->max_renewable_life = *ent.max_renew;
else
out->max_renewable_life = INT_MAX;
}
if(mask & KADM5_LAST_SUCCESS) if(mask & KADM5_LAST_SUCCESS)
/* XXX implement */; /* XXX implement */;
if(mask & KADM5_LAST_FAILED) if(mask & KADM5_LAST_FAILED)