svn commit: lorikeet r367 - in trunk/heimdal/kadmin: .
abartlet at samba.org
abartlet at samba.org
Mon Jul 4 23:14:50 GMT 2005
Author: abartlet
Date: 2005-07-04 23:14:49 +0000 (Mon, 04 Jul 2005)
New Revision: 367
WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=lorikeet&rev=367
Log:
The entry is disabled all the time, but fixed passwords give me the willies.
Just use a random one, just for the heck of it.
Andrew Bartlett
Modified:
trunk/heimdal/kadmin/init.c
Changeset:
Modified: trunk/heimdal/kadmin/init.c
===================================================================
--- trunk/heimdal/kadmin/init.c 2005-07-04 14:59:48 UTC (rev 366)
+++ trunk/heimdal/kadmin/init.c 2005-07-04 23:14:49 UTC (rev 367)
@@ -50,6 +50,11 @@
int n_keys, i;
char *name;
+ const char *password;
+ char pwbuf[1024];
+ random_password (pwbuf, sizeof(pwbuf));
+ password = pwbuf;
+
ret = krb5_unparse_name(context, princ, &name);
if (ret) {
krb5_warn(context, ret, "failed to unparse principal name");
@@ -70,12 +75,15 @@
ent.attributes |= attributes | KRB5_KDB_DISALLOW_ALL_TIX;
mask |= KADM5_ATTRIBUTES;
- ret = kadm5_create_principal(kadm_handle, &ent, mask, "hemlig");
+ /* Create the entry with a random password */
+ ret = kadm5_create_principal(kadm_handle, &ent, mask, password);
if(ret) {
krb5_warn(context, ret, "create_random_entry(%s): randkey failed",
name);
goto out;
}
+
+ /* Replace the string2key based keys with real random bytes */
ret = kadm5_randkey_principal(kadm_handle, princ, &keys, &n_keys);
if(ret) {
krb5_warn(context, ret, "create_random_entry*%s): randkey failed",
More information about the samba-cvs
mailing list