summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>1999-09-24 21:13:01 +0000
committerKen Raeburn <raeburn@mit.edu>1999-09-24 21:13:01 +0000
commit27d50659bd97f25b2cac637dfbf2b50aabb6d4ac (patch)
tree343c28855923390b8c032de93a7f1e308573c154 /src
parent69009a38bf14d35433c6301f289c96790ae6e34d (diff)
downloadkrb5-27d50659bd97f25b2cac637dfbf2b50aabb6d4ac.tar.gz
krb5-27d50659bd97f25b2cac637dfbf2b50aabb6d4ac.tar.xz
krb5-27d50659bd97f25b2cac637dfbf2b50aabb6d4ac.zip
copyright and fprintf-format changes from 1.1
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11852 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src')
-rw-r--r--src/lib/kadm5/ChangeLog7
-rw-r--r--src/lib/kadm5/logger.c19
2 files changed, 17 insertions, 9 deletions
diff --git a/src/lib/kadm5/ChangeLog b/src/lib/kadm5/ChangeLog
index 9c1aba73fd..d7c4b36e9c 100644
--- a/src/lib/kadm5/ChangeLog
+++ b/src/lib/kadm5/ChangeLog
@@ -1,3 +1,10 @@
+1999-09-23 Ken Raeburn <raeburn@mit.edu>
+
+ * logger.c (DEVICE_PRINT, klog_com_err_proc, klog_vsyslog): Use
+ proper format strings to fprintf, instead of net-supplied data.
+ Fold in writes of following end-of-line sequences when
+ appropriate.
+
1998-11-13 Theodore Ts'o <tytso@rsts-11.mit.edu>
* Makefile.in: Set the myfulldir and mydir variables (which are
diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c
index 2677e448df..36f16a1563 100644
--- a/src/lib/kadm5/logger.c
+++ b/src/lib/kadm5/logger.c
@@ -16,7 +16,10 @@
* this permission notice appear in supporting documentation, and that
* the name of M.I.T. not be used in advertising or publicity pertaining
* to distribution of the software without specific, written prior
- * permission. M.I.T. makes no representations about the suitability of
+ * permission. Furthermore if you modify this software you must label
+ * your software as modified software and not distribute it in such a
+ * fashion that it might be confused with the original M.I.T. software.
+ * M.I.T. makes no representations about the suitability of
* this software for any purpose. It is provided "as is" without express
* or implied warranty.
*
@@ -160,8 +163,8 @@ static struct log_entry def_log_entry;
*/
#define DEVICE_OPEN(d, m) fopen(d, m)
#define CONSOLE_OPEN(m) fopen("/dev/console", m)
-#define DEVICE_PRINT(f, m) ((fprintf(f, m) >= 0) ? \
- (fprintf(f, "\r\n"), fflush(f), 0) : \
+#define DEVICE_PRINT(f, m) ((fprintf(f, "%s\r\n", m) >= 0) ? \
+ (fflush(f), 0) : \
-1)
#define DEVICE_CLOSE(d) fclose(d)
@@ -277,14 +280,13 @@ klog_com_err_proc(whoami, code, format, ap)
/*
* Files/standard error.
*/
- if (fprintf(log_control.log_entries[lindex].lfu_filep,
+ if (fprintf(log_control.log_entries[lindex].lfu_filep, "%s\n",
outbuf) < 0) {
/* Attempt to report error */
fprintf(stderr, log_file_err, whoami,
log_control.log_entries[lindex].lfu_fname);
}
else {
- fprintf(log_control.log_entries[lindex].lfu_filep, "\n");
fflush(log_control.log_entries[lindex].lfu_filep);
}
break;
@@ -879,14 +881,13 @@ klog_vsyslog(priority, format, arglist)
/*
* Files/standard error.
*/
- if (fprintf(log_control.log_entries[lindex].lfu_filep,
+ if (fprintf(log_control.log_entries[lindex].lfu_filep, "%s\n",
outbuf) < 0) {
/* Attempt to report error */
- fprintf(stderr, log_file_err,
+ fprintf(stderr, log_file_err, log_control.log_whoami,
log_control.log_entries[lindex].lfu_fname);
}
else {
- fprintf(log_control.log_entries[lindex].lfu_filep, "\n");
fflush(log_control.log_entries[lindex].lfu_filep);
}
break;
@@ -898,7 +899,7 @@ klog_vsyslog(priority, format, arglist)
if (DEVICE_PRINT(log_control.log_entries[lindex].ldu_filep,
outbuf) < 0) {
/* Attempt to report error */
- fprintf(stderr, log_device_err,
+ fprintf(stderr, log_device_err, log_control.log_whoami,
log_control.log_entries[lindex].ldu_devname);
}
break;