diff options
author | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-02-13 16:46:19 +0000 |
commit | ebfe6dc471c206300fd82c7c0fd145f683aa52f6 (patch) | |
tree | e66aa570ad1d12c43b32a7313b0f8e28971bf8a9 /crypto/heimdal/admin/get.c | |
parent | e5f617598c2db0dd51906a38ecea9208123a8b70 (diff) | |
download | FreeBSD-src-ebfe6dc471c206300fd82c7c0fd145f683aa52f6.zip FreeBSD-src-ebfe6dc471c206300fd82c7c0fd145f683aa52f6.tar.gz |
import of heimdal 0.3e
Diffstat (limited to 'crypto/heimdal/admin/get.c')
-rw-r--r-- | crypto/heimdal/admin/get.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/crypto/heimdal/admin/get.c b/crypto/heimdal/admin/get.c index 143ffa2..5df72a1 100644 --- a/crypto/heimdal/admin/get.c +++ b/crypto/heimdal/admin/get.c @@ -33,7 +33,7 @@ #include "ktutil_locl.h" -RCSID("$Id: get.c,v 1.15 2000/01/02 04:41:01 assar Exp $"); +RCSID("$Id: get.c,v 1.16 2000/12/31 02:51:43 assar Exp $"); int kt_get(int argc, char **argv) @@ -131,13 +131,26 @@ kt_get(int argc, char **argv) if(ret == 0) created++; else if(ret != KADM5_DUP) { + krb5_warn(context, ret, "kadm5_create_principal(%s)", argv[i]); krb5_free_principal(context, princ_ent); continue; } ret = kadm5_randkey_principal(kadm_handle, princ_ent, &keys, &n_keys); + if (ret) { + krb5_warn(context, ret, "kadm5_randkey_principal(%s)", argv[i]); + krb5_free_principal(context, princ_ent); + continue; + } ret = kadm5_get_principal(kadm_handle, princ_ent, &princ, KADM5_PRINCIPAL | KADM5_KVNO | KADM5_ATTRIBUTES); + if (ret) { + krb5_warn(context, ret, "kadm5_get_principal(%s)", argv[i]); + for (j = 0; j < n_keys; j++) + krb5_free_keyblock_contents(context, &keys[j]); + krb5_free_principal(context, princ_ent); + continue; + } princ.attributes &= (~KRB5_KDB_DISALLOW_ALL_TIX); mask = KADM5_ATTRIBUTES; if(created) { @@ -145,6 +158,13 @@ kt_get(int argc, char **argv) mask |= KADM5_KVNO; } ret = kadm5_modify_principal(kadm_handle, &princ, mask); + if (ret) { + krb5_warn(context, ret, "kadm5_modify_principal(%s)", argv[i]); + for (j = 0; j < n_keys; j++) + krb5_free_keyblock_contents(context, &keys[j]); + krb5_free_principal(context, princ_ent); + continue; + } for(j = 0; j < n_keys; j++) { entry.principal = princ_ent; entry.vno = princ.kvno; |