Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/crypto/dist/heimdal/lib/krb5 Catch krb5_init_context() failure.



details:   https://anonhg.NetBSD.org/src/rev/edba7e15c0e3
branches:  trunk
changeset: 495793:edba7e15c0e3
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Sun Aug 06 17:59:15 2000 +0000

description:
Catch krb5_init_context() failure.

diffstat:

 crypto/dist/heimdal/lib/krb5/prog_setup.c |  11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diffs (34 lines):

diff -r 334b5c9b926b -r edba7e15c0e3 crypto/dist/heimdal/lib/krb5/prog_setup.c
--- a/crypto/dist/heimdal/lib/krb5/prog_setup.c Sun Aug 06 17:58:53 2000 +0000
+++ b/crypto/dist/heimdal/lib/krb5/prog_setup.c Sun Aug 06 17:59:15 2000 +0000
@@ -34,7 +34,7 @@
 #include "krb5_locl.h"
 #include <getarg.h>
 
-RCSID("$Id: prog_setup.c,v 1.1.1.2 2000/08/02 19:59:37 assar Exp $");
+RCSID("$Id: prog_setup.c,v 1.2 2000/08/06 17:59:15 thorpej Exp $");
 
 void
 krb5_std_usage(int code, struct getargs *args, int num_args)
@@ -48,13 +48,20 @@
                   struct getargs *args, int num_args, 
                   void (*usage)(int, struct getargs*, int))
 {
+    krb5_error_code err;
     int optind = 0;
 
     if(usage == NULL)
        usage = krb5_std_usage;
 
     set_progname(argv[0]);
-    krb5_init_context(context);
+    err = krb5_init_context(context);
+    if (err != 0) {
+       fprintf(stderr,
+         "krb5_program_setup: error %d while trying to init context\n", err);
+       exit (1);
+    }
+           
     
     if(getarg(args, num_args, argc, argv, &optind))
        (*usage)(1, args, num_args);



Home | Main Index | Thread Index | Old Index