Your message dated Fri, 21 Dec 2012 14:47:33 +0000
with message-id <[email protected]>
and subject line Bug#696247: fixed in 9base 1:6-6
has caused the Debian Bug report #696247,
regarding 9base: Sets FD_CLOEXEC incorrectly with F_SETFL instead of F_SETFD
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 [email protected]
immediately.)


-- 
696247: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=696247
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Source: 9base
Version: 6-5
Severity: important
Tags: patch
User: [email protected]
Usertags: fcntl-fd-cloexec

Hi!

This package contains code that tries to set the FD_CLOEXEC flag for a
file descriptor, but it does using F_SETFL instead of F_SETFD.

Using that value on F_SETFL is just wrong, and might make the call fail
on some systems, as it's requesting to set an undetermined flag. For
example on GNU/* FD_CLOEXEC has value 1, which matches with O_WRONLY.

This might cause the code to at least leak file descriptors, and at worst
to terminate execution.

Attached a patch fixing this.

Thanks,
Guillem
From 7a4635f5b7afe6f39d86d36f68304f944cfe2285 Mon Sep 17 00:00:00 2001
From: Guillem Jover <[email protected]>
Date: Tue, 18 Dec 2012 17:25:40 +0100
Subject: [PATCH] 9base: Set FD_CLOEXEC correctly using F_SETFD not F_SETFL

Using that value on F_SETFL is just wrong, and might make the call fail
on some systems, as it's requesting to set an undetermined flag. For
example on GNU/* FD_CLOEXEC has value 1, which matches with O_WRONLY.

This might cause the code to at least leak file descriptors, and at worst
to terminate execution.
---
 lib9/create.c | 2 +-
 lib9/open.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib9/create.c b/lib9/create.c
index e4e3c71..4d9ae10 100644
--- a/lib9/create.c
+++ b/lib9/create.c
@@ -67,7 +67,7 @@ out:
 			}
 		}
 		if(cexec)
-			fcntl(fd, F_SETFL, FD_CLOEXEC);
+			fcntl(fd, F_SETFD, FD_CLOEXEC);
 		if(rclose)
 			remove(path);
 	}
diff --git a/lib9/open.c b/lib9/open.c
index a0573ae..e21a5b4 100644
--- a/lib9/open.c
+++ b/lib9/open.c
@@ -54,7 +54,7 @@ p9open(char *name, int mode)
 			}
 		}
 		if(cexec)
-			fcntl(fd, F_SETFL, FD_CLOEXEC);
+			fcntl(fd, F_SETFD, FD_CLOEXEC);
 		if(rclose)
 			remove(name);
 	}
-- 
1.8.1.rc0


--- End Message ---
--- Begin Message ---
Source: 9base
Source-Version: 1:6-6

We believe that the bug you reported is fixed in the latest version of
9base, which is due to be installed in the Debian FTP archive.

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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Gergely Nagy <[email protected]> (supplier of updated 9base 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 [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Fri, 21 Dec 2012 14:50:06 +0100
Source: 9base
Binary: 9base
Architecture: source amd64
Version: 1:6-6
Distribution: unstable
Urgency: low
Maintainer: Gergely Nagy <[email protected]>
Changed-By: Gergely Nagy <[email protected]>
Description: 
 9base      - Plan 9 userland tools
Closes: 695163 696247
Changes: 
 9base (1:6-6) unstable; urgency=low
 .
   * Add a watch file, thanks to Andy Simpkins <[email protected]>
     (Closes: #695163)
   * Use F_SETFD instead of F_SETFL to set FD_CLOEXEC, patch from Guillem
     Jover <[email protected]> (Closes: #696247)
   * Based on work by Sergey Romanov <[email protected]>:
     + Move troff data to /usr/share/9base/troff.
     + Various man page tweaks
     + Move to debhelper compat level 9.
Checksums-Sha1: 
 26aa630d79ecfcae8c617b628bb23403ee92ec52 1781 9base_6-6.dsc
 e2cd16ed41083d466529fb6ad5b85dde85e144e0 13239 9base_6-6.debian.tar.gz
 655df23a2940035fbad29d3666f870d6691692d2 1865522 9base_6-6_amd64.deb
Checksums-Sha256: 
 d66403575b9d27a43af7485edfe26c2dc37858a2db0988a0fc0ac30c695aeae4 1781 
9base_6-6.dsc
 9d8b0bcc4463732eb9a9db4606a791bf7657fc4ad72c6635c13b228136d0a0fd 13239 
9base_6-6.debian.tar.gz
 7f31218459ee18f18b091d1947bc955bf387860987743f172a7bd77cec3f3d45 1865522 
9base_6-6_amd64.deb
Files: 
 5dea8a4d0e98fb1596e69f689d4a9dfb 1781 utils optional 9base_6-6.dsc
 5f44797c713826bd0063e7a9136c2de5 13239 utils optional 9base_6-6.debian.tar.gz
 3fdb70ae0abab76107c7a338d11a66e2 1865522 utils optional 9base_6-6_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iQIcBAEBAgAGBQJQ1HAPAAoJEKwekLrEM/aP3kAQALEWzqSOzM1eCL+GIDv/DYJg
mrlbtSkm7OV28OSOSYpaooTSyBWiZDtU36R/XvKLuBnlHEuLC4YOi+GTi8ytgA5/
sfGm/sZkvU9kJQ9Y8lxrxOOqIa/Lnc/01+4DZlgOcCuwr5J/MyNVTkr82NetMTfk
5pf7qgHHQpmOc63frpVY/P0/IsJzKyLxxEz8MZ5lzvBL1Qwpa5HW5XI5AnMLLihB
aYpfLlD9Z2St5FCviPccHF6zKKYTTT4eQC5G2s/K2iNnNM3fP83cK8Izpbw0tmI6
sL0jmqXWPOSJ1jCPp90NTkjuFnK9U8Ia3vsi+0YooMhUhLmGE4Va4CpUEThi1qwY
9ZsEaLLtKklUQTUd/z8Ao42hfjglRaZkEWqxDXAwbJBmrZSRo7LD+2k9Kp8ht77b
teMNHKmfWo25f/Dhvoya8BZbwTOKwDleVfbT0c7doQ8E/8dBmHIHT7l/DKHAxpcy
s/A0FGlibi1z82vG/km9OOPPKrJAW4whXtvydxkeGDpisu83ALBXMMSpnmxqZ8rS
X56082y47cLSanjU9cTVn8QklOeksU5p4z4w5o2Zek395v0EB5VgKYCfdhk2XOuO
4DHq2qNdeSDhSHSi/5tMg47AxhA7h1W1FreletXqdAIAhpiKwq1e1t5W7U7/jsi6
fOBDC1Z9jrUbXLhhVMKX
=+o9g
-----END PGP SIGNATURE-----

--- End Message ---

Reply via email to