(main): handle krb5_init_context failure consistently
git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@9443 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -190,7 +190,9 @@ main(int argc, char **argv)
|
||||
exit(0);
|
||||
}
|
||||
|
||||
krb5_init_context(&context);
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret)
|
||||
errx (1, "krb5_init_context failed: %d", ret);
|
||||
if(!k_hasafs())
|
||||
krb5_errx(context, 1,
|
||||
"AFS doesn't seem to be present on this machine");
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1997 - 1999 Kungliga Tekniska H<>gskolan
|
||||
* Copyright (c) 1997 - 2000 Kungliga Tekniska H<>gskolan
|
||||
* (Royal Institute of Technology, Stockholm, Sweden).
|
||||
* All rights reserved.
|
||||
*
|
||||
@@ -75,7 +75,7 @@ client_setup(krb5_context *context, int *argc, char **argv)
|
||||
|
||||
status = krb5_init_context (context);
|
||||
if (status)
|
||||
errx(1, "krb5_init_context failed: %u", status);
|
||||
errx(1, "krb5_init_context failed: %d", status);
|
||||
|
||||
forwardable = krb5_config_get_bool (*context, NULL,
|
||||
"libdefaults",
|
||||
|
@@ -659,7 +659,13 @@ main(int argc, char **argv)
|
||||
set_progname(argv[0]);
|
||||
|
||||
#ifdef KRB5
|
||||
krb5_init_context(&context);
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret)
|
||||
errx (1, "krb5_init_context failed: %d", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
openlog("login", LOG_ODELAY, LOG_AUTH);
|
||||
|
@@ -717,7 +717,13 @@ main(int argc, char **argv)
|
||||
set_progname (argv[0]);
|
||||
|
||||
#ifdef KRB5
|
||||
krb5_init_context (&context);
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
||||
ret = krb5_init_context (&context);
|
||||
if (ret)
|
||||
errx (1, "krb5_init_context failed: %d", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (getarg (args, sizeof(args) / sizeof(args[0]), argc, argv,
|
||||
|
@@ -845,7 +845,7 @@ main(int argc, char **argv)
|
||||
|
||||
status = krb5_init_context (&context);
|
||||
if (status)
|
||||
errx(1, "krb5_init_context failed: %u", status);
|
||||
errx(1, "krb5_init_context failed: %d", status);
|
||||
|
||||
if (getarg (args, sizeof(args) / sizeof(args[0]), argc, argv,
|
||||
&optind))
|
||||
|
@@ -871,7 +871,13 @@ main(int argc, char **argv)
|
||||
}
|
||||
|
||||
#ifdef KRB5
|
||||
krb5_init_context (&context);
|
||||
{
|
||||
krb5_error_code ret;
|
||||
|
||||
ret = krb5_init_context (&context);
|
||||
if (ret)
|
||||
errx (1, "krb5_init_context failed: %d", ret);
|
||||
}
|
||||
#endif
|
||||
|
||||
if(port_str) {
|
||||
|
@@ -985,8 +985,12 @@ main (int argc, char **argv)
|
||||
#endif
|
||||
#ifdef KRB5
|
||||
{
|
||||
krb5_error_code ret;
|
||||
char *str;
|
||||
krb5_init_context(&context);
|
||||
|
||||
ret = krb5_init_context(&context);
|
||||
if (ret)
|
||||
errx (1, "krb5_init_context failed: %d", ret);
|
||||
krb5_get_default_principal(context, &client);
|
||||
krb5_unparse_name(context, client, &str);
|
||||
snprintf(userprompt, sizeof(userprompt), "User: %s", str);
|
||||
|
Reference in New Issue
Block a user