Re: read(2) on directories

2016-09-30 Thread Jeremie Courreges-Anglas
"Theo de Raadt" writes: >> On 2016-09-26, Jeremie Courreges-Anglas wrote: >> >> >>> So I think that we agree that EISDIR is more useful, and seems safe from >> >>> a portability POV. I've built base and x sets on i386, and ajacoutot >> >>> ran the ports

Re: read(2) on directories

2016-09-29 Thread Theo de Raadt
> On 2016-09-26, Jeremie Courreges-Anglas wrote: > > >>> So I think that we agree that EISDIR is more useful, and seems safe from > >>> a portability POV. I've built base and x sets on i386, and ajacoutot > >>> ran the ports bulk builds. The two offenders in the ports tree

Re: read(2) on directories

2016-09-29 Thread Christian Weisgerber
On 2016-09-26, Jeremie Courreges-Anglas wrote: >>> So I think that we agree that EISDIR is more useful, and seems safe from >>> a portability POV. I've built base and x sets on i386, and ajacoutot >>> ran the ports bulk builds. The two offenders in the ports tree were due >>>

Re: read(2) on directories

2016-09-26 Thread Alexander Bluhm
On Mon, Sep 26, 2016 at 06:14:10PM +0200, Jeremie Courreges-Anglas wrote: > I haven't received a single test report, which is far from sufficient > for such a change. Even though I'm convinced that such a change would > be a benefit, I won't push this further. I am running this diff on my laptop

Re: read(2) on directories

2016-09-26 Thread Jeremie Courreges-Anglas
j...@wxcvbn.org (Jeremie Courreges-Anglas) writes: > j...@wxcvbn.org (Jeremie Courreges-Anglas) writes: > >> "Todd C. Miller" writes: >> >>> From source inspection, Net and Free appear to allow read(2) of >>> dirs to succeed. However, since Linux, Mac OS X and Solaris

Re: read(2) on directories

2016-08-08 Thread Theo de Raadt
>> From source inspection, Net and Free appear to allow read(2) of >> dirs to succeed. However, since Linux, Mac OS X and Solaris have >> the EISDIR behavior I think it is probably safe from a portability >> standpoint. I want to explain why I chose the semantic of "read returns 0", about 20

Re: read(2) on directories

2016-08-08 Thread Theo de Raadt
> > "Todd C. Miller" writes: > > > >> From source inspection, Net and Free appear to allow read(2) of > >> dirs to succeed. However, since Linux, Mac OS X and Solaris have > >> the EISDIR behavior I think it is probably safe from a portability > >> standpoint. > >> >

Re: read(2) on directories

2016-08-08 Thread Jeremie Courreges-Anglas
j...@wxcvbn.org (Jeremie Courreges-Anglas) writes: > "Todd C. Miller" writes: > >> From source inspection, Net and Free appear to allow read(2) of >> dirs to succeed. However, since Linux, Mac OS X and Solaris have >> the EISDIR behavior I think it is probably safe

Re: read(2) on directories

2016-08-02 Thread Todd C. Miller
On Tue, 02 Aug 2016 18:42:43 +0200, Jeremie Courreges-Anglas wrote: > So I think that we agree that EISDIR is more useful, and seems safe from > a portability POV. I've built base and x sets on i386, and ajacoutot > ran the ports bulk builds. The two offenders in the ports tree were due > to

Re: read(2) on directories

2016-08-02 Thread Jeremie Courreges-Anglas
"Todd C. Miller" writes: > From source inspection, Net and Free appear to allow read(2) of > dirs to succeed. However, since Linux, Mac OS X and Solaris have > the EISDIR behavior I think it is probably safe from a portability > standpoint. > > We're long past the

Re: read(2) on directories

2016-07-12 Thread Chris Cappuccio
Todd C. Miller [todd.mil...@courtesan.com] wrote: > On Tue, 12 Jul 2016 12:47:46 -0700, Chris Cappuccio wrote: > > > I've personally always liked being able to cat / read() a directory > > since it gives you a peek behind the curtain and reflects the > > reality of how the filesystem is

Re: read(2) on directories

2016-07-12 Thread Todd C. Miller
On Tue, 12 Jul 2016 12:47:46 -0700, Chris Cappuccio wrote: > I've personally always liked being able to cat / read() a directory > since it gives you a peek behind the curtain and reflects the > reality of how the filesystem is constructed. You haven't been able to do that on OpenBSD for a very

Re: read(2) on directories

2016-07-12 Thread Chris Cappuccio
Todd C. Miller [todd.mil...@courtesan.com] wrote: > >From source inspection, Net and Free appear to allow read(2) of > dirs to succeed. However, since Linux, Mac OS X and Solaris have > the EISDIR behavior I think it is probably safe from a portability > standpoint. > > We're long past the days

Re: read(2) on directories

2016-07-12 Thread Todd C. Miller
>From source inspection, Net and Free appear to allow read(2) of dirs to succeed. However, since Linux, Mac OS X and Solaris have the EISDIR behavior I think it is probably safe from a portability standpoint. We're long past the days when opendir(3)/readdir(3) used read(2)... HP-UX and AIX

Re: read(2) on directories

2016-07-12 Thread Todd C. Miller
On Tue, 12 Jul 2016 21:23:51 +0200, Mark Kettenis wrote: > What do other BSDs (including Mac OS X) do? Mac OS X returns EISDIR. - todd

Re: read(2) on directories

2016-07-12 Thread Tim Newsham
On Tue, Jul 12, 2016 at 9:19 AM, Todd C. Miller wrote: > Do you know what other systems return EISDIR for read(2) of a > directory? > Linux: >>> os.open("/", 0) 3 >>> os.read(3, 1024) Traceback (most recent call last): File "", line 1, in OSError: [Errno 21] Is a

Re: read(2) on directories

2016-07-12 Thread Mark Kettenis
> From: j...@wxcvbn.org (Jeremie Courreges-Anglas) > Date: Tue, 12 Jul 2016 21:10:37 +0200 > > Sending this now to get opinions, but I do not plan any change for 6.0. > > Since I started to use OpenBSD I've always found confusing that > > cat /directory/ > > doesn't error out. I initially

Re: read(2) on directories

2016-07-12 Thread Todd C. Miller
Do you know what other systems return EISDIR for read(2) of a directory? - todd

read(2) on directories

2016-07-12 Thread Jeremie Courreges-Anglas
Sending this now to get opinions, but I do not plan any change for 6.0. Since I started to use OpenBSD I've always found confusing that cat /directory/ doesn't error out. I initially assumed that it was historical behavior, but, as hinted by Theo, in rev. 1.1 the behavior was actually to