krb5 commit: Allow logger.c to work with redirected stderr

Tom Yu tlyu at mit.edu
Fri Aug 29 15:03:14 EDT 2014


https://github.com/krb5/krb5/commit/a85923073ad2d1f5d0314ab330fd6c5f07749be8
commit a85923073ad2d1f5d0314ab330fd6c5f07749be8
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.
    
    ticket: 8001 (new)
    target_version: 1.13
    tags: pullup

 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