copyright and fprintf-format changes from 1.1
authorKen Raeburn <raeburn@mit.edu>
Fri, 24 Sep 1999 21:13:01 +0000 (21:13 +0000)
committerKen Raeburn <raeburn@mit.edu>
Fri, 24 Sep 1999 21:13:01 +0000 (21:13 +0000)
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@11852 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/kadm5/ChangeLog
src/lib/kadm5/logger.c

index 9c1aba73fd47382e6a4f1d3f472e1001113c7c88..d7c4b36e9c08fa898d9d67a2f0ec5f289dca5330 100644 (file)
@@ -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
index 2677e448dfe2b499c162fbaa786d4e4d7bc7fb3d..36f16a156332b65d21b488ce1980eb5adbf51466 100644 (file)
  * 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;