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/groups/9fans/subscription


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

2020-06-05 Thread Ethan Gardener
in rc-httpd, i rely on `test -x` to check if a directory is searchable. this 
works in plan9port, 9base, inferno (with root from host fs), gnu coreutils, and 
freebsd. it doesn't work in 9front, nor in labs plan 9. (the labs version 
tested was a live-cd from 2010.)

term% test -x static ; echo $status
test 13436: false
term% ls -ld static
d-rwxrwxr-x M 24 ethan adm 0 Mar 15 14:58 static
term% man 1 test | grep -- -x
  -x fileTrue if the file exists and has execute permis-
term% 

the word 'wrong' in the subject may be a little strong, but there doesn't seem 
to be an alternative test for searchable directories other than mucking about 
with ls -l | sed or awk. test(1) has nothing to say on the matter.

for anyone using rc-httpd, the intended logic in rc-httpd/handlers/dir-index is 
this:
if(! test -r $full_path -a -x $full_path) {
a suitable workaround is to remove ` -a -x $full_path`.
9front's version of rc-http has a workaround which may break when test is fixed.
/rc/bin/rc-httpd/handlers/dir-index:/-x
if(! test -r $full_path -x $full_path){
in plan 9 and gnu coreutils, this effectively replaces the logical and (-a) 
with a logical or. freebsd reports an error, 'unexpected operator'.

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tdd7a9b1b32d01f54-M4c8942fa39b91446ff4eb885
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


[9fans] Re: HOWTO: Net booting Plan 9 on RPi 3s and 4s

2020-06-05 Thread Skip Tavakkolian
there is a cleaner patch now:

/n/sources/patch/rpi-netboot-dhcpd

On Wed, Jun 3, 2020 at 6:18 PM Skip Tavakkolian 
wrote:

> The patch is on 9p.io:
>
> /n/sources/patch/dhcpd-rpi-pxeboot
>
>
> On Wed, Jun 3, 2020 at 12:43 PM Skip Tavakkolian <
> skip.tavakkol...@gmail.com> wrote:
>
>> Note that RPi 4 DHCP requests include a parameter request for TFTP Server
>> Name (66).  There is a link in the doc to the diffs for
>> /sys/src/cmd/ip/dhcpd/dhcpd.c. I'll submit a patch to 9p.io soon.
>>
>> On Wed, Jun 3, 2020 at 11:26 AM Skip Tavakkolian <
>> skip.tavakkol...@gmail.com> wrote:
>>
>>>
>>> FYI, I've updated the HOWTO to include RPi4's. It's here:
>>>
>>>
>>> https://docs.google.com/document/d/1hgcsAgk_FJRYW5r7LVeY23sTZN_giUit-8ra-dlW9ng
>>>
>>>
>>>

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Teeceb2ca38619b36-M783c8cedce3d09ae17286b02
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription