+Mon Oct 2 15:08:53 1995 Theodore Y. Ts'o <tytso@dcl>
+
+ * logger.c (krb5_klog_init): If the log file can't be opened,
+ print an intelligent error message.
+
Thu Oct 5 12:06:35 1995 Ezra Peisach <epeisach@kangaroo.mit.edu>
* alt_prof.c (krb5_read_realm_params): If secure flag is set in
char savec;
int error;
int do_openlog, log_facility;
+ FILE *f;
/* Initialize */
do_openlog = 0;
/*
* Check for append/overwrite, then open the file.
*/
- if (cp[4] == ':') {
- if (log_control.log_entries[i].lfu_filep =
- fopen(&cp[5], "a+")) {
- log_control.log_entries[i].log_type = K_LOG_FILE;
- log_control.log_entries[i].lfu_fname = &cp[5];
- }
- }
- else if (cp[4] == '=') {
- if (log_control.log_entries[i].lfu_filep =
- fopen(&cp[5], "w")) {
+ if (cp[4] == ':' || cp[4] == '=') {
+ f = fopen(&cp[5], (cp[4] == ':') ? "a+" : "w");
+ if (f) {
+ log_control.log_entries[i].lfu_filep = f;
log_control.log_entries[i].log_type = K_LOG_FILE;
log_control.log_entries[i].lfu_fname = &cp[5];
+ } else {
+ fprintf(stderr,"Couldn't open log file %s: %s\n",
+ &cp[5], error_message(errno));
+ continue;
}
}
}