krb5 commit [krb5-1.13]: Allow logger.c to work with redirected stderr

Tom Yu tlyu at mit.edu
Mon Sep 8 22:39:54 EDT 2014


https://github.com/krb5/krb5/commit/3aa3722bc9a07a5bc77cc09be0346226138ec2f7
commit 3aa3722bc9a07a5bc77cc09be0346226138ec2f7
Author: Tom Yu <tlyu at mit.edu>
Date:   Tue Aug 26 18:18:02 2014 -0400

    Allow logger.c to work with redirected stderr
    
    In lib/kadm5/logger.c:krb5_klog_init(), if the configuration requests
    STDERR logging, call fdopen() using mode "w" instead of "a+", to avoid
    errors when stderr happens to be opened for write only.
    
    (cherry picked from commit a85923073ad2d1f5d0314ab330fd6c5f07749be8)
    
    ticket: 8001
    version_fixed: 1.13
    status: resolved

 src/lib/kadm5/logger.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/lib/kadm5/logger.c b/src/lib/kadm5/logger.c
index 9b99635..19c4355 100644
--- a/src/lib/kadm5/logger.c
+++ b/src/lib/kadm5/logger.c
@@ -594,7 +594,7 @@ krb5_klog_init(krb5_context kcontext, char *ename, char *whoami, krb5_boolean do
                  */
                 else if (!strcasecmp(cp, "STDERR")) {
                     log_control.log_entries[i].lfu_filep =
-                        fdopen(fileno(stderr), "a+");
+                        fdopen(fileno(stderr), "w");
                     if (log_control.log_entries[i].lfu_filep) {
                         log_control.log_entries[i].log_type = K_LOG_STDERR;
                         log_control.log_entries[i].lfu_fname =


More information about the cvs-krb5 mailing list