Debian Bug report logs - #679198
bash: [on native FreeBSD] unable to set FD_CLOEXEC flag

version graph

Package: bash; Maintainer for bash is Matthias Klose <doko@debian.org>; Source for bash is src:bash.

Reported by: Stefan Ott <stefan@ott.net>

Date: Wed, 27 Jun 2012 01:15:02 UTC

Severity: serious

Tags: patch

Merged with 683271

Found in version bash/4.2-4

Fixed in versions bash/4.2-5.1, bash/4.2-4wheezy0.1

Done: Nicolas Boulenguez <nicolas@debian.org>

Bug is archived. No further changes may be made.

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, stefan@ott.net, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 27 Jun 2012 01:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Ott <stefan@ott.net>:
New Bug report received and forwarded. Copy sent to stefan@ott.net, Matthias Klose <doko@debian.org>. (Wed, 27 Jun 2012 01:15:05 GMT) Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Stefan Ott <stefan@ott.net>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: bash: Fails to upgrade in kFreeBSD jails
Date: Wed, 27 Jun 2012 03:12:28 +0200
Package: bash
Version: 4.2-2
Severity: important

Hello,

I am running Debian GNU/kFreeBSD inside FreeBSD 9 jails. When I tried to
upgrade from squeeze to wheezy I got the following error:


Extracting templates from packages: 100%
Preconfiguring packages ...
(Reading database ... 11090 files and directories currently installed.)
Preparing to replace bash 4.1-3 (using .../bash_4.2-2_kfreebsd-amd64.deb) ...
bash.preinst: cannot set close-on-exec flag: Inappropriate ioctl for device
dpkg: error processing /var/cache/apt/archives/bash_4.2-2_kfreebsd-amd64.deb (--unpack):
 subprocess new pre-installation script returned error exit status 1
configured to not write apport reports
                                      update-alternatives: using /usr/share/man/man7/bash-builtins.7.gz to provide /usr/share/man/man7/builtins.7.gz (builtins.7.gz) in auto mode.
Errors were encountered while processing:
 /var/cache/apt/archives/bash_4.2-2_kfreebsd-amd64.deb


I think this might be related to my root file system for the jail being ZFS
but I have to admit that I'm no expert on that. At any rate, is does make it
rather difficult for me to upgrade the package (as in, from what I know I
will have to manually edit the .deb and remove the preinst file) and it would
be nice if this could be fixed.

Let me know if you need access to such a jail in order to reproduce this,
I am sure that can be arranged.


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: kfreebsd-amd64 (x86_64)

Kernel: kFreeBSD 9.0-RELEASE-p3
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
Shell: /bin/sh linked to /bin/dash

Versions of packages bash depends on:
ii  base-files   6.9
ii  dash         0.5.7-3
ii  debianutils  4.3.1
ii  libc0.1      2.13-33
ii  libncurses5  5.7+20100313-5

Versions of packages bash recommends:
ii  bash-completion  1:1.99-3

Versions of packages bash suggests:
pn  bash-doc  <none>

-- Configuration Files:
/etc/bash.bashrc changed [not included]

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 27 Jun 2012 01:33:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Wed, 27 Jun 2012 01:33:02 GMT) Full text and rfc822 format available.

Message #10 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: debian-bsd@lists.debian.org
Cc: Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Tue, 26 Jun 2012 20:29:56 -0500
Hi debian-bsd@,

Stefan Ott wrote:

> Package: bash
> Version: 4.2-2
[...]
> I am running Debian GNU/kFreeBSD inside FreeBSD 9 jails. When I tried to
> upgrade from squeeze to wheezy I got the following error:
> 
> Extracting templates from packages: 100%
> Preconfiguring packages ...
> (Reading database ... 11090 files and directories currently installed.)
> Preparing to replace bash 4.1-3 (using .../bash_4.2-2_kfreebsd-amd64.deb) ...
> bash.preinst: cannot set close-on-exec flag: Inappropriate ioctl for device
[...]
> I think this might be related to my root file system for the jail being ZFS
> but I have to admit that I'm no expert on that. At any rate, is does make it
> rather difficult for me to upgrade the package (as in, from what I know I
> will have to manually edit the .deb and remove the preinst file) and it would
> be nice if this could be fixed.
>
> Let me know if you need access to such a jail in order to reproduce this,
> I am sure that can be arranged.

Thought you might be interested in this report, since it feels like a
libc or kernel bug.  Hints?

Thanks,
Jonathan

> -- System Information:
> Debian Release: wheezy/sid
>   APT prefers testing
>   APT policy: (500, 'testing')
> Architecture: kfreebsd-amd64 (x86_64)
>
> Kernel: kFreeBSD 9.0-RELEASE-p3
> Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
> Shell: /bin/sh linked to /bin/dash
>
> Versions of packages bash depends on:
> ii  base-files   6.9
> ii  dash         0.5.7-3
> ii  debianutils  4.3.1
> ii  libc0.1      2.13-33
> ii  libncurses5  5.7+20100313-5
>
> Versions of packages bash recommends:
> ii  bash-completion  1:1.99-3
>
> Versions of packages bash suggests:
> pn  bash-doc  <none>
>
> -- Configuration Files:
> /etc/bash.bashrc changed [not included]




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 27 Jun 2012 02:03:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Wed, 27 Jun 2012 02:03:03 GMT) Full text and rfc822 format available.

Message #15 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: debian-bsd@lists.debian.org
Cc: Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Tue, 26 Jun 2012 20:59:52 -0500
Jonathan Nieder wrote:
> Stefan Ott wrote:

>> bash.preinst: cannot set close-on-exec flag: Inappropriate ioctl for device
[...]
> Thought you might be interested in this report, since it feels like a
> libc or kernel bug.  Hints?

Of course I should give more context than that. :)

That message comes from set_cloexec(), which is defined as follows:

	void set_cloexec(int fd)
	{
		int flags = fcntl(fd, F_GETFL);
		if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
			die_errno("cannot set close-on-exec flag");
	}

It is called on /dev/null and the two file descriptors returned from
pipe() to avoid leaking file descriptors.

Presumably this should be a warning instead of a fatal error or the
set_cloexec() calls could be dropped altogether.  But why is fcntl()
failing?

Thanks,
Jonathan

diff --git i/debian/bash.preinst-lib.c w/debian/bash.preinst-lib.c
index bb13a166..701a5874 100644
--- i/debian/bash.preinst-lib.c
+++ w/debian/bash.preinst-lib.c
@@ -58,19 +58,10 @@ int exists(const char *file)
 	die_errno("cannot get status of %s", file);
 }
 
-void set_cloexec(int fd)
-{
-	int flags = fcntl(fd, F_GETFL);
-	if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
-		die_errno("cannot set close-on-exec flag");
-}
-
 void xpipe(int pipefd[2])
 {
 	if (pipe(pipefd))
 		die_errno("cannot create pipe");
-	set_cloexec(pipefd[0]);
-	set_cloexec(pipefd[1]);
 }
 
 void wait_or_die(pid_t child, const char *name, int flags)
diff --git i/debian/bash.preinst.c w/debian/bash.preinst.c
index 14baeab0..2badd2ae 100644
--- i/debian/bash.preinst.c
+++ w/debian/bash.preinst.c
@@ -85,8 +85,6 @@ static int binsh_in_filelist(const char *package)
 	 * fails, no problem; leave stderr alone in that case.
 	 */
 	sink = open("/dev/null", O_WRONLY);
-	if (sink >= 0)
-		set_cloexec(sink);
 	in = spawn_pipe(&child, cmd, sink);
 
 	/* ... | grep "^/bin/sh\$" */
diff --git i/debian/bash.preinst.h w/debian/bash.preinst.h
index 82faf497..4d4a5abb 100644
--- i/debian/bash.preinst.h
+++ w/debian/bash.preinst.h
@@ -26,7 +26,6 @@ extern NORETURN PRINTFLIKE void die_errno(const char *fmt, ...);
 extern NORETURN PRINTFLIKE void die(const char *fmt, ...);
 
 extern int exists(const char *path);
-extern void set_cloexec(int fd);
 extern void xpipe(int pipefd[2]);
 
 extern void wait_or_die(pid_t child, const char *desc, int flags);
diff --git i/debian/changelog w/debian/changelog
index 310ec061..40dcb4c5 100644
--- i/debian/changelog
+++ w/debian/changelog
@@ -1,3 +1,11 @@
+bash (4.2-2.1) local; urgency=low
+
+  * bash.preinst: Let a few file descriptors leak instead of setting
+    the close-on-exec flag. This avoids some portability gotchas.
+    Closes: #679198.
+
+ -- Jonathan Nieder <jrnieder@gmail.com>  Tue, 26 Jun 2012 20:55:36 -0500
+
 bash (4.2-2) unstable; urgency=low
 
   * Fix command-not-found location. Closes: #529313.




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Fri, 29 Jun 2012 01:39:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Fri, 29 Jun 2012 01:39:05 GMT) Full text and rfc822 format available.

Message #20 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: debian-bsd@lists.debian.org, Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Fri, 29 Jun 2012 02:37:29 +0100
Hi,

Hmmm, I can't seem to reproduce the problem here, in a kfreebsd-i386
jail environment on a GNU/kFreeBSD (9.0) host.  I had bash 4.2-2 already
installed though.

I'm trying "apt-get --reinstall install bash" or directly running
/var/lib/dpkg/info/bash.preinst

Here's a system call trace:

 72202 bash.preinst CALL  open(0x8049678,0x1<><invalid>1,<unused>0)
 72202 bash.preinst NAMI  "/dev/null"
 72202 bash.preinst RET   open 3
 72202 bash.preinst CALL  fcntl(0x3,<invalid=3>,0x8149)
 72202 bash.preinst RET   fcntl 1
 72202 bash.preinst CALL  fcntl(0x3,<invalid=4>,0x1<><invalid>1)
 72202 bash.preinst RET   fcntl 0

Successfully opened /dev/null as fd 0x3.  I assume that is fcntl()
F_GETFL returning flags = 0x1 (which actually means FD_CLOEXEC was
already set), then F_SETFL returning 0 = success.

 72202 bash.preinst CALL  pipe
 72202 bash.preinst RET   pipe 4
 72202 bash.preinst CALL  fcntl(0x4,<invalid=3>,0x1)
 72202 bash.preinst RET   fcntl 2
 72202 bash.preinst CALL  fcntl(0x4,<invalid=4>,0x3<><invalid>3)
 72202 bash.preinst RET   fcntl 0
 72202 bash.preinst CALL  fcntl(0x5,<invalid=3>,0x28066d20)
 72202 bash.preinst RET   fcntl 2
 72202 bash.preinst CALL  fcntl(0x5,<invalid=4>,0x3<><invalid>3)
 72202 bash.preinst RET   fcntl 0

And successful in setting FD_CLOEXEC there on the pipe descriptors 0x4
and 0x5.


If this problem can still be reproduced, a ktrace[1] may be helpful, and
maybe the output from /proc/mounts and of course "ls -al /dev/null"

I don't have my jail in ZFS, but I guess devfs should be mounted at
/path/to/jail/dev anyway, or else /dev/null could be missing, and get
created as a regular file (which I also tried, and still couldn't
reproduce this failure).

[1]
http://wiki.debian.org/Debian_GNU/kFreeBSD_FAQ#Q._How_do_I_trace_system_calls.3F

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Fri, 29 Jun 2012 02:21:11 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Ott <stefan@ott.net>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Fri, 29 Jun 2012 02:21:11 GMT) Full text and rfc822 format available.

Message #25 received at 679198@bugs.debian.org (full text, mbox):

From: Stefan Ott <stefan@ott.net>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: Jonathan Nieder <jrnieder@gmail.com>, debian-bsd@lists.debian.org, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Fri, 29 Jun 2012 04:19:15 +0200
Hey

On Fri, Jun 29, 2012 at 3:37 AM, Steven Chamberlain <steven@pyro.eu.org> wrote:
> Hi,
>
> Hmmm, I can't seem to reproduce the problem here, in a kfreebsd-i386
> jail environment on a GNU/kFreeBSD (9.0) host.  I had bash 4.2-2 already
> installed though.

I suppose that narrows it down a little. I'm more and more inclined to
blame ZFS.

> If this problem can still be reproduced, a ktrace[1] may be helpful

Here we go:

 74149 ktrace   RET   ktrace 0
 74149 ktrace   CALL  execve(0x7fffffffdd57,0x7fffffffdaf0,0x7fffffffdb00)
 74149 ktrace   NAMI  "./preinst"
 74149 ktrace   NAMI  "/lib/ld-kfreebsd-x86-64.so.1"
 74149 preinst  RET   execve 0
 74149 preinst  CALL  getuid
 74149 preinst  RET   getuid 0
 74149 preinst  CALL  geteuid
 74149 preinst  RET   geteuid 0
 74149 preinst  CALL  getgid
 74149 preinst  RET   getgid 0
 74149 preinst  CALL  getegid
 74149 preinst  RET   getegid 0
 74149 preinst  CALL  break(0x800823000)
 74149 preinst  RET   break -1 errno 12 Cannot allocate memory
 74149 preinst  CALL
__sysctl(0x7fffffffd8a0,0x2,0x7fffffffd8ac,0x7fffffffd898,0,0)
 74149 preinst  SCTL  "kern.osreldate"
 74149 preinst  RET   __sysctl 0
 74149 preinst  CALL  getuid
 74149 preinst  RET   getuid 0
 74149 preinst  CALL  access(0x80061b58b,0<F_OK>)
 74149 preinst  NAMI  "/etc/ld.so.nohwcap"
 74149 preinst  RET   access -1 errno 2 No such file or directory
 74149 preinst  CALL
mmap(0,0x2000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_ANON|MAP_TYPE|MAP_PRIVATE>,0xffffffff,0)
 74149 preinst  RET   mmap 34366164992/0x800621000
 74149 preinst  CALL  getuid
 74149 preinst  RET   getuid 0
 74149 preinst  CALL  access(0x80061dd00,0x4<R_OK>)
 74149 preinst  NAMI  "/etc/ld.so.preload"
 74149 preinst  RET   access -1 errno 2 No such file or directory
 74149 preinst  CALL  open(0x80061b527,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/etc/ld.so.cache"
 74149 preinst  RET   open 3
 74149 preinst  CALL  fstat(0x3,0x7fffffffd0b0)
 74149 preinst  STRU  invalid record
 74149 preinst  RET   fstat 0
 74149 preinst  CALL  mmap(0,0x212b,0x1<PROT_READ>,0x2<MAP_PRIVATE>,0x3,0)
 74149 preinst  RET   mmap 34366173184/0x800623000
 74149 preinst  CALL  close(0x3)
 74149 preinst  RET   close 0
 74149 preinst  CALL  getuid
 74149 preinst  RET   getuid 0
 74149 preinst  CALL  access(0x80061b58b,0<F_OK>)
 74149 preinst  NAMI  "/etc/ld.so.nohwcap"
 74149 preinst  RET   access -1 errno 2 No such file or directory
 74149 preinst  CALL  open(0x7fffffffd0d0,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/tls/x86_64/libc.so.0.1"
 74149 preinst  RET   open -1 errno 2 No such file or directory
 74149 preinst  CALL  stat(0x7fffffffd0d0,0x7fffffffd040)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/tls/x86_64"
 74149 preinst  RET   stat -1 errno 2 No such file or directory
 74149 preinst  CALL  open(0x7fffffffd0d0,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/tls/libc.so.0.1"
 74149 preinst  RET   open -1 errno 2 No such file or directory
 74149 preinst  CALL  stat(0x7fffffffd0d0,0x7fffffffd040)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/tls"
 74149 preinst  RET   stat -1 errno 2 No such file or directory
 74149 preinst  CALL  open(0x7fffffffd0d0,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/x86_64/libc.so.0.1"
 74149 preinst  RET   open -1 errno 2 No such file or directory
 74149 preinst  CALL  stat(0x7fffffffd0d0,0x7fffffffd040)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/x86_64"
 74149 preinst  RET   stat -1 errno 2 No such file or directory
 74149 preinst  CALL  open(0x7fffffffd0d0,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/lib/x86_64-kfreebsd-gnu/libc.so.0.1"
 74149 preinst  RET   open 3
 74149 preinst  CALL  read(0x3,0x7fffffffd2f8,0x340)
 74149 preinst  GIO   fd 3 read 832 bytes
       0x0000 7f45 4c46 0201 0109 0000 0000 0000 0000  |.ELF............|
       0x0010 0300 3e00 0100 0000 40f4 0100 0000 0000  |..>.....@.......|
       0x0020 4000 0000 0000 0000 2043 1400 0000 0000  |@....... C......|
       0x0030 0000 0000 4000 3800 0a00 4000 2400 2300  |....@.8...@.$.#.|
       0x0040 0600 0000 0500 0000 4000 0000 0000 0000  |........@.......|
       0x0050 4000 0000 0000 0000 4000 0000 0000 0000  |@.......@.......|
       0x0060 3002 0000 0000 0000 3002 0000 0000 0000  |0.......0.......|
       0x0070 0800 0000 0000 0000 0300 0000 0400 0000  |................|
       0x0080 a016 1200 0000 0000 a016 1200 0000 0000  |................|
       0x0090 a016 1200 0000 0000 1d00 0000 0000 0000  |................|
       0x00a0 1d00 0000 0000 0000 1000 0000 0000 0000  |................|
       0x00b0 0100 0000 0500 0000 0000 0000 0000 0000  |................|
       0x00c0 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x00d0 48f3 1300 0000 0000 48f3 1300 0000 0000  |H.......H.......|
       0x00e0 0000 2000 0000 0000 0100 0000 0600 0000  |.. .............|
       0x00f0 38f4 1300 0000 0000 38f4 3300 0000 0000  |8.......8.3.....|
       0x0100 38f4 3300 0000 0000 404d 0000 0000 0000  |8.3.....@M......|
       0x0110 5099 0000 0000 0000 0000 2000 0000 0000  |P......... .....|
       0x0120 0200 0000 0600 0000 002b 1400 0000 0000  |.........+......|
       0x0130 002b 3400 0000 0000 002b 3400 0000 0000  |.+4......+4.....|
       0x0140 e001 0000 0000 0000 e001 0000 0000 0000  |................|
       0x0150 0800 0000 0000 0000 0400 0000 0400 0000  |................|
       0x0160 7002 0000 0000 0000 7002 0000 0000 0000  |p.......p.......|
       0x0170 7002 0000 0000 0000 4400 0000 0000 0000  |p.......D.......|
       0x0180 4400 0000 0000 0000 0400 0000 0000 0000  |D...............|
       0x0190 0700 0000 0400 0000 38f4 1300 0000 0000  |........8.......|
       0x01a0 38f4 3300 0000 0000 38f4 3300 0000 0000  |8.3.....8.3.....|
       0x01b0 1000 0000 0000 0000 6800 0000 0000 0000  |........h.......|
       0x01c0 0800 0000 0000 0000 50e5 7464 0400 0000  |........P.td....|
       0x01d0 c016 1200 0000 0000 c016 1200 0000 0000  |................|
       0x01e0 c016 1200 0000 0000 3457 0000 0000 0000  |........4W......|
       0x01f0 3457 0000 0000 0000 0400 0000 0000 0000  |4W..............|
       0x0200 51e5 7464 0600 0000 0000 0000 0000 0000  |Q.td............|
       0x0210 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0220 0000 0000 0000 0000 0000 0000 0000 0000  |................|
       0x0230 0800 0000 0000 0000 52e5 7464 0400 0000  |........R.td....|
       0x0240 38f4 1300 0000 0000 38f4 3300 0000 0000  |8.......8.3.....|
       0x0250 38f4 3300 0000 0000 c83b 0000 0000 0000  |8.3......;......|
       0x0260 c83b 0000 0000 0000 0100 0000 0000 0000  |.;..............|
       0x0270 0400 0000 1400 0000 0300 0000 474e 5500  |............GNU.|
       0x0280 de8b c1f3 7beb ac75 7d7f 2633 9cff 4dd3  |....{..u}.&3..M.|
       0x0290 4ca1 c980 0400 0000 1000 0000 0100 0000  |L...............|
       0x02a0 474e 5500 0300 0000 0800 0000 0100 0000  |GNU.............|
       0x02b0 0000 0000 0000 0000 f303 0000 1500 0000  |................|
       0x02c0 0001 0000 0e00 0000 0030 1044 a000 0201  |.........0.D....|
       0x02d0 8803 e690 c545 8c00 c000 0800 0580 0060  |.....E.........`|
       0x02e0 c080 000d 8e0c 0014 3400 8844 3208 2e40  |........4..D2..@|
       0x02f0 8a50 342c 200e 2248 2684 c08c 0408 0002  |.P4, ."H&.......|
       0x0300 020e a1ac 1a04 66c0 00c0 3200 c000 5001  |......f...2...P.|
       0x0310 0081 089c 0a28 2028 2400 0420 5000 1058  |.....( ($.. P..X|
       0x0320 80ca 4442 2800 0680 1018 4200 2040 8000  |..DB(.....B. @..|
       0x0330 09d0 0851 8a40 1500 0000 0008 0000 1110  |...Q.@..........|
 74149 preinst  RET   read 832/0x340
 74149 preinst  CALL  fstat(0x3,0x7fffffffd040)
 74149 preinst  STRU  invalid record
 74149 preinst  RET   fstat 0
 74149 preinst  CALL
mmap(0,0x348d88,0x5<PROT_READ|PROT_EXEC>,0x2<MAP_PRIVATE>,0x3,0)
 74149 preinst  RET   mmap 34368270336/0x800823000
 74149 preinst  CALL  mprotect(0x800963000,0x1ff000,0<PROT_NONE>)
 74149 preinst  RET   mprotect 0
 74149 preinst  CALL
__sysctl(0x7fffffffce50,0x2,0x8008220e8,0x7fffffffce48,0,0)
 74149 preinst  SCTL  "hw.pagesize"
 74149 preinst  RET   __sysctl 0
 74149 preinst  CALL
mmap(0x800b62000,0x6000,0x3<PROT_READ|PROT_WRITE>,0x12<MAP_PRIVATE|MAP_FIXED>,0x3,0x13f000)
 74149 preinst  RET   mmap 34371674112/0x800b62000
 74149 preinst  CALL
mmap(0x800b68000,0x3d88,0x3<PROT_READ|PROT_WRITE>,0x1012<MAP_ANON|MAP_TYPE|MAP_PRIVATE|MAP_FIXED>,0xffffffff,0)
 74149 preinst  RET   mmap 34371698688/0x800b68000
 74149 preinst  CALL  close(0x3)
 74149 preinst  RET   close 0
 74149 preinst  CALL
mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_ANON|MAP_TYPE|MAP_PRIVATE>,0xffffffff,0)
 74149 preinst  RET   mmap 34366185472/0x800626000
 74149 preinst  CALL
mmap(0,0x1000,0x3<PROT_READ|PROT_WRITE>,0x1002<MAP_ANON|MAP_TYPE|MAP_PRIVATE>,0xffffffff,0)
 74149 preinst  RET   mmap 34366189568/0x800627000
 74149 preinst  CALL  sysarch(0x81,0x7fffffffd8a8)
 74149 preinst  RET   sysarch 0
 74149 preinst  CALL  open(0x80061b0b0,0<><invalid>0,<unused>0)
 74149 preinst  NAMI  "/dev/urandom"
 74149 preinst  RET   open 3
 74149 preinst  CALL  read(0x3,0x7fffffffd898,0x8)
 74149 preinst  GIO   fd 3 read 8 bytes
       0x0000 f799 7052 87d2 fd5a                      |..pR...Z|

 74149 preinst  RET   read 8
 74149 preinst  CALL  close(0x3)
 74149 preinst  RET   close 0
 74149 preinst  CALL  mprotect(0x800b62000,0x4000,0x1<PROT_READ>)
 74149 preinst  RET   mprotect 0
 74149 preinst  CALL  mprotect(0x602000,0x1000,0x1<PROT_READ>)
 74149 preinst  RET   mprotect 0
 74149 preinst  CALL  mprotect(0x800820000,0x1000,0x1<PROT_READ>)
 74149 preinst  RET   mprotect 0
 74149 preinst  CALL  sigaction(SIGSYS,0x7fffffffda10,0)
 74149 preinst  RET   sigaction 0
 74149 preinst  CALL  getuid
 74149 preinst  RET   getuid 0
 74149 preinst  CALL  access(0x401a8e,0x1<X_OK>)
 74149 preinst  NAMI  "/bin/sh"
 74149 preinst  RET   access 0
 74149 preinst  CALL  stat(0x401a8e,0x7fffffffd8c0)
 74149 preinst  NAMI  "/bin/sh"
 74149 preinst  STRU  invalid record
 74149 preinst  RET   stat 0
 74149 preinst  CALL  open(0x401ae4,0x1<><invalid>1,<unused>0)
 74149 preinst  NAMI  "/dev/null"
 74149 preinst  RET   open 3
 74149 preinst  CALL  fcntl(0x3,<invalid=3>,0)
 74149 preinst  RET   fcntl 1
 74149 preinst  CALL  fcntl(0x3,<invalid=4>,0x1<><invalid>1)
 74149 preinst  RET   fcntl -1 errno 25 Inappropriate ioctl for device
 74149 preinst  CALL  write(0x2,0x401b81,0xe)
 74149 preinst  GIO   fd 2 wrote 14 bytes
       "bash.preinst: "
 74149 preinst  RET   write 14/0xe
 74149 preinst  CALL  write(0x2,0x7fffffffb0b0,0x1d)
 74149 preinst  GIO   fd 2 wrote 29 bytes
       "cannot set close-on-exec flag"
 74149 preinst  RET   write 29/0x1d
 74149 preinst  CALL  write(0x2,0x7fffffffaff0,0x20)
 74149 preinst  GIO   fd 2 wrote 32 bytes
       ": Inappropriate ioctl for device"
 74149 preinst  RET   write 32/0x20
 74149 preinst  CALL  write(0x2,0x800b66c43,0x1)
 74149 preinst  GIO   fd 2 wrote 1 byte
       "
       "
 74149 preinst  RET   write 1
 74149 preinst  CALL  exit(0x1)

> and maybe the output from /proc/mounts

/dev/mirror/gm0s1a / ufs rw 0 0
devfs /dev devfs rw 0 0
/dev/mirror/gm0s1e /tmp ufs rw 0 0
/dev/mirror/gm0s1f /usr ufs rw 0 0
/dev/mirror/gm0s1d /var ufs rw 0 0
tank /tank zfs rw 0 0
tank/db-mysql /tank/db-mysql zfs rw 0 0
tank/db-postgres /tank/db-postgres zfs rw 0 0
tank/dns /tank/dns zfs rw 0 0
tank/ldap /tank/ldap zfs rw 0 0
tank/mail /tank/mail zfs rw 0 0
tank/mumble /tank/mumble zfs rw 0 0
tank/obj /tank/obj zfs rw 0 0
tank/skel /tank/skel zfs rw 0 0
tank/src /tank/src zfs rw 0 0
tank/syslog /tank/syslog zfs rw 0 0
tank/www-dispatch /tank/www-dispatch zfs rw 0 0
tank/www-php-misc /tank/www-php-misc zfs rw 0 0
tank/www-static /tank/www-static zfs rw 0 0
devfs /tank/dns/dev devfs rw 0 0
devfs /tank/ldap/dev devfs rw 0 0
devfs /tank/syslog/dev devfs rw 0 0
devfs /tank/mail/dev devfs rw 0 0
devfs /tank/db-mysql/dev devfs rw 0 0
devfs /tank/mumble/dev devfs rw 0 0
devfs /tank/www-dispatch/dev devfs rw 0 0
devfs /tank/www-static/dev devfs rw 0 0
devfs /tank/www-php-misc/dev devfs rw 0 0
proc /tank/mumble/proc proc rw 0 0
/sys /tank/mumble/sys sysfs rw 0 0
tmpfs /tank/mumble/lib/init/rw tmpfs rw 0 0
proc /tank/dns/proc proc rw 0 0
/sys /tank/dns/sys sysfs rw 0 0
tmpfs /tank/dns/lib/init/rw tmpfs rw 0 0
proc /tank/mail/proc proc rw 0 0
/sys /tank/mail/sys sysfs rw 0 0
tmpfs /tank/mail/lib/init/rw tmpfs rw 0 0
proc /tank/db-mysql/proc proc rw 0 0
/sys /tank/db-mysql/sys sysfs rw 0 0
tmpfs /tank/db-mysql/lib/init/rw tmpfs rw 0 0
proc /tank/db-postgres/proc proc rw 0 0
/sys /tank/db-postgres/sys sysfs rw 0 0
tmpfs /tank/db-postgres/lib/init/rw tmpfs rw 0 0
proc /tank/www-dispatch/proc proc rw 0 0
/sys /tank/www-dispatch/sys sysfs rw 0 0
tmpfs /tank/www-dispatch/lib/init/rw tmpfs rw 0 0
proc /tank/www-static/proc proc rw 0 0
/sys /tank/www-static/sys sysfs rw 0 0
tmpfs /tank/www-static/lib/init/rw tmpfs rw 0 0
proc /tank/www-php-misc/proc proc rw 0 0
/sys /tank/www-php-misc/sys sysfs rw 0 0
tmpfs /tank/www-php-misc/lib/init/rw tmpfs rw 0 0
devfs /tank/db-postgres/dev devfs rw 0 0

This is somewhat strange, I didn't expect my jail to see ALL the mounts.

> and of course "ls -al /dev/null"

crw-rw-rw- 1 root root 0, 19 Jun 29 04:11 /dev/null

> I don't have my jail in ZFS, but I guess devfs should be mounted at
> /path/to/jail/dev anyway, or else /dev/null could be missing, and get
> created as a regular file (which I also tried, and still couldn't
> reproduce this failure).

Yup, that's mounted.

cheers
-- 
Stefan Ott
http://www.ott.net/

"You are not Grey Squirrel?"




Added blocking bug(s) of 679198: 635192 Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 12:42:59 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Fri, 29 Jun 2012 12:43:08 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Fri, 29 Jun 2012 12:43:11 GMT) Full text and rfc822 format available.

Message #32 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Stefan Ott <stefan@ott.net>
Cc: Jonathan Nieder <jrnieder@gmail.com>, debian-bsd@lists.debian.org, 679198@bugs.debian.org
Subject: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 12:41:05 +0100
reassign 679198 src:kfreebsd-9
affects 679198 src:bash
retitle 679198 bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
thanks

On 29/06/12 03:19, Stefan Ott wrote:
> I suppose that narrows it down a little. I'm more and more inclined to
> blame ZFS.

But /dev/null itself is on a devfs so I doubt it could have any effect.

>  74149 preinst  CALL  open(0x401ae4,0x1<><invalid>1,<unused>0)
>  74149 preinst  NAMI  "/dev/null"
>  74149 preinst  RET   open 3
>  74149 preinst  CALL  fcntl(0x3,<invalid=3>,0)
>  74149 preinst  RET   fcntl 1
>  74149 preinst  CALL  fcntl(0x3,<invalid=4>,0x1<><invalid>1)
>  74149 preinst  RET   fcntl -1 errno 25 Inappropriate ioctl for device

There is a crucial difference;  in my ktrace (with GNU/kFreeBSD host)
the file was opened with the FD_CLOEXEC flag set already.  Not sure how
that happens, but I guess something different in how our kernel is built.

In the above (with upstream FreeBSD as host) it was not, and trying to
enable it failed.  From reading http://bugs.debian.org/635192 it sounds
like that might be a limitation of our glibc.

Implementing it could be a problem for the 8.1 kernel of squeeze and as
used on our buildds, and so I don't think it could be properly fixed
until wheezy+1, at least.

A workaround in bash might have been justified, but AFAIK this problem
is specific to GNU/kFreeBSD chroot/jails on native FreeBSD hosts.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Bug reassigned from package 'bash' to 'src:kfreebsd-9'. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 12:43:21 GMT) Full text and rfc822 format available.

No longer marked as found in versions bash/4.2-2. Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 12:43:21 GMT) Full text and rfc822 format available.

Added indication that 679198 affects src:bash Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 12:43:22 GMT) Full text and rfc822 format available.

Changed Bug title to 'bash: [on native FreeBSD] unable to set FD_CLOEXEC flag' from 'bash: Fails to upgrade in kFreeBSD jails' Request was from Steven Chamberlain <steven@pyro.eu.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 12:43:23 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#679198; Package src:kfreebsd-9. (Fri, 29 Jun 2012 13:15:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Stefan Ott <stefan@ott.net>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Fri, 29 Jun 2012 13:15:08 GMT) Full text and rfc822 format available.

Message #45 received at 679198@bugs.debian.org (full text, mbox):

From: Stefan Ott <stefan@ott.net>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: Jonathan Nieder <jrnieder@gmail.com>, debian-bsd@lists.debian.org, 679198@bugs.debian.org
Subject: Re: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 15:12:10 +0200
On Fri, Jun 29, 2012 at 1:41 PM, Steven Chamberlain <steven@pyro.eu.org> wrote:
> reassign 679198 src:kfreebsd-9
> affects 679198 src:bash
> retitle 679198 bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
> thanks
>
> On 29/06/12 03:19, Stefan Ott wrote:
>> I suppose that narrows it down a little. I'm more and more inclined to
>> blame ZFS.
>
> But /dev/null itself is on a devfs so I doubt it could have any effect.

Ha, good point, I guess it's too hot for me to think properly atm.

>>  74149 preinst  CALL  open(0x401ae4,0x1<><invalid>1,<unused>0)
>>  74149 preinst  NAMI  "/dev/null"
>>  74149 preinst  RET   open 3
>>  74149 preinst  CALL  fcntl(0x3,<invalid=3>,0)
>>  74149 preinst  RET   fcntl 1
>>  74149 preinst  CALL  fcntl(0x3,<invalid=4>,0x1<><invalid>1)
>>  74149 preinst  RET   fcntl -1 errno 25 Inappropriate ioctl for device
>
> There is a crucial difference;  in my ktrace (with GNU/kFreeBSD host)
> the file was opened with the FD_CLOEXEC flag set already.  Not sure how
> that happens, but I guess something different in how our kernel is built.

Interesting. If you have a ideas / patches that I could try out I
would be happy to.

> In the above (with upstream FreeBSD as host) it was not, and trying to
> enable it failed.  From reading http://bugs.debian.org/635192 it sounds
> like that might be a limitation of our glibc.

Ah indeed, that does look related.

> Implementing it could be a problem for the 8.1 kernel of squeeze and as
> used on our buildds, and so I don't think it could be properly fixed
> until wheezy+1, at least.
>
> A workaround in bash might have been justified, but AFAIK this problem
> is specific to GNU/kFreeBSD chroot/jails on native FreeBSD hosts.

True, it's probably a rare combination. I suppose if it affects just
me you can leave it for now, the next couple of months will tell us
whether anyone else is running this combination.

cheers & thanks for looking into it
-- 
Stefan Ott
http://www.ott.net/

"You are not Grey Squirrel?"




Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#679198; Package src:kfreebsd-9. (Fri, 29 Jun 2012 13:27:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Fri, 29 Jun 2012 13:27:07 GMT) Full text and rfc822 format available.

Message #50 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Stefan Ott <stefan@ott.net>
Cc: Jonathan Nieder <jrnieder@gmail.com>, debian-bsd@lists.debian.org, 679198@bugs.debian.org
Subject: Re: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 14:24:27 +0100
On 29/06/12 14:12, Stefan Ott wrote:
> Interesting. If you have a ideas / patches that I could try out I
> would be happy to.

You could rebuild bash with Jonathan Nieder's patch, and use it locally
http://lists.debian.org/20120627015952.GH7701@burratino


It would be nice to fix this, as bash is an essential package which I
guess would cause a problem during debootstrap.  But fixing this isn't
release-critical, would require a freeze exemption, and it is extra
important that a fix wouldn't affect bash on other architectures.

In the longer term it would be better that our kernels and glibc can
implement the correct fix, and leave bash unmodified, as there are
probably other packages we don't know about with related problems.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Information forwarded to debian-bugs-dist@lists.debian.org, GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>:
Bug#679198; Package src:kfreebsd-9. (Fri, 29 Jun 2012 19:30:12 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Millan <rmh@debian.org>:
Extra info received and forwarded to list. Copy sent to GNU/kFreeBSD Maintainers <debian-bsd@lists.debian.org>. (Fri, 29 Jun 2012 19:30:12 GMT) Full text and rfc822 format available.

Message #55 received at 679198@bugs.debian.org (full text, mbox):

From: Robert Millan <rmh@debian.org>
To: 679198@bugs.debian.org
Cc: Steven Chamberlain <steven@pyro.eu.org>, debian-bsd@lists.debian.org, doko@debian.org
Subject: Re: Processed: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 21:28:26 +0200
reassign 679198 bash
thanks

2012/6/29 Debian Bug Tracking System <owner@bugs.debian.org>:
> Processing commands for control@bugs.debian.org:
>
>> reassign 679198 src:kfreebsd-9

This isn't a kernel bug.  The kernel recognizes O_CLOEXEC properly
when userland uses it.

The problem is that userland isn't actually using O_CLOEXEC, because
its declaration is missing in glibc headers.  Actually it's already
been reported: see #679198.

-- 
Robert Millan




Bug reassigned from package 'src:kfreebsd-9' to 'bash'. Request was from Robert Millan <rmh@debian.org> to control@bugs.debian.org. (Fri, 29 Jun 2012 19:30:17 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Fri, 29 Jun 2012 19:39:04 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Fri, 29 Jun 2012 19:39:04 GMT) Full text and rfc822 format available.

Message #62 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Robert Millan <rmh@debian.org>
Cc: 679198@bugs.debian.org, debian-bsd@lists.debian.org, doko@debian.org
Subject: Re: Processed: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 20:36:41 +0100
On 29/06/12 20:28, Robert Millan wrote:
> The problem is that userland isn't actually using O_CLOEXEC, because
> its declaration is missing in glibc headers.  Actually it's already
> been reported: see #679198.

#679198 is this bug.  Did you mean #635192?

In /usr/include/i386-kfreebsd-gnu/bits/fcntl.h :

> #if _POSIX_C_SOURCE >= 200809L
> #define O_TTY_INIT      0x00080000      /* Restore default termios attributes */
> /* Defining O_CLOEXEC would break kfreebsd 8.1, see #635192 */
> /* #define O_CLOEXEC    0x00100000 */
> #endif

So it is undefined on purpose?

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Fri, 29 Jun 2012 19:48:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Robert Millan <rmh@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Fri, 29 Jun 2012 19:48:05 GMT) Full text and rfc822 format available.

Message #67 received at 679198@bugs.debian.org (full text, mbox):

From: Robert Millan <rmh@debian.org>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: 679198@bugs.debian.org, debian-bsd@lists.debian.org, doko@debian.org, 635192@bugs.debian.org
Subject: Re: Processed: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 21:44:30 +0200
2012/6/29 Steven Chamberlain <steven@pyro.eu.org>:
> #679198 is this bug.  Did you mean #635192?

Yes, sorry.

> In /usr/include/i386-kfreebsd-gnu/bits/fcntl.h :
>
>> #if _POSIX_C_SOURCE >= 200809L
>> #define O_TTY_INIT      0x00080000      /* Restore default termios attributes */
>> /* Defining O_CLOEXEC would break kfreebsd 8.1, see #635192 */
>> /* #define O_CLOEXEC    0x00100000 */
>> #endif
>
> So it is undefined on purpose?

Correct.  Although leaving it undefined might be worse than defining
it.  E.g. consider programs doing:

/* use O_CLOEXEC if possible */
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
#endif

fd = open (..., O_CLOEXEC);
// don't bother closing fd

But the decision is up to glibc maintainers.

-- 
Robert Millan




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Sat, 30 Jun 2012 03:27:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sat, 30 Jun 2012 03:27:10 GMT) Full text and rfc822 format available.

Message #72 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Robert Millan <rmh@debian.org>
Cc: 679198@bugs.debian.org, Steven Chamberlain <steven@pyro.eu.org>, debian-bsd@lists.debian.org
Subject: Re: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Fri, 29 Jun 2012 22:23:37 -0500
Hi Robert,

Robert Millan wrote:

> This isn't a kernel bug.  The kernel recognizes O_CLOEXEC properly
> when userland uses it.
>
> The problem is that userland isn't actually using O_CLOEXEC, because
> its declaration is missing in glibc headers.  Actually it's already
> been reported: see #679198.

When did O_CLOEXEC get involved?  This report was about a use of
FD_CLOEXEC.

Thanks,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Sat, 30 Jun 2012 12:57:22 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sat, 30 Jun 2012 12:57:24 GMT) Full text and rfc822 format available.

Message #77 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: Robert Millan <rmh@debian.org>, 679198@bugs.debian.org, debian-bsd@lists.debian.org
Subject: Re: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Sat, 30 Jun 2012 13:55:17 +0100
On 30/06/12 04:23, Jonathan Nieder wrote:
> When did O_CLOEXEC get involved?  This report was about a use of
> FD_CLOEXEC.

I've been *assuming* (as the only thing that makes sense) the situation
is something like:

Enabling FD_CLOEXEC on an open fd was previously not implemented (in the
upstream kernel that we shipped with squeeze).  So I think O_CLOEXEC is
considered as zero such that:

sink = open("/dev/null", O_WRONLY)

is taken by our kernels to imply O_CLOEXEC unconditionally.  Any fcntl()
trying to enable it later would be a no-op.


But Stefan was trying to run a GNU/kFreeBSD userland on an upstream
FreeBSD kernel with FD_CLOEXEC support.  This won't assume an implicit
O_CLOEXEC, yet our glibc still doesn't know how to enable FD_CLOEXEC and
returns an error.


So I suppose there might be a way to implement FD_CLOEXEC (to cater for
this special case) without implementing the O_CLOEXEC option yet.  If
any of the above was a correct assumption.

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Tue, 03 Jul 2012 16:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 03 Jul 2012 16:51:06 GMT) Full text and rfc822 format available.

Message #82 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: debian-bsd@lists.debian.org, Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Tue, 3 Jul 2012 11:47:33 -0500
Hi,

Steven Chamberlain wrote:

> Hmmm, I can't seem to reproduce the problem here, in a kfreebsd-i386
> jail environment on a GNU/kFreeBSD (9.0) host.  I had bash 4.2-2 already
> installed though.
>
> I'm trying "apt-get --reinstall install bash" or directly running
> /var/lib/dpkg/info/bash.preinst
>
> Here's a system call trace:
>
>  72202 bash.preinst CALL  open(0x8049678,0x1<><invalid>1,<unused>0)
>  72202 bash.preinst NAMI  "/dev/null"
>  72202 bash.preinst RET   open 3
>  72202 bash.preinst CALL  fcntl(0x3,<invalid=3>,0x8149)
>  72202 bash.preinst RET   fcntl 1
>  72202 bash.preinst CALL  fcntl(0x3,<invalid=4>,0x1<><invalid>1)
>  72202 bash.preinst RET   fcntl 0
>
> Successfully opened /dev/null as fd 0x3.  I assume that is fcntl()
> F_GETFL returning flags = 0x1 (which actually means FD_CLOEXEC was
> already set), then F_SETFL returning 0 = success.

That's the first difference from Stefan's trace, so let's start there.
/dev/null is opened with

	sink = open("/dev/null", O_WRONLY);

O_WRONLY == 1, so this matches the open call in your trace.  So far so
good.  Then we try to set the FD_CLOEXEC flag:

	if (sink >= 0)
		set_cloexec(sink);

set_cloexec() is defined in terms of fcntl calls that get and set the
file descriptor's flags:

	int flags = fcntl(fd, F_GETFL);
	if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
		die_errno("cannot set close-on-exec flag");

F_GETFL is 3, so fcntl is being called correctly.  But why does
fcntl(F_GETFL) return 1 (== FD_CLOEXEC)?  This looks like a bug.  What
kfreebsd-image-(foo) package are you using, and at what version?

Puzzled,
Jonathan




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Tue, 03 Jul 2012 17:51:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 03 Jul 2012 17:51:06 GMT) Full text and rfc822 format available.

Message #87 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: Jonathan Nieder <jrnieder@gmail.com>
Cc: debian-bsd@lists.debian.org, Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Tue, 03 Jul 2012 18:47:22 +0100
Hi,

On 03/07/12 17:47, Jonathan Nieder wrote:
> F_GETFL is 3, so fcntl is being called correctly.  But why does
> fcntl(F_GETFL) return 1 (== FD_CLOEXEC)?  This looks like a bug.

That is what led me to assume that O_CLOEXEC might be defined as zero
when our kfreebsd-images are built (and hence FD_CLOEXEC set by
default).  But I can't easily check this until I get a new kfreebsd-*
build environment set up.

This would explain why the problem only occurred in a jail on a FreeBSD
upstream kernel (which presumably doesn't do this, because their own
libc has the ability to set FD_CLOEXEC later on an open fd if requested).

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org




Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Tue, 03 Jul 2012 18:24:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 03 Jul 2012 18:24:07 GMT) Full text and rfc822 format available.

Message #92 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Steven Chamberlain <steven@pyro.eu.org>
Cc: debian-bsd@lists.debian.org, Stefan Ott <stefan@ott.net>, 679198@bugs.debian.org
Subject: Re: bash: Fails to upgrade in kFreeBSD jails
Date: Tue, 3 Jul 2012 13:21:02 -0500
Steven Chamberlain wrote:

> That is what led me to assume that O_CLOEXEC might be defined as zero
> when our kfreebsd-images are built (and hence FD_CLOEXEC set by
> default).  But I can't easily check this until I get a new kfreebsd-*
> build environment set up.

Debian's kfreebsd packages do not have any patches that intend to
change the meaning or value of O_CLOEXEC (nor any that mention it
in their description or patch text).




Removed blocking bug(s) of 679198: 635192 Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:08 GMT) Full text and rfc822 format available.

Severity set to 'serious' from 'important' Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:09 GMT) Full text and rfc822 format available.

Removed indication that 679198 affects src:bash Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:09 GMT) Full text and rfc822 format available.

Marked as found in versions bash/4.2-4. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:10 GMT) Full text and rfc822 format available.

Added tag(s) sid and wheezy. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:10 GMT) Full text and rfc822 format available.

Merged 679198 683271 Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:18:11 GMT) Full text and rfc822 format available.

Removed tag(s) sid and wheezy. Request was from Jonathan Nieder <jrnieder@gmail.com> to control@bugs.debian.org. (Mon, 30 Jul 2012 17:33:06 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 28 Nov 2012 16:21:07 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Wed, 28 Nov 2012 16:21:07 GMT) Full text and rfc822 format available.

Message #111 received at 679198@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <679198@bugs.debian.org>
Subject: Re: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Wed, 28 Nov 2012 17:17:19 +0100
Package: bash
Followup-For: Bug #679198

If I understand well fcntl(2), the following patch may solve this bug.
Stefan, would you please try to rebuild and test?

--- bash.preinst-lib.c  2012-11-28 15:56:04.000000000 +0100
+++ bash.preinst-lib.c.new      2012-11-28 17:07:09.000000000 +0100
@@ -60,8 +60,8 @@
 
 void set_cloexec(int fd)
 {
-       int flags = fcntl(fd, F_GETFL);
-       if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
+       int flags = fcntl(fd, F_GETFD);
+       if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC))
                die_errno("cannot set close-on-exec flag");
 }
 



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 28 Nov 2012 20:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Wed, 28 Nov 2012 20:39:03 GMT) Full text and rfc822 format available.

Message #116 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: 679198@bugs.debian.org
Cc: Nicolas Boulenguez <nicolas@debian.org>, Stefan Ott <stefan@ott.net>, Jonathan Nieder <jrnieder@gmail.com>, "debian-bsd@lists.debian.org" <debian-bsd@lists.debian.org>
Subject: Re: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Wed, 28 Nov 2012 20:37:12 +0000
Control: tags -1 patch

On 03/07/12 17:47, Jonathan Nieder wrote:
> F_GETFL is 3, so fcntl is being called correctly.  But why does
> fcntl(F_GETFL) return 1 (== FD_CLOEXEC)?  This looks like a bug.

On 28/11/12 16:17, Nicolas Boulenguez wrote:
> -       int flags = fcntl(fd, F_GETFL);
> -       if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
> +       int flags = fcntl(fd, F_GETFD);
> +       if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC))

Of course!  How did we miss that?

The fcntl calls are getting/setting the wrong flags here and returning 1
(== O_WRONLY) rather than 1 (== FD_CLOEXEC).

This explains why it wasn't reproducible on Debian's own kfreebsd
(kernel) builds.  O_CLOEXEC is undefined in GNU/kFreeBSD's glibc and it
doesn't appear in the F_GETFL result.

But when running in a jail on upstream FreeBSD kernels, it must be
getting 0x00100001 (== O_WRONLY | O_CLOEXEC), and then it tries to
F_SETFL with a flag our glibc won't recognise.

Thanks a lot for this Nicolas!

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org



Added tag(s) patch. Request was from Steven Chamberlain <steven@pyro.eu.org> to 679198-submit@bugs.debian.org. (Wed, 28 Nov 2012 20:39:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Thu, 29 Nov 2012 03:45:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Thu, 29 Nov 2012 03:45:03 GMT) Full text and rfc822 format available.

Message #123 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Nicolas Boulenguez <nicolas@debian.org>
Cc: 679198@bugs.debian.org
Subject: Re: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Wed, 28 Nov 2012 19:41:59 -0800
Nicolas Boulenguez wrote:

> If I understand well fcntl(2), the following patch may solve this bug.
> Stefan, would you please try to rebuild and test?
>
> --- bash.preinst-lib.c  2012-11-28 15:56:04.000000000 +0100
> +++ bash.preinst-lib.c.new      2012-11-28 17:07:09.000000000 +0100
> @@ -60,8 +60,8 @@
>
>  void set_cloexec(int fd)
>  {
> -       int flags = fcntl(fd, F_GETFL);
> -       if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
> +       int flags = fcntl(fd, F_GETFD);
> +       if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC))
>                 die_errno("cannot set close-on-exec flag");

Good eyes.  Thanks for figuring it out.

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>



Information stored :
Bug#679198; Package bash. (Fri, 30 Nov 2012 07:30:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and filed, but not forwarded. (Fri, 30 Nov 2012 07:30:06 GMT) Full text and rfc822 format available.

Message #128 received at 679198-quiet@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: 679198-quiet@bugs.debian.org
Subject: [Mailer-Daemon@master.debian.org: Mail delivery failed: returning message to sender]
Date: Thu, 29 Nov 2012 23:22:44 -0800
[Message part 1 (text/plain, inline)]
FYI
[Message part 2 (message/rfc822, inline)]
From: Mail Delivery System <Mailer-Daemon@master.debian.org>
To: jrnieder@gmail.com
Subject: Mail delivery failed: returning message to sender
Date: Fri, 30 Nov 2012 02:38:47 +0000
This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its
recipients. This is a permanent error. The following address(es) failed:

  nicolas.boulenguez@free.fr
    SMTP error from remote mail server after RCPT TO:<nicolas.boulenguez@free.fr>:
    host mx1.free.fr [212.27.48.6]: 550 Too many spams from your IP (70.103.162.29), please visit http://postmaster.free.fr/

------ This is a copy of the message, including all the headers. ------

Return-path: <jrnieder@gmail.com>
Received: from mail-la0-f52.google.com ([209.85.215.52])
	by master.debian.org with esmtps (TLS1.0:RSA_ARCFOUR_SHA1:16)
	(Exim 4.72)
	(envelope-from <jrnieder@gmail.com>)
	id 1Tdv0o-0003CH-8c
	for nicolas.boulenguez@free.fr; Thu, 29 Nov 2012 03:42:06 +0000
Received: by mail-la0-f52.google.com with SMTP id l5so9375554lah.25
        for <nicolas@debian.org>; Wed, 28 Nov 2012 19:41:59 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20120113;
        h=mime-version:in-reply-to:references:date:message-id:subject:from:to
         :cc:content-type;
        bh=2dDXqecF9Wcu7/e90Tsfk4tPf4X4MZsyGrsFsjOWSxA=;
        b=dutSNX582qiDTHr4RWg1532+aiRUk17RLxUXcPtrFy/3uAr8ZHq1veWLEqx+Iacn6/
         qgafQb0SGBrULbGmZxqdsa4jhMKay82wLjNBQ6DzXO5z0qFtZ7bv1/RQiClJrRanZE0Q
         21cgBedxe4a2h9c33UnC2l8Ip8Db0IaqNorOForDze2kmIbliWsA2BlbjBNFJg9dY3G/
         fMUQhraXS3Gm2delOKnluGkZ36xszs69fThnHeQ8yQY8RW1m6x27yA8Tt4ue/ZilnCVR
         W3ejWuaRKF0yHXAtSuaS+KQXU2uWcMuEk4lBj/pXBpZWeTAFv746CEUEJ3zCZwJ+zn9S
         4F6A==
MIME-Version: 1.0
Received: by 10.112.25.68 with SMTP id a4mr8902934lbg.10.1354160519141; Wed,
 28 Nov 2012 19:41:59 -0800 (PST)
Received: by 10.112.61.65 with HTTP; Wed, 28 Nov 2012 19:41:59 -0800 (PST)
In-Reply-To: <20121128161719.10559.30276.reportbug@pegase>
References: <20121128161719.10559.30276.reportbug@pegase>
Date: Wed, 28 Nov 2012 19:41:59 -0800
Message-ID: <CAFzf2Xw_M5yYg7tqcbd8C0T3rybWxBNC+r66GCQumL=-qMc5yA@mail.gmail.com>
Subject: Re: Bug#679198: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
From: Jonathan Nieder <jrnieder@gmail.com>
To: Nicolas Boulenguez <nicolas@debian.org>
Cc: 679198@bugs.debian.org
Content-Type: text/plain; charset=UTF-8

Nicolas Boulenguez wrote:

> If I understand well fcntl(2), the following patch may solve this bug.
> Stefan, would you please try to rebuild and test?
>
> --- bash.preinst-lib.c  2012-11-28 15:56:04.000000000 +0100
> +++ bash.preinst-lib.c.new      2012-11-28 17:07:09.000000000 +0100
> @@ -60,8 +60,8 @@
>
>  void set_cloexec(int fd)
>  {
> -       int flags = fcntl(fd, F_GETFL);
> -       if (flags < 0 || fcntl(fd, F_SETFL, flags | FD_CLOEXEC))
> +       int flags = fcntl(fd, F_GETFD);
> +       if (flags < 0 || fcntl(fd, F_SETFD, flags | FD_CLOEXEC))
>                 die_errno("cannot set close-on-exec flag");

Good eyes.  Thanks for figuring it out.

For what it's worth,
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Sat, 08 Dec 2012 11:33:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas@debian.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sat, 08 Dec 2012 11:33:03 GMT) Full text and rfc822 format available.

Message #133 received at 679198@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: Debian Bug Tracking System <679198@bugs.debian.org>
Subject: bash: typo in FD_CLOEXEC invocation
Date: Sat, 08 Dec 2012 12:31:48 +0100
Package: bash
Followup-For: Bug #679198

Hello. Currently, wheezy contains 4.2-4 and unstable 4.2-5. The latter
corrects a non-RC bug and will not be granted a freeze exception.

Doko: may I NMU 4.2-5.1 to unstable? It should then be easy to
backport the debdiff to testing-proposed-updates.



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Tue, 11 Dec 2012 08:24:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 11 Dec 2012 08:24:06 GMT) Full text and rfc822 format available.

Message #138 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Nicolas Boulenguez <nicolas@debian.org>
Cc: 679198@bugs.debian.org
Subject: Re: bash: typo in FD_CLOEXEC invocation
Date: Tue, 11 Dec 2012 00:20:48 -0800
Nicolas Boulenguez wrote:

> Doko: may I NMU 4.2-5.1 to unstable? It should then be easy to
> backport the debdiff to testing-proposed-updates.

I'm not doko, but please go ahead.  Be sure to remember to attach the
debdiff here.

Many thanks,
Jonathan



Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Tue, 11 Dec 2012 21:30:28 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas.boulenguez@free.fr>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Tue, 11 Dec 2012 21:30:28 GMT) Full text and rfc822 format available.

Message #143 received at 679198@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas.boulenguez@free.fr>
To: 679198@bugs.debian.org
Subject: bash: diff for NMU version 4.2-5.1
Date: Tue, 11 Dec 2012 22:29:43 +0100
[Message part 1 (text/plain, inline)]
Control: tags 679198 + pending
thanks

Dear maintainers,

I've prepared an NMU for bash (versioned as 4.2-5.1) and
uploaded it to DELAYED/5. Please feel free to tell me if I
should delay it longer.

Regards.
[bash-4.2-5.1-nmu.diff (text/x-diff, attachment)]

Added tag(s) pending. Request was from Nicolas Boulenguez <nicolas.boulenguez@free.fr> to 679198-submit@bugs.debian.org. (Tue, 11 Dec 2012 21:30:28 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Wed, 12 Dec 2012 08:09:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Nieder <jrnieder@gmail.com>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Wed, 12 Dec 2012 08:09:03 GMT) Full text and rfc822 format available.

Message #150 received at 679198@bugs.debian.org (full text, mbox):

From: Jonathan Nieder <jrnieder@gmail.com>
To: Nicolas Boulenguez <nicolas.boulenguez@free.fr>
Cc: 679198@bugs.debian.org
Subject: Re: bash: [on native FreeBSD] unable to set FD_CLOEXEC flag
Date: Wed, 12 Dec 2012 00:07:24 -0800
Hi,

Nicolas Boulenguez wrote:

> --- bash-4.2/debian/changelog
> +++ bash-4.2/debian/changelog
> @@ -1,3 +1,10 @@
> +bash (4.2-5.1) unstable; urgency=low
> +
> +  * Non-maintainer upload.
> +  * debian/bash.preinst-lib.c: typo in fcntl argument (Closes: #679198).

It would be clearer to users (who generally see the changelog without
the patch) to say something like

  * bash.preinst: pass F_GETFD/F_SETFD, not F_GETFL/F_SETFL, to fcntl
    to set FD_CLOEXEC flag, avoiding "Inappropriate ioctl for device"
    errors installing using the upstream FreeBSD kernel (Closes: #679198)

But that's a small detail.  What you've already written is fine.

Thanks,
Jonathan



Reply sent to Nicolas Boulenguez <nicolas@debian.org>:
You have taken responsibility. (Sun, 16 Dec 2012 22:06:03 GMT) Full text and rfc822 format available.

Notification sent to Stefan Ott <stefan@ott.net>:
Bug acknowledged by developer. (Sun, 16 Dec 2012 22:06:03 GMT) Full text and rfc822 format available.

Message #155 received at 679198-close@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: 679198-close@bugs.debian.org
Subject: Bug#679198: fixed in bash 4.2-5.1
Date: Sun, 16 Dec 2012 22:02:47 +0000
Source: bash
Source-Version: 4.2-5.1

We believe that the bug you reported is fixed in the latest version of
bash, 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 679198@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nicolas Boulenguez <nicolas@debian.org> (supplier of updated bash 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: SHA256

Format: 1.8
Date: Tue, 11 Dec 2012 22:02:44 +0100
Source: bash
Binary: bash bash-static bash-builtins bash-doc
Architecture: source all amd64
Version: 4.2-5.1
Distribution: unstable
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Nicolas Boulenguez <nicolas@debian.org>
Description: 
 bash       - GNU Bourne Again SHell
 bash-builtins - Bash loadable builtins - headers & examples
 bash-doc   - Documentation and examples for the The GNU Bourne Again SHell
 bash-static - GNU Bourne Again SHell (static version)
Closes: 679198
Changes: 
 bash (4.2-5.1) unstable; urgency=low
 .
   * Non-maintainer upload.
   * debian/bash.preinst-lib.c: typo in fcntl argument (Closes: #679198).
Checksums-Sha1: 
 9c1c04c426c1bddc04d78c16bd83f31ff5599ece 2123 bash_4.2-5.1.dsc
 222eb97748c88906baba7aa676dcb8889ce362e7 88298 bash_4.2-5.1.diff.gz
 6c672aa8d7ad1e26064bcaf343175f26af1e47e3 695000 bash-doc_4.2-5.1_all.deb
 b4450248b4810d1e3092250d58434891069417bc 1498628 bash_4.2-5.1_amd64.deb
 d0455f7ab815aeb59e6db3dd1531a9a47a79bbf9 112100 bash-builtins_4.2-5.1_amd64.deb
 fa980f06577482b335bd827dd67d7ca73708df80 936368 bash-static_4.2-5.1_amd64.deb
Checksums-Sha256: 
 34d6e9c890ee7a1a00867b941037a22de1a2c817b1e38ebf5b48acb598182bc8 2123 bash_4.2-5.1.dsc
 a49c80538d1314cc95bc19aab917741ddae9c2c2729045d9f0f574635878dfaa 88298 bash_4.2-5.1.diff.gz
 488af4649140588c114e9ea0b3ff276c22a527c331062ae177928e4ac2706f44 695000 bash-doc_4.2-5.1_all.deb
 7fca2b3f0788056f1331b8f740da30c8b06dfc40610e8cc52abd2941a7adfd67 1498628 bash_4.2-5.1_amd64.deb
 b3c315956d84a224c44f303462d6d58a2adcb3125e26408e73d71998dbaf709a 112100 bash-builtins_4.2-5.1_amd64.deb
 bd057a495f4b58e95a3e8a373949d0f86a6eb1d0858d2f11e010bde9ecffd415 936368 bash-static_4.2-5.1_amd64.deb
Files: 
 30513f0bc6b2c5593a876082c0306cb4 2123 base required bash_4.2-5.1.dsc
 8d71e5debd8d3951969066110d3a316d 88298 base required bash_4.2-5.1.diff.gz
 8128acec701c9aa3d17dbac13958732f 695000 doc optional bash-doc_4.2-5.1_all.deb
 63885865a95728a7041c75f65c133fd3 1498628 shells required bash_4.2-5.1_amd64.deb
 c005b567a929be25868c55b7da56e002 112100 utils optional bash-builtins_4.2-5.1_amd64.deb
 976158bab594eeafef16d71888b0d7a6 936368 shells optional bash-static_4.2-5.1_amd64.deb

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

iQIcBAEBCAAGBQJQx6WmAAoJELUqnPRJDfyNkVsQAIWFd/NPQFN2mc9w7P/InFun
cAj4MfIJOgD4vkH5CLj3vXSvL98uRpFu1FNvaAXDsVrV5/Etelqz1D9TWA7wbpV+
fz/dsxOk0St53ndzCfN+Uqt9xS4O6/C1tTlhxIjnL7ZNfQkWywEjN0fuZa2znSCR
VJQGiHCZ7QtGeatrlcn/VBQdsE+D6XvfeI4Wx7MMLcELzZZrz9WN3mlAaWaY4aVu
JqDiE0hh5wVoK5DqV8cfOYLCgiodv6EUoBY3Xplhkdb/dYhcK2KcpuvFMasj2T1Z
esFUg5VaQ+iYth78aUI2f0ikXbyT5EseLHVL8zHmG7vV3rASbwjmtJyzv+M5qHnw
V5fs8uHVbQt9P5hBFVWNvrK2JGd/1FWg9f0emEuGOdYGC58vId29pR6G9kT3sDb9
sqA6n5yn/XHlm7EAPwRzdpB+r7pclOBfvaKNEHJcVs1u7NoOAVm4gPsjmH0QbtwC
GKHae1Ai7pfljebYqKCpfkJQCv57CcrpWNO9cSLheaWxEn4kQO3c9j16kgbtLyRp
3HlvbajIdFH26UIdEiDVx5QR/gIDhvofNN6FmWBVD/81a6hVjpO7e2P4DXDH44kO
/Rg5Cf5lmegUKVgRs/Egv/PqW+fWNiOMHj8AnT29fEwe4au2LHrz3Ax71xXjyehk
Ef2Xz/A8j6kX/R5sJKcU
=Ro9U
-----END PGP SIGNATURE-----




Reply sent to Nicolas Boulenguez <nicolas@debian.org>:
You have taken responsibility. (Sun, 16 Dec 2012 22:06:04 GMT) Full text and rfc822 format available.

Notification sent to Christoph Egger <christoph@debian.org>:
Bug acknowledged by developer. (Sun, 16 Dec 2012 22:06:04 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Sun, 16 Dec 2012 22:54:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steven Chamberlain <steven@pyro.eu.org>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sun, 16 Dec 2012 22:54:03 GMT) Full text and rfc822 format available.

Message #164 received at 679198@bugs.debian.org (full text, mbox):

From: Steven Chamberlain <steven@pyro.eu.org>
To: 679198@bugs.debian.org
Cc: Nicolas Boulenguez <nicolas@debian.org>, "debian-bsd@lists.debian.org" <debian-bsd@lists.debian.org>
Subject: Re: Bug#679198: marked as done (bash: [on native FreeBSD] unable to set FD_CLOEXEC flag)
Date: Sun, 16 Dec 2012 22:51:11 +0000
[Message part 1 (text/plain, inline)]
Hi,

On 16/12/12 22:06, Debian Bug Tracking System wrote:
>  bash (4.2-5.1) unstable; urgency=low
>  .
>    * Non-maintainer upload.
>    * debian/bash.preinst-lib.c: typo in fcntl argument (Closes: #679198).

Thank you for uploading your fix for this.


Using Debian Code Search we can see other cases where possibly the same
mistake has been made - I wonder if any of these would cause bugs:

http://codesearch.debian.net/search?q=fcntl.*F_SETFL.*FD_

Regards,
-- 
Steven Chamberlain
steven@pyro.eu.org

[signature.asc (application/pgp-signature, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Matthias Klose <doko@debian.org>:
Bug#679198; Package bash. (Sat, 22 Dec 2012 00:21:06 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nicolas Boulenguez <nicolas.boulenguez@free.fr>:
Extra info received and forwarded to list. Copy sent to Matthias Klose <doko@debian.org>. (Sat, 22 Dec 2012 00:21:06 GMT) Full text and rfc822 format available.

Message #169 received at 679198@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas.boulenguez@free.fr>
To: 679198@bugs.debian.org
Subject: bash: diff for NMU version 4.2-4wheezy0.1
Date: Sat, 22 Dec 2012 01:17:06 +0100
[Message part 1 (text/plain, inline)]
Dear maintainer,

I've prepared an NMU for bash (versioned as 4.2-4wheezy0.1, with
testing as the target distribution) and uploaded it to DELAYED/5.

Please feel free to tell me if I should delay it longer or cancel it.

Regards.
[bash-4.2-4wheezy0.1-nmu.diff (text/x-diff, attachment)]

Reply sent to Nicolas Boulenguez <nicolas@debian.org>:
You have taken responsibility. (Thu, 27 Dec 2012 00:51:03 GMT) Full text and rfc822 format available.

Notification sent to Stefan Ott <stefan@ott.net>:
Bug acknowledged by developer. (Thu, 27 Dec 2012 00:51:03 GMT) Full text and rfc822 format available.

Message #174 received at 679198-close@bugs.debian.org (full text, mbox):

From: Nicolas Boulenguez <nicolas@debian.org>
To: 679198-close@bugs.debian.org
Subject: Bug#679198: fixed in bash 4.2-4wheezy0.1
Date: Thu, 27 Dec 2012 00:47:28 +0000
Source: bash
Source-Version: 4.2-4wheezy0.1

We believe that the bug you reported is fixed in the latest version of
bash, 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 679198@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Nicolas Boulenguez <nicolas@debian.org> (supplier of updated bash 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: SHA256

Format: 1.8
Date: Fri, 21 Dec 2012 23:47:40 +0100
Source: bash
Binary: bash bash-static bash-builtins bash-doc
Architecture: source all amd64
Version: 4.2-4wheezy0.1
Distribution: testing
Urgency: low
Maintainer: Matthias Klose <doko@debian.org>
Changed-By: Nicolas Boulenguez <nicolas@debian.org>
Description: 
 bash       - GNU Bourne Again SHell
 bash-builtins - Bash loadable builtins - headers & examples
 bash-doc   - Documentation and examples for the The GNU Bourne Again SHell
 bash-static - GNU Bourne Again SHell (static version)
Closes: 679198
Changes: 
 bash (4.2-4wheezy0.1) testing; urgency=low
 .
   * Non-maintainer upload.
   * debian/bash.preinst-lib.c: pass F_[GS]ETFD, not F_[GS]ETFL, to fcntl
     to set FD_CLOEXEC flag, avoiding "Inappropriate ioctl for device"
     errors installing using the upstream FreeBSD kernel (Closes: #679198)
Checksums-Sha1: 
 fe1d5ba2797fbd3fec1edeee5e099649f996f307 2151 bash_4.2-4wheezy0.1.dsc
 c0a4121f9c1f6a4a14f3fad99259dbdf7d4fa734 87944 bash_4.2-4wheezy0.1.diff.gz
 373a77b7badc1916d181d50a7079076d8a79c5fd 695022 bash-doc_4.2-4wheezy0.1_all.deb
 98800fc497b4b046083276138a1aa729ded36c69 1498596 bash_4.2-4wheezy0.1_amd64.deb
 5370b5c8fda7cec9444cab8618cfd91553349533 112106 bash-builtins_4.2-4wheezy0.1_amd64.deb
 50f28e17b8610baa7746fcff93a8019c6efacf62 936258 bash-static_4.2-4wheezy0.1_amd64.deb
Checksums-Sha256: 
 e6719eb58c1fdf66a39cb30446cf3a5c1eca080e3215e2ce6b1845d36c9253de 2151 bash_4.2-4wheezy0.1.dsc
 d1d7d0398ce333d70b407a43fc8c20cdf3290319858b01257538cd5871f4d4d0 87944 bash_4.2-4wheezy0.1.diff.gz
 d822779e8e5ce592883bb98c5dea496e6edc2bbcc8949c155ca131bdeb8b61e6 695022 bash-doc_4.2-4wheezy0.1_all.deb
 7d03ab6032458e50c5a28d56d2c9468978e1e7890a7c1f36201d40bab2fde9dc 1498596 bash_4.2-4wheezy0.1_amd64.deb
 b3cd565ec9d54d4c5f331351b89e23a73f38f1087a444d3b80f9519c7dd4e6ff 112106 bash-builtins_4.2-4wheezy0.1_amd64.deb
 fc1f53fcd41f347c24168c02fd362e85e9dcfc92ad1c373ccbf7c4ac911d7183 936258 bash-static_4.2-4wheezy0.1_amd64.deb
Files: 
 114884f688f0b057d37652bde0305e6a 2151 base required bash_4.2-4wheezy0.1.dsc
 76f51ce1a1b14a489e87cebaffc96777 87944 base required bash_4.2-4wheezy0.1.diff.gz
 77174c32752d007c84b8d57eba8c32c6 695022 doc optional bash-doc_4.2-4wheezy0.1_all.deb
 53b7040c64c4c59496acd639788b80e0 1498596 shells required bash_4.2-4wheezy0.1_amd64.deb
 00e036c3555675a4f23130652920fbdd 112106 utils optional bash-builtins_4.2-4wheezy0.1_amd64.deb
 e118a8063a2cc99afd4513658e444d0b 936258 shells optional bash-static_4.2-4wheezy0.1_amd64.deb

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

iQIcBAEBCAAGBQJQ1Pi6AAoJELUqnPRJDfyNMzYQAJZpNnEej8Q+fdB+n/KUIyYr
ownMnhyTHNfxPgSkbo0uNCm7H/k0iKtZ/R4EZBzLBqHJ6lBqlH97uIhqAKu/2LLu
TenqhRkiyBTxCMNtVLVNO/dbuT0RQVizHmbXEudpzkeqrD9BQsWfaiYxWMisMFpu
mx2SjMwNm6lJy3s5Uee/7CQ1JAGkGGIaYEVO8VKE3uRmIsbJScWBu26gAuNt7gsI
yIco+egy4WdjFGs4f69HuDVMdDxvDHduHZTAyWufFQJ61vlcHAySNTYSlQTdddAm
sAc8ppZwzsCzjtMO8iLStx6SZiScgOXAfGTwU6hcbD02NV2lYre6w1y3zIt2Cg1X
CXJs5cF+2bXz2f4hsLpMf/sIQo2d0Xm2wPRJWH0os6kjm6xIgphkieq1tLjEJhpO
iSnE0wutMM+qdizlFD8Mkt8vIIjiUgulvRcIttQ9fqOdct0LsGTBa1K4Um7zCi/8
jhKEuJjFwves9wZ2xkUK8xz3cMfFlaDQx+jt4NtP4VQJ/cKt5zCHhPt7jY29lXaR
AqGawzAf2rwv/Dq6c0NpBd1tFBUpnB52sU6pW/xcmf0pwvKs4JIKqP0GKbluQjtq
MY50NPjjjQ/6CNGRJk6Tn8f1Ck3iysyWkOgpc2zBCndzgkObPDYD9DW3z6+GAKYB
UfJt5eXD/BhPYPoEshIF
=G57r
-----END PGP SIGNATURE-----




Reply sent to Nicolas Boulenguez <nicolas@debian.org>:
You have taken responsibility. (Thu, 27 Dec 2012 00:51:04 GMT) Full text and rfc822 format available.

Notification sent to Christoph Egger <christoph@debian.org>:
Bug acknowledged by developer. (Thu, 27 Dec 2012 00:51:04 GMT) Full text and rfc822 format available.

Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Fri, 25 Jan 2013 07:27:08 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Fri Apr 18 20:46:11 2014; Machine Name: buxtehude.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.