]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Allow logger.c to work with redirected stderr 196/head
authorTom Yu <tlyu@mit.edu>
Tue, 26 Aug 2014 22:18:02 +0000 (18:18 -0400)
committerTom Yu <tlyu@mit.edu>
Fri, 29 Aug 2014 18:51:54 +0000 (14:51 -0400)
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

index 9b99635fac1d7a510dc3948330ea22130586fd69..19c4355148e21dd667b6885f2d8f0c6e8d70d4fa 100644 (file)
@@ -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 =