(create_random_entry): more correct setting of mask
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@6279 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -42,7 +42,9 @@
|
|||||||
RCSID("$Id$");
|
RCSID("$Id$");
|
||||||
|
|
||||||
static kadm5_ret_t
|
static kadm5_ret_t
|
||||||
create_random_entry(krb5_principal princ, time_t max_life, time_t max_rlife,
|
create_random_entry(krb5_principal princ,
|
||||||
|
unsigned max_life,
|
||||||
|
unsigned max_rlife,
|
||||||
u_int32_t attributes)
|
u_int32_t attributes)
|
||||||
{
|
{
|
||||||
kadm5_principal_ent_rec ent;
|
kadm5_principal_ent_rec ent;
|
||||||
@@ -54,10 +56,14 @@ create_random_entry(krb5_principal princ, time_t max_life, time_t max_rlife,
|
|||||||
memset(&ent, 0, sizeof(ent));
|
memset(&ent, 0, sizeof(ent));
|
||||||
ent.principal = princ;
|
ent.principal = princ;
|
||||||
mask |= KADM5_PRINCIPAL;
|
mask |= KADM5_PRINCIPAL;
|
||||||
ent.max_life = max_life;
|
if (max_life) {
|
||||||
mask |= KADM5_MAX_LIFE;
|
ent.max_life = max_life;
|
||||||
ent.max_renewable_life = max_rlife;
|
mask |= KADM5_MAX_LIFE;
|
||||||
mask |= KADM5_MAX_RLIFE;
|
}
|
||||||
|
if (max_rlife) {
|
||||||
|
ent.max_renewable_life = max_rlife;
|
||||||
|
mask |= KADM5_MAX_RLIFE;
|
||||||
|
}
|
||||||
ent.attributes |= attributes | KRB5_KDB_DISALLOW_ALL_TIX;
|
ent.attributes |= attributes | KRB5_KDB_DISALLOW_ALL_TIX;
|
||||||
mask |= KADM5_ATTRIBUTES;
|
mask |= KADM5_ATTRIBUTES;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user