(init): add `kadmin/changepw'
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@2899 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
28
admin/init.c
28
admin/init.c
@@ -160,6 +160,34 @@ init(int argc, char **argv)
|
|||||||
ent.flags.invalid = 1;
|
ent.flags.invalid = 1;
|
||||||
db->store(context, db, &ent);
|
db->store(context, db, &ent);
|
||||||
hdb_free_entry(context, &ent);
|
hdb_free_entry(context, &ent);
|
||||||
|
|
||||||
|
/* Create `kadmin/changepw' */
|
||||||
|
memset(&ent, 0, sizeof(ent));
|
||||||
|
init_des_key(&ent);
|
||||||
|
ent.kvno = 1;
|
||||||
|
krb5_build_principal(context, &ent.principal,
|
||||||
|
strlen(argv[i]), argv[i],
|
||||||
|
"kadmin",
|
||||||
|
"changepw",
|
||||||
|
NULL);
|
||||||
|
if(default_life){
|
||||||
|
ent.max_life = malloc(sizeof(*ent.max_life));
|
||||||
|
*ent.max_life = default_life;
|
||||||
|
}
|
||||||
|
if(default_renew){
|
||||||
|
ent.max_renew = malloc(sizeof(*ent.max_renew));
|
||||||
|
*ent.max_renew = default_renew;
|
||||||
|
}
|
||||||
|
ent.created_by.time = time(NULL);
|
||||||
|
krb5_build_principal(context, &ent.created_by.principal,
|
||||||
|
strlen(argv[i]), argv[i],
|
||||||
|
"kadmin",
|
||||||
|
NULL);
|
||||||
|
ent.flags.initial = 1;
|
||||||
|
ent.flags.server = 1;
|
||||||
|
ent.flags.change_pw = 1;
|
||||||
|
db->store(context, db, &ent);
|
||||||
|
hdb_free_entry(context, &ent);
|
||||||
}
|
}
|
||||||
db->close(context, db);
|
db->close(context, db);
|
||||||
return 0;
|
return 0;
|
||||||
|
@@ -160,6 +160,34 @@ init(int argc, char **argv)
|
|||||||
ent.flags.invalid = 1;
|
ent.flags.invalid = 1;
|
||||||
db->store(context, db, &ent);
|
db->store(context, db, &ent);
|
||||||
hdb_free_entry(context, &ent);
|
hdb_free_entry(context, &ent);
|
||||||
|
|
||||||
|
/* Create `kadmin/changepw' */
|
||||||
|
memset(&ent, 0, sizeof(ent));
|
||||||
|
init_des_key(&ent);
|
||||||
|
ent.kvno = 1;
|
||||||
|
krb5_build_principal(context, &ent.principal,
|
||||||
|
strlen(argv[i]), argv[i],
|
||||||
|
"kadmin",
|
||||||
|
"changepw",
|
||||||
|
NULL);
|
||||||
|
if(default_life){
|
||||||
|
ent.max_life = malloc(sizeof(*ent.max_life));
|
||||||
|
*ent.max_life = default_life;
|
||||||
|
}
|
||||||
|
if(default_renew){
|
||||||
|
ent.max_renew = malloc(sizeof(*ent.max_renew));
|
||||||
|
*ent.max_renew = default_renew;
|
||||||
|
}
|
||||||
|
ent.created_by.time = time(NULL);
|
||||||
|
krb5_build_principal(context, &ent.created_by.principal,
|
||||||
|
strlen(argv[i]), argv[i],
|
||||||
|
"kadmin",
|
||||||
|
NULL);
|
||||||
|
ent.flags.initial = 1;
|
||||||
|
ent.flags.server = 1;
|
||||||
|
ent.flags.change_pw = 1;
|
||||||
|
db->store(context, db, &ent);
|
||||||
|
hdb_free_entry(context, &ent);
|
||||||
}
|
}
|
||||||
db->close(context, db);
|
db->close(context, db);
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user