Re: [9fans] `test -x` returns wrong results for directories

2020-06-09 Thread Ethan Gardener
On Mon, Jun 8, 2020, at 3:13 AM, Charles Forsyth wrote: >> "search" is exactly the wrong word for what this bit does, because if you >> don't have "search" permission, the one thing you can still do is look at >> the names. > > in ramfs, but that's a bug that no-one had noticed oh it's the sam

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread Charles Forsyth
I see I'd misapplied the rule in walk(5) so fossil is fine. It has to do with searching from . when you are there, which makes sense, not when entering the directory from its parent, so ignore that part of my earlier post. On Mon, Jun 8, 2020 at 3:13 AM Charles Forsyth wrote: > "search" is exac

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread Charles Forsyth
> > "search" is exactly the wrong word for what this bit does, because if you > don't have "search" permission, the one thing you can still do is look at > the names. in ramfs, but that's a bug that no-one had noticed On Mon, Jun 8, 2020 at 3:05 AM wrote: > >>> So, cd'ing into a directory with

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread ori
>>> So, cd'ing into a directory withut +x leads >>> to an inescapabler trap. >> ... >> fossil just moved up another notch in my estimation because directory search >> restriction is so broken. > > o...@eigenstate.org, what version of fossil were your experiments done on? > My observations are dif

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread Richard Miller
>> So, cd'ing into a directory withut +x leads >> to an inescapabler trap. > ... > fossil just moved up another notch in my estimation because directory search > restriction is so broken. o...@eigenstate.org, what version of fossil were your experiments done on? My observations are different: te

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread Ethan Gardener
On Sat, Jun 6, 2020, at 10:13 PM, o...@eigenstate.org wrote: > > it's open() which is failing. i suppose it should. > > > > if the open fails, maybe access should stat the file, and if it's a > > directory, try dirread(2). or maybe just opening it for reading will > > work. i don't know, i'm new t

Re: [9fans] `test -x` returns wrong results for directories

2020-06-07 Thread Ethan Gardener
On Sat, Jun 6, 2020, at 2:25 PM, Charles Forsyth wrote: > execute permission on files, meaning here non-directories, is a special > variant of read. a file with mode 0111 can be opened with OEXEC and read(2) > will work as well as exec(2), > but can't be opened with OREAD, because it's not got an

Re: [9fans] `test -x` returns wrong results for directories

2020-06-06 Thread ori
> it's open() which is failing. i suppose it should. > > if the open fails, maybe access should stat the file, and if it's a > directory, try dirread(2). or maybe just opening it for reading will > work. i don't know, i'm new to this bit of plan 9 & i haven't slept. This is a bit subtle, though -

Re: [9fans] `test -x` returns wrong results for directories

2020-06-06 Thread Charles Forsyth
execute permission on files, meaning here non-directories, is a special variant of read. a file with mode 0111 can be opened with OEXEC and read(2) will work as well as exec(2), but can't be opened with OREAD, because it's not got any of 0444 set. bits 0111 distinguish a file with contents that are

Re: [9fans] `test -x` returns wrong results for directories

2020-06-06 Thread Alexander Kapshuk
On Sat, Jun 6, 2020 at 9:38 AM Ethan Gardener wrote: > > On Fri, Jun 5, 2020, at 8:22 PM, Richard Miller wrote: > > Looks to me like access(2) is not doing the right thing for directory > > execute (=search) permission. > > thanks for the tip. access is a very simple function. it doesn't do the ri

Re: [9fans] `test -x` returns wrong results for directories

2020-06-05 Thread Ethan Gardener
On Fri, Jun 5, 2020, at 8:22 PM, Richard Miller wrote: > Looks to me like access(2) is not doing the right thing for directory > execute (=search) permission. thanks for the tip. access is a very simple function. it doesn't do the right thing, but there's a reason: BUGS Since file

Re: [9fans] `test -x` returns wrong results for directories

2020-06-05 Thread Richard Miller
Looks to me like access(2) is not doing the right thing for directory execute (=search) permission. -- 9fans: 9fans Permalink: https://9fans.topicbox.com/groups/9fans/Tdd7a9b1b32d01f54-M4da73ba68bd93f0827b0a15c Delivery options: https://9fans.topicbox.com/