Bug 1345 - closefromtest fails, sometimes
Summary: closefromtest fails, sometimes
Status: CLOSED FIXED
Alias: None
Product: Portable OpenSSH
Classification: Unclassified
Component: Miscellaneous (show other bugs)
Version: 4.6p1
Hardware: amd64 Linux
: P2 normal
Assignee: Assigned to nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-07-25 12:07 AEST by David Leonard
Modified: 2008-04-04 10:00 AEDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Leonard 2007-07-25 12:07:18 AEST
sometimes opebsd-compat/regress/closefromtest fails with
   closefrom: closed descriptors it should not have
(On Red Hat EL 3 x86_64)

This is because /dev/null is not being opened for read properly.

--- openssh/openbsd-compat/regress/closefromtest.c      (revision 160)
+++ openssh/openbsd-compat/regress/closefromtest.c      (working copy)
@@ -38,7 +38,7 @@
        char buf[512];
 
        for (i = 0; i < NUM_OPENS; i++)
-               if ((fds[i] = open("/dev/null", "r")) == -1)
+               if ((fds[i] = open("/dev/null", O_RDONLY)) == -1)
                        exit(0);        /* can't test */
        max = i - 1;
Comment 1 Tim Rice 2007-07-25 13:55:09 AEST
Nice catch. The fix should show up in the next snapshot.
Comment 2 Darren Tucker 2007-07-25 14:16:35 AEST
(In reply to comment #1)
> Nice catch. The fix should show up in the next snapshot.

In the interests of fairness: Bernard Simon also reported this to me a while back.  So, credit to him too, and an anti-credit to me for slacking.

Comment 3 Damien Miller 2008-04-04 10:00:24 AEDT
Close resolved bugs after release.