diff options
author | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | 7281f9682138be213c08fe4674685b925aef5ead (patch) | |
tree | 8db65324ee035fc0568492b88eec17f660241fd0 /crypto/heimdal/admin/copy.c | |
parent | 869b11442ded05e5e48acc47ea0896d83d8ea198 (diff) | |
parent | 0c8fa354358381b3f1b92598e7f1b46f8cf744cc (diff) | |
download | FreeBSD-src-7281f9682138be213c08fe4674685b925aef5ead.zip FreeBSD-src-7281f9682138be213c08fe4674685b925aef5ead.tar.gz |
This commit was generated by cvs2svn to compensate for changes in r78527,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'crypto/heimdal/admin/copy.c')
-rw-r--r-- | crypto/heimdal/admin/copy.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/crypto/heimdal/admin/copy.c b/crypto/heimdal/admin/copy.c index d2b5069..a446d09 100644 --- a/crypto/heimdal/admin/copy.c +++ b/crypto/heimdal/admin/copy.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -33,7 +33,7 @@ #include "ktutil_locl.h" -RCSID("$Id: copy.c,v 1.5 2000/12/16 00:45:29 joda Exp $"); +RCSID("$Id: copy.c,v 1.7 2001/05/11 00:54:01 assar Exp $"); static krb5_boolean @@ -57,22 +57,25 @@ kt_copy_int (const char *from, const char *to) ret = krb5_kt_resolve (context, from, &src_keytab); if (ret) { krb5_warn (context, ret, "resolving src keytab `%s'", from); - return 0; + return 1; } ret = krb5_kt_resolve (context, to, &dst_keytab); if (ret) { krb5_kt_close (context, src_keytab); krb5_warn (context, ret, "resolving dst keytab `%s'", to); - return 0; + return 1; } ret = krb5_kt_start_seq_get (context, src_keytab, &cursor); if (ret) { krb5_warn (context, ret, "krb5_kt_start_seq_get %s", keytab_string); - goto fail; + goto out; } + if (verbose_flag) + fprintf(stderr, "copying %s to %s\n", from, to); + while((ret = krb5_kt_next_entry(context, src_keytab, &entry, &cursor)) == 0) { char *name_str; @@ -121,7 +124,7 @@ kt_copy_int (const char *from, const char *to) } krb5_kt_end_seq_get (context, src_keytab, &cursor); - fail: + out: krb5_kt_close (context, src_keytab); krb5_kt_close (context, dst_keytab); return 0; @@ -146,12 +149,12 @@ kt_copy (int argc, char **argv) if(getarg(args, num_args, argc, argv, &optind)) { arg_printusage(args, num_args, "ktutil copy", "keytab-src keytab-dest"); - return 0; + return 1; } if (help_flag) { arg_printusage(args, num_args, "ktutil copy", "keytab-src keytab-dest"); - return 0; + return 1; } argv += optind; @@ -160,7 +163,7 @@ kt_copy (int argc, char **argv) if (argc != 2) { arg_printusage(args, num_args, "ktutil copy", "keytab-src keytab-dest"); - return 0; + return 1; } return kt_copy_int(argv[0], argv[1]); @@ -220,7 +223,7 @@ conv(int srvconv, int argc, char **argv) if(keytab_string != NULL) return kt_copy_int(kt4, keytab_string); else { - krb5_kt_default_name(context, kt5, sizeof(kt5)); + krb5_kt_default_modify_name(context, kt5, sizeof(kt5)); return kt_copy_int(kt4, kt5); } } else { |