Re: [RFC] a corner case of open(2)

From: Valdis . Kletnieks
Date: Tue Apr 26 2016 - 14:41:47 EST


On Tue, 26 Apr 2016 18:55:38 +0100, Al Viro said:

> It is a change of user-visible behaviour, but I would be very
> surprised if anything broke from that change. And it would help to simplify
> the awful mess we have in there.

I have to admit that over the past 3 decades of working with Unix-y systems,
there's been a number of times I've had to resort to 'od -cx /your/dir/here'
to debug issues (/bin/ls -fi is *almost* equivalent, but doesn't show holes
in the directory)

The biggest danger I can see is some shell script doing something like:

foobar > $dir/$targetfile

and $targetfile is unset. If we allow a program to get an open fd that refers
to a directory, what are the semantics of various operations on that fd?

Attachment: pgpgwEc8dp7dy.pgp
Description: PGP signature