Your message dated Thu, 23 Apr 2009 16:17:09 +0000 with message-id <E1Lx1bp-00087R-2q@ries.debian.org> and subject line Bug#512657: fixed in bogl 0.1.18-3 has caused the Debian Bug report #512657, regarding bogl: mark internal-use file descriptors close-on-exec to be marked as done. This means that you claim that the problem has been dealt with. If this is not the case it is now your responsibility to reopen the Bug report if necessary, and/or fix the problem forthwith. (NB: If you are a system administrator and have no idea what this message is talking about, this may indicate a serious mail system misconfiguration somewhere. Please contact owner@bugs.debian.org immediately.) -- 512657: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=512657 Debian Bug Tracking System Contact owner@bugs.debian.org with problems
--- Begin Message ---
- To: submit@bugs.debian.org
- Subject: bogl: mark internal-use file descriptors close-on-exec
- From: Colin Watson <cjwatson@ubuntu.com>
- Date: Thu, 22 Jan 2009 16:17:47 +0000
- Message-id: <20090122161747.GG7442@riva.ucam.org>
Package: bogl Version: 0.1.18-2 Severity: wishlist Tags: patch User: ubuntu-devel@lists.ubuntu.com Usertags: origin-ubuntu ubuntu-patch jaunty bterm leaks several of the file descriptors it uses internally to its child process. This is messy and could potentially lead to some interesting bugs. How does the attached patch look, which marks internal file descriptors as close-on-exec? I think I've hit the right set of fds here. Thanks, -- Colin Watson [cjwatson@ubuntu.com]* Set many internal file descriptors close-on-exec, to avoid leaking them to the program called by bterm. diff -Nru bogl-0.1.18/bogl-bgf.c bogl-0.1.18/bogl-bgf.c --- bogl-0.1.18/bogl-bgf.c 2001-12-01 17:04:42.000000000 +0000 +++ bogl-0.1.18/bogl-bgf.c 2009-01-22 13:38:58.000000000 +0000 @@ -20,6 +20,9 @@ if (fd == -1) return 0; + if (bogl_cloexec(fd) < 0) + return 0; + if (fstat(fd, &buf)) return 0; diff -Nru bogl-0.1.18/bogl.c bogl-0.1.18/bogl.c --- bogl-0.1.18/bogl.c 2006-10-20 21:11:19.000000000 +0100 +++ bogl-0.1.18/bogl.c 2009-01-22 13:40:39.000000000 +0000 @@ -124,12 +124,16 @@ fb = open ("/dev/fb/0", O_RDWR); if (fb < 0) return bogl_fail ("opening /dev/fb0: %s", strerror (errno)); + if (bogl_cloexec (fb) < 0) + return bogl_fail ("setting /dev/fb0 close-on-exec: %s", strerror (errno)); tty = open ("/dev/tty0", O_RDWR); if (tty < 0) tty = open ("/dev/vc/0", O_RDWR); if (tty < 0) return bogl_fail ("opening /dev/tty0: %s", strerror (errno)); + if (bogl_cloexec (tty) < 0) + return bogl_fail ("setting /dev/tty0 close-on-exec: %s", strerror (errno)); if (-1 == ioctl (tty, VT_GETSTATE, &vts)) return bogl_fail ("can't get VT state: %s", strerror (errno)); @@ -630,3 +634,19 @@ return 0; } + +/* Set a file descriptor to close-on-exec. */ +int +bogl_cloexec(int fd) +{ + int flags; + + flags = fcntl (fd, F_GETFD); + if (flags < 0) + return flags; + + if (fcntl (fd, F_SETFD, flags | FD_CLOEXEC) < 0) + return -1; + + return 0; +} diff -Nru bogl-0.1.18/boglP.h bogl-0.1.18/boglP.h --- bogl-0.1.18/boglP.h 2001-12-01 17:04:42.000000000 +0000 +++ bogl-0.1.18/boglP.h 2009-01-22 13:38:26.000000000 +0000 @@ -25,4 +25,6 @@ int bogl_fail (const char *, ...); +int bogl_cloexec (int fd); + #endif /* boglP_h */ diff -Nru bogl-0.1.18/boml.c bogl-0.1.18/boml.c --- bogl-0.1.18/boml.c 2005-09-21 18:15:33.000000000 +0100 +++ bogl-0.1.18/boml.c 2009-01-22 13:43:23.000000000 +0000 @@ -614,6 +614,10 @@ fd = open ("/dev/gpmdata", O_RDONLY | O_NONBLOCK); if (fd < 0) return 0; + if (bogl_cloexec (fd) < 0) { + close (fd); + return 0; + } /* Poll the mouse whether or not we could find gpm, in case it starts up later; but keep searching in that case. */ @@ -640,6 +644,10 @@ fd = open("/dev/input/mice", O_RDONLY | O_NONBLOCK); if(fd < 0) return; + if (bogl_cloexec(fd) < 0) { + close(fd); + return; + } add_mouse(T_PS2, fd); } @@ -659,6 +667,10 @@ fd = open ("/dev/psaux", O_RDWR | O_NONBLOCK); if (fd < 0) return; + if (bogl_cloexec (fd) < 0) { + close (fd); + return; + } write (fd, s2, sizeof s2); usleep (30000); @@ -695,6 +707,10 @@ int fd = open ("/dev/inportbm", O_RDONLY | O_NONBLOCK); if (fd < 0) return; + if (bogl_cloexec (fd) < 0) { + close (fd); + return; + } add_mouse (T_MS_BUS, fd); } @@ -707,6 +723,10 @@ int fd = open ("/dev/adbmouse", O_RDONLY | O_NONBLOCK); if (fd < 0) return; + if (bogl_cloexec (fd) < 0) { + close (fd); + return; + } add_mouse (T_ADB, fd); } @@ -721,6 +741,10 @@ int fd = open ("/dev/sunmouse", O_RDONLY | O_NONBLOCK); if (fd < 0) return; + if (bogl_cloexec (fd) < 0) { + close (fd); + return; + } add_mouse (T_SUN, fd); } @@ -978,6 +1002,11 @@ fd = open (port, O_RDWR | O_NONBLOCK); if (fd < 0) return fd; + if (bogl_cloexec (fd) < 0) + { + close (fd); + return -1; + } /* Reset file so it is no longer in non-blocking mode. */ if (fcntl (fd, F_SETFL, 0) < 0)
--- End Message ---
--- Begin Message ---
- To: 512657-close@bugs.debian.org
- Subject: Bug#512657: fixed in bogl 0.1.18-3
- From: Barry deFreese <bdefreese@debian.org>
- Date: Thu, 23 Apr 2009 16:17:09 +0000
- Message-id: <E1Lx1bp-00087R-2q@ries.debian.org>
Source: bogl Source-Version: 0.1.18-3 We believe that the bug you reported is fixed in the latest version of bogl, which is due to be installed in the Debian FTP archive: bogl-bterm-udeb_0.1.18-3_i386.udeb to pool/main/b/bogl/bogl-bterm-udeb_0.1.18-3_i386.udeb bogl-bterm_0.1.18-3_i386.deb to pool/main/b/bogl/bogl-bterm_0.1.18-3_i386.deb bogl_0.1.18-3.dsc to pool/main/b/bogl/bogl_0.1.18-3.dsc bogl_0.1.18-3.tar.gz to pool/main/b/bogl/bogl_0.1.18-3.tar.gz libbogl-dev_0.1.18-3_i386.deb to pool/main/b/bogl/libbogl-dev_0.1.18-3_i386.deb libbogl0_0.1.18-3_i386.deb to pool/main/b/bogl/libbogl0_0.1.18-3_i386.deb A summary of the changes between this version and the previous one is attached. Thank you for reporting the bug, which will now be closed. If you have further comments please address them to 512657@bugs.debian.org, and the maintainer will reopen the bug report if appropriate. Debian distribution maintenance software pp. Barry deFreese <bdefreese@debian.org> (supplier of updated bogl package) (This message was generated automatically at their request; if you believe that there is a problem with it please contact the archive administrators by mailing ftpmaster@debian.org) -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Format: 1.8 Date: Thu, 23 Apr 2009 11:41:11 -0400 Source: bogl Binary: libbogl-dev libbogl0 bogl-bterm bogl-bterm-udeb Architecture: source i386 Version: 0.1.18-3 Distribution: unstable Urgency: low Maintainer: Debian QA Group <packages@qa.debian.org> Changed-By: Barry deFreese <bdefreese@debian.org> Description: bogl-bterm - Ben's Own Graphics Library - graphical terminal bogl-bterm-udeb - Ben's Own Graphics Library - graphical terminal libbogl-dev - Ben's Own Graphics Library - development files libbogl0 - Ben's Own Graphics Library - shared library Closes: 279984 329164 486933 512657 Changes: bogl (0.1.18-3) unstable; urgency=low . * QA upload. * Close-on-exec internal fds. (Closes: #512657). + Thanks to Colin Watson for the patch. * Support enter_bold_mode. (Closes: #486933). + Thanks to Samuel Thibault for the patch. * Make SIGCHLD handler more robust. (Closes: #329164). + Thanks to Miloslav Trmac for the patch. * Display combined chars. (Closes: #279984). + Thanks to Eugeniy Meshcheryakov for the patch. * Make clean not ignore errors. * Replace pwd with $(CURDIR) in rules. * Replace ${Source-Version} with ${binary:Version} in Depends. * Add ${misc:Depends} for debhelper package. * Add appropriate copyright holders to debian/copyright. * Bump debhelper build-dep 5. + Move DH_COMPAT from rules to debian/compat and set to 5. * Bump Standards Version to 3.8.1. Checksums-Sha1: 6888e25ae47390fef7dfd10ac2eea378d3ccd4f9 798 bogl_0.1.18-3.dsc 161cba53ff607ff2411143a32d1efae83c7c7887 101650 bogl_0.1.18-3.tar.gz 9dfa847d872aa312addc5167de26d85667aa88b0 85178 libbogl-dev_0.1.18-3_i386.deb a79ea2a3d3ce74d0f3383a9dd409b6d5519099dc 52026 libbogl0_0.1.18-3_i386.deb e46336310e7219b1ad8b981967b4fe41c33866ba 27514 bogl-bterm_0.1.18-3_i386.deb 5b3c1665e93ba56a68aca2776e2a3c51bdbe3339 21832 bogl-bterm-udeb_0.1.18-3_i386.udeb Checksums-Sha256: 34b06b5f8b2a9339661ea7e0d3b4b41cf248d08354be1db3adff225d99847de9 798 bogl_0.1.18-3.dsc 0d02da3e367ee408e2b827f66e2bebe6020f71d0206b6eb40df2d3672caea707 101650 bogl_0.1.18-3.tar.gz b2d2738eabf37b29d62a3bbfa0fee86ed93c1ebddb8b8d3d313a3ea4780ad9d2 85178 libbogl-dev_0.1.18-3_i386.deb 9490c941d14f4e9ad1186d99091b0fd9cb2c4ccc3a6f54a96899cfd188dae266 52026 libbogl0_0.1.18-3_i386.deb 0e8e80438a95bc26424e02fc18451cc8b271da51f1d545ce8f5450b2c22bb420 27514 bogl-bterm_0.1.18-3_i386.deb 0e91837e3ac951d4bbef8945f86cd36d0cd3a43f505a818fc33ed63182d68bbb 21832 bogl-bterm-udeb_0.1.18-3_i386.udeb Files: 5ae6a35aaba91a74d9eedd24661d6e06 798 devel optional bogl_0.1.18-3.dsc a5882ef0ba6d92d41221eee9c07e0fb8 101650 devel optional bogl_0.1.18-3.tar.gz 7887bf60a59546f77b55848216d4d2b0 85178 libdevel optional libbogl-dev_0.1.18-3_i386.deb f93c0b4c5cdf1325dac4e181fb9f0341 52026 libs optional libbogl0_0.1.18-3_i386.deb f1f8423ef14204d0d6057ba844672e4a 27514 utils optional bogl-bterm_0.1.18-3_i386.deb c9cb638bf344be500c7b5d9d490665de 21832 debian-installer extra bogl-bterm-udeb_0.1.18-3_i386.udeb -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) iEYEARECAAYFAknwkkUACgkQ5ItltUs5T365bgCdHSCbOswLL0vZU0O9JlzvpnU2 RnEAoM9N2apiFgg9aRqwkapSfgzCIqrQ =E/mT -----END PGP SIGNATURE-----
--- End Message ---