bug-coreutils
[Top][All Lists]
Advanced

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

Re: how does O_NOCTTY help? [Re: bug in chdir-safer


From: Jim Meyering
Subject: Re: how does O_NOCTTY help? [Re: bug in chdir-safer
Date: Thu, 09 Feb 2006 17:49:03 +0100

Jim Meyering <address@hidden> wrote:
> I wrote:
>> Adding O_DIRECTORY is an improvement, even for systems that do have
>> O_NOFOLLOW, but how does O_NOCTTY help?  Isn't the goal of using O_NOCTTY
>> to avoid provoking a signal upon e.g., read while backgrounded?  But
>> chdir_no_follow never attempts a read; all it does is call fstat and close.
>>
>> Is there some other reason to use O_NOCTTY here?
>
> Just so you know, I do know that O_NOCTTY prevents setting the process's
> controlling terminal.  The question is how can setting the controlling
> terminal cause trouble if we're guaranteed never to read from or write
> to the corresponding file descriptor.

Following up to myself again, and maybe answering my own question :-)

I suppose there'd be no harm, per se, in omitting O_NOCTTY, but that
the omission might make open do a tiny bit of unnecessary work.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]