On 4/26/24 3:42 AM, Grisha Levit wrote:

Looks like RX_* values were previously used only to form the `flags'
argument of do_redirections() and related functions, comprising:

     RX_ACTIVE RX_UNDOABLE RX_CLEXEC


Separately, the REDIRECTION struct has a `flags' member holding O_*
flags passed to open(). But the following (other) RX_* values are also
getting stored in the `flags' member of REDIRECTION structs:

     RX_INTERNAL RX_USER RX_SAVCLEXEC RX_SAVEFD RX_EXPANDED


So as Oğuz notes, the issue here is observed when an RX_* value from
the above list has the same value as an O_* flag.

Yes, this overlap is the problem.

Perhaps it would make sense to change the latter set of RX_* values
into new REDIR_* values, which make up the `rflags' REDIRECTION member.

The rflags approach is the right one, you just need to separate the private
RX_ flag vaues from the public REDIR_  values by reserving bits.

--
``The lyf so short, the craft so long to lerne.'' - Chaucer
                 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, UTech, CWRU    c...@case.edu    http://tiswww.cwru.edu/~chet/

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to