From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Richard W.M. Jones" Subject: Re: Another bug, in dup3 Date: Tue, 9 Oct 2012 10:25:50 +0100 Message-ID: <20121009092549.GA19680@rhmail.home.annexia.org> References: <20121009091521.GM24071@rhmail.home.annexia.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="eJnRUKwClWJh1Khz" To: Al Viro , linux-fsdevel@vger.kernel.org, Jim Meyering , Linus Torvalds Return-path: Received: from mx1.redhat.com ([209.132.183.28]:38549 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751907Ab2JIJZ4 (ORCPT ); Tue, 9 Oct 2012 05:25:56 -0400 Content-Disposition: inline In-Reply-To: <20121009091521.GM24071@rhmail.home.annexia.org> Sender: linux-fsdevel-owner@vger.kernel.org List-ID: --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Simple reproducer attached. Rich. --=20 Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjon= es virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into Xen guests. http://et.redhat.com/~rjones/virt-p2v --eJnRUKwClWJh1Khz Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="dup3.c" /* Test if dup3 works right. * by Richard W.M. Jones. */ #define _GNU_SOURCE #include #include #include #include #include int main () { char *file = "/tmp/dup3.tmp"; int fd = creat (file, 0600); assert (fd >= 0); if (dup3 (fd, fd, 0) != -1) { fprintf (stderr, "dup3 (fd, fd, 0) didn't fail!\n"); exit (EXIT_FAILURE); } exit (EXIT_SUCCESS); } --eJnRUKwClWJh1Khz--