Paul Eggert <[EMAIL PROTECTED]> wrote:
...
> 2005-12-25  Paul Eggert  <[EMAIL PROTECTED]>
>       * chdir-safer.c (chdir_no_follow): Don't include stdio.h, assert.h,
...
>       Open with O_DIRECTORY | O_NOCTTY, for benefit of hosts that
>       don't have O_NOFOLLOW.
...
> Index: lib/chdir-safer.c
...
> +  int open_flags = O_DIRECTORY | O_NOCTTY | O_NOFOLLOW | O_NONBLOCK;
> +  int fd = open (dir, O_RDONLY | open_flags);

Hi Paul,

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?

Thanks,

Jim


_______________________________________________
Bug-coreutils mailing list
Bug-coreutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-coreutils

Reply via email to