[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bogus F_SETFL usage with FD_CLOEXEC (was Re: Bug#679198: ...)



On Sun, 2012-12-16 at 22:51:11 +0000, Steven Chamberlain wrote:
> 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_

Ah, nice thinking. All these are bugs, because currently on all (?)
GNU/* systems (including GNU/Linux) FD_CLOEXEC is defined as 1 which
maps to O_WRONLY for F_SETFL. So at best they are just leaking file
descriptors, and at worst they might fail if they try to set the flag
on a non-writable descriptor.

I think we should report all these, there does not seem to be many in
any case:

  9base
  cctools
  chromium-browser (webkit)
  e17
  fish
  freeradius
  gst-plugins-bad0.10
  jruby
  libowfat
  mswatch
  ocamlnet
  qt4-x11 (webkit)
  qtwebkit (webkit)
  ruby1.8
  ruby1.9.1
  webkit

Providing patches for those should also be trivial. I'll start doing
so if no one else offers for the task. :)

Thanks,
Guillem


Reply to: