Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 25 Jan 2021 18:58:30 +0100
From: Bruno Haible <bruno@...sp.org>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: insufficient checking in posix_spawn_file_actions_add{open,dup2}

Rich Felker wrote:
> I'm not convinced that the standard as written
> requires any comparison against sysconf(_SC_OPEN_MAX). Is there a
> general rule somewhere that {x_MAX} in the text implies a requirement
> to use the dynamic runtime value if x_MAX is undefined but there's a
> corresponding _SC_x_MAX?

As far as I understand, [1] defines the meaning of {OPEN_MAX}, and [2]
says that {OPEN_MAX} is sysconf(_SC_OPEN_MAX).

Also, [2] says
  "sysconf(_SC_OPEN_MAX) may return different values before and after a
   call to setrlimit() which changes the RLIMIT_NOFILE soft limit."

Bruno

[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/limits.h.html
[2] https://pubs.opengroup.org/onlinepubs/9699919799/functions/sysconf.html

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.