Bug#696283: jruby: Sets FD_CLOEXEC incorrectly with F_SETFL instead of F_SETFD

Guillem Jover guillem at debian.org
Tue Dec 18 22:11:35 UTC 2012


Source: jruby
Version: 1.5.6-5
Severity: important
Tags: patch
User: debian-bsd at lists.debian.org
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. (I've filed bug reports for the ruby 1.8
and 1.9.1 parts on their relative packages too.)

Thanks,
Guillem
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-jruby-Set-FD_CLOEXEC-correctly-using-F_SETFD-not-F_S.patch
Type: text/x-diff
Size: 2441 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-java-maintainers/attachments/20121218/8368275c/attachment.patch>


More information about the pkg-java-maintainers mailing list