]> git.pld-linux.org Git - packages/bitlbee.git/commitdiff
- do not leak skyped listening socket to spawned skype process
authorElan Ruusamäe <glen@pld-linux.org>
Sun, 15 Apr 2012 10:55:54 +0000 (10:55 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    bitlbee.spec -> 1.15
    skyped-FD_CLOEXEC.patch -> 1.1

bitlbee.spec
skyped-FD_CLOEXEC.patch [new file with mode: 0644]

index 7821e5ee40fc4933a0998be0dcd166c6b5fb04da..c29bda0c8eb04feb0dd227582b23b9df52378bda 100644 (file)
@@ -9,7 +9,7 @@ Summary:        An IRC to other chat networks gateway
 Summary(pl.UTF-8):     Bramka pomiędzy IRC-em i innymi sieciami komunikacyjnymi
 Name:          bitlbee
 Version:       3.0.5
-Release:       0.13
+Release:       0.16
 License:       GPL v2+ and MIT
 Group:         Daemons
 Source0:       http://get.bitlbee.org/src/%{name}-%{version}.tar.gz
@@ -17,6 +17,7 @@ Source0:      http://get.bitlbee.org/src/%{name}-%{version}.tar.gz
 URL:           http://www.bitlbee.org/
 Patch0:                config.patch
 Patch1:                systemd.patch
+Patch2:                skyped-FD_CLOEXEC.patch
 BuildRequires: asciidoc
 BuildRequires: gnutls-devel
 %{?with_otr:BuildRequires:     libotr-devel >= 3.2.0}
@@ -29,9 +30,9 @@ Requires(pre):        /bin/id
 Requires(pre): /usr/bin/getgid
 Requires(pre): /usr/sbin/groupadd
 Requires(pre): /usr/sbin/useradd
+Requires:      systemd-units >= 37-0.10
 Provides:      group(bitlbee)
 Provides:      user(bitlbee)
-Requires:      systemd-units >= 37-0.10
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -77,6 +78,7 @@ Skype protocol support for bitlbee.
 %setup -q
 %patch0 -p1
 %patch1 -p1
+%patch2 -p1
 
 # fix wrong assumption with $DESTDIR
 %{__sed} -i -e 's,$(shell id -u),0,' Makefile
diff --git a/skyped-FD_CLOEXEC.patch b/skyped-FD_CLOEXEC.patch
new file mode 100644 (file)
index 0000000..2b99416
--- /dev/null
@@ -0,0 +1,32 @@
+set FD_CLOEXEC on listening socket
+
+Skype4Py uses os.execlp() to spawn skype if it is not yet started, this leaks
+our listening FD to skype process and can't get it back even if we ourself exit
+meanwhile.
+
+and we can't startup again:
+error: [Errno 98] Address already in use
+
+Signed-off-by: Elan Ruusamäe <glen@delfi.ee>
+Tested-by: Elan Ruusamäe <glen@delfi.ee>
+--- bitlbee-3.0.5/protocols/skype/skyped.py~   2012-04-15 12:42:34.110550155 +0300
++++ bitlbee-3.0.5/protocols/skype/skyped.py    2012-04-15 13:50:51.089559368 +0300
+@@ -31,6 +31,7 @@
+ import hashlib
+ from ConfigParser import ConfigParser, NoOptionError
+ from traceback import print_exception
++from fcntl import fcntl, F_SETFD, FD_CLOEXEC
+ import ssl
+ __version__ = "0.1.1"
+@@ -184,8 +185,10 @@
+       else:
+               sock = socket.socket()
+       sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
++      fcntl(sock, F_SETFD, FD_CLOEXEC);
+       sock.bind((host, port))
+       sock.listen(1)
++
+       if hasgobject:
+               gobject.io_add_watch(sock, gobject.IO_IN, listener)
+       else:
This page took 0.091707 seconds and 4 git commands to generate.