+Wed Nov 6 11:32:36 1996 Theodore Ts'o <tytso@rsts-11.mit.edu>
+
+ * login.c (destroy_tickets): Just use global kcontext instead
+ of creating a new krb5 context for no good reason.
+
+ * krshd.c (main):
+ * krsh.c (main):
+ * krlogind.c (main):
+ * krlogin.c (main):
+ * krcp.c(main): Check the error return from krb5_init_context(),
+ and print an error message if necessary.
+
Fri Nov 1 23:11:21 1996 Sam Hartman <hartmans@planet-zorp.MIT.EDU>
* login.c: print out system error if -1 returns.
int euid;
char **orig_argv = save_argv(argc, argv);
- krb5_init_context(&bsd_context);
- krb5_init_ets(bsd_context);
+ status = krb5_init_context(&bsd_context);
+ if (status) {
+ com_err(argv[0], status, "while initializing krb5");
+ exit(1);
+ }
desinbuf.data = des_inbuf;
desoutbuf.data = des_outbuf; /* Set up des buffers */
#endif
exit(1);
}
#ifdef KERBEROS
- krb5_init_context(&bsd_context);
- krb5_init_ets(bsd_context);
+ status = krb5_init_context(&bsd_context);
+ if (status) {
+ com_err(argv[0], status, "while initializing krb5");
+ exit(1);
+ }
desinbuf.data = des_inbuf;
desoutbuf.data = des_outpkt+4; /* Set up des buffers */
#endif
#define LOG_NDELAY 0
#endif
-#ifdef KERBEROS
- krb5_init_context(&bsd_context);
- krb5_init_ets(bsd_context);
-#endif
-
#ifndef LOG_AUTH /* 4.2 syslog */
openlog(progname, LOG_PID | LOG_NDELAY);
#else
openlog(progname, LOG_PID | LOG_NDELAY, LOG_AUTH);
#endif /* 4.2 syslog */
+#ifdef KERBEROS
+ status = krb5_init_context(&bsd_context);
+ if (status) {
+ syslog(LOG_ERR, "Error initializing krb5: %s",
+ error_message(status));
+ exit(1);
+ }
+#endif
+
/* Analyse parameters. */
opterr = 0;
while ((ch = getopt(argc, argv, ARGSTR)) != EOF)
}
#ifdef KERBEROS
- krb5_init_context(&bsd_context);
- krb5_init_ets(bsd_context);
+ status = krb5_init_context(&bsd_context);
+ if (status) {
+ com_err(argv[0], status, "while initializing krb5");
+ exit(1);
+ }
authopts = AP_OPTS_MUTUAL_REQUIRED;
/* Piggy-back forwarding flags on top of authopts; */
#endif /* 4.2 syslog */
#ifdef KERBEROS
- krb5_init_context(&bsd_context);
- krb5_init_ets(bsd_context);
+ status = krb5_init_context(&bsd_context);
+ if (status) {
+ syslog(LOG_ERR, "Error initializing krb5: %s",
+ error_message(status));
+ exit(1);
+ }
#endif
-
/* Analyze parameters. */
opterr = 0;
while ((ch = getopt(argc, argv, ARGSTR)) != EOF)
void k_init (ttyn)
char *ttyn;
{
- krb5_init_context(&kcontext);
- krb5_init_ets(kcontext);
-krb5_secure_config_files (kcontext);
+ krb5_error_code retval;
+
+ retval = krb5_init_context(&kcontext);
+ if (retval) {
+ com_err("login", retval, "while initializing krb5");
+ exit(1);
+ }
+ krb5_secure_config_files (kcontext);
login_get_kconf(kcontext);
/* Set up the credential cache environment variable */
{
krb5_context c;
krb5_ccache cache;
+ krb5_error_code retval;
+#ifdef KRB5_GET_TICKETS
if (login_krb5_get_tickets) {
- krb5_init_context(&c);
- krb5_secure_config_files (c);
- if(!krb5_cc_default(c, &cache))
- krb5_cc_destroy (c, cache);
+ if(!krb5_cc_default(kcontext, &cache))
+ krb5_cc_destroy (kcontext, cache);
}
+#endif
#ifdef KRB4_GET_TICKETS
if (login_krb4_get_tickets||login_krb4_convert)
dest_tkt();