From f1e4923da5e1754e7d333d99e0fef49690db6d25 Mon Sep 17 00:00:00 2001
From: Vitezslav Crhonek <vcrhonek@redhat.com>
Date: Wed, 27 Jun 2018 11:05:54 +0200
Subject: [PATCH] Fix wrong log file permissions

---
 expect-5.43.0-log_file.patch | 18 +++++++++---------
 expect.spec                  |  5 ++++-
 2 files changed, 13 insertions(+), 10 deletions(-)

diff --git a/expect-5.43.0-log_file.patch b/expect-5.43.0-log_file.patch
index 8a2c93d..521a7ab 100644
--- a/expect-5.43.0-log_file.patch
+++ b/expect-5.43.0-log_file.patch
@@ -1,12 +1,12 @@
-diff -up expect-5.44.1.15/exp_log.c.orig expect-5.44.1.15/exp_log.c
---- expect-5.44.1.15/exp_log.c.orig	2010-03-08 15:45:20.581378309 +0100
-+++ expect-5.44.1.15/exp_log.c	2010-03-08 15:45:38.838398279 +0100
-@@ -374,7 +374,7 @@ expDiagChannelOpen(interp,filename)
- 	Tcl_DStringAppend(&tsdPtr->diagFilename,filename,-1);
+diff -up expect5.45.4/exp_log.c.orig expect5.45.4/exp_log.c
+--- expect5.45.4/exp_log.c.orig	2018-02-02 20:15:52.000000000 +0100
++++ expect5.45.4/exp_log.c	2018-06-27 10:46:53.065655463 +0200
+@@ -499,7 +499,7 @@ expLogChannelOpen(interp,filename,append
+ 	Tcl_DStringAppend(&tsdPtr->logFilename,filename,-1);
      }
  
--    tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0777);
-+    tsdPtr->diagChannel = Tcl_OpenFileChannel(interp,newfilename,"a",0666);
-     if (!tsdPtr->diagChannel) {
- 	Tcl_DStringFree(&tsdPtr->diagFilename);
+-    tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0777);
++    tsdPtr->logChannel = Tcl_OpenFileChannel(interp,newfilename,mode,0666);
+     if (!tsdPtr->logChannel) {
+ 	Tcl_DStringFree(&tsdPtr->logFilename);
  	return TCL_ERROR;
diff --git a/expect.spec b/expect.spec
index 0d0d420..8faecf4 100644
--- a/expect.spec
+++ b/expect.spec
@@ -5,7 +5,7 @@
 Summary: A program-script interaction and testing utility
 Name: expect
 Version: %{majorver}
-Release: 3%{?dist}
+Release: 4%{?dist}
 License: Public Domain
 URL: https://core.tcl.tk/expect/index
 Source: http://downloads.sourceforge.net/%{name}/%{name}%{version}.tar.gz
@@ -174,6 +174,9 @@ chrpath --delete $RPM_BUILD_ROOT%{_libdir}/libexpect%{version}.so
 %{_mandir}/man1/tknewsbiff.1*
 
 %changelog
+* Wed Jun 27 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 5.45.4-4
+- Fix wrong log file permissions
+
 * Wed Jun 20 2018 Vitezslav Crhonek <vcrhonek@redhat.com> - 5.45.4-3
 - Fix upstream URL