[expect] Fix leaked fd
vcrhonek
vcrhonek at fedoraproject.org
Tue Sep 9 11:28:21 UTC 2014
commit 10986c4d799deb615d2c02049f13b4e84730ac13
Author: Vitezslav Crhonek <vcrhonek at redhat.com>
Date: Tue Sep 9 13:28:10 2014 +0200
Fix leaked fd
expect-5.45-fd-leak.patch | 12 ++++++++++++
expect.spec | 9 ++++++++-
2 files changed, 20 insertions(+), 1 deletions(-)
---
diff --git a/expect-5.45-fd-leak.patch b/expect-5.45-fd-leak.patch
new file mode 100644
index 0000000..459a1f6
--- /dev/null
+++ b/expect-5.45-fd-leak.patch
@@ -0,0 +1,12 @@
+diff -up expect5.45/exp_clib.c.orig expect5.45/exp_clib.c
+--- expect5.45/exp_command.c.orig 2014-09-04 12:12:21.075837835 +0200
++++ expect5.45/exp_command.c 2014-09-04 12:13:39.098593465 +0200
+@@ -1161,7 +1161,7 @@ Exp_SpawnObjCmd(
+ /* if stty finds dev(stderr) != dev(stdout) */
+
+ /* save error fd while we're setting up new one */
+- errorfd = fcntl(2,F_DUPFD,3);
++ errorfd = fcntl(2,F_DUPFD_CLOEXEC,3);
+ /* and here is the macro to restore it */
+ #define restore_error_fd {close(2);fcntl(errorfd,F_DUPFD,2);}
+
diff --git a/expect.spec b/expect.spec
index 347d7b0..8ce234a 100644
--- a/expect.spec
+++ b/expect.spec
@@ -5,7 +5,7 @@
Summary: A program-script interaction and testing utility
Name: expect
Version: %{majorver}
-Release: 17%{?dist}
+Release: 18%{?dist}
License: Public Domain
Group: Development/Languages
# URL: probably more useful is http://sourceforge.net/projects/expect/
@@ -28,6 +28,8 @@ Patch5: expect-5.45-exp-log-buf-overflow.patch
# Patch6: fixes segfaults if Tcl is built with stubs and Expect is used directly
# from C program rhbz#1091060
Patch6: expect-5.45-segfault-with-stubs.patch
+# Patch7: fixes leaked fd, patch by Matej Mužila, rhbz#1001220
+Patch7: expect-5.45-fd-leak.patch
# examples patches
# Patch100: changes random function
Patch100: expect-5.32.2-random.patch
@@ -88,6 +90,7 @@ of expectk.
%patch4 -p1 -b .re-memleak
%patch5 -p1 -b .exp-log-buf-overflow
%patch6 -p1 -b .segfault-with-stubs
+%patch7 -p1 -b .fd-leak
# examples fixes
%patch100 -p1 -b .random
%patch101 -p1 -b .mkpasswd-dash
@@ -177,6 +180,10 @@ rm -rf "$RPM_BUILD_ROOT"
%{_mandir}/man1/tknewsbiff.1*
%changelog
+* Tue Sep 09 2014 Vitezslav Crhonek <vcrhonek at redhat.com> - 5.45-18
+- Fix leaked fd (patch by Matej Mužila)
+ Resolves: #1001220
+
* Sat Aug 16 2014 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 5.45-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
More information about the scm-commits
mailing list