9front - general discussion about 9front
 help / color / mirror / Atom feed
* test -x broken & rc-httpd has broken workaround
@ 2020-03-15 17:55 Ethan Gardener
  2020-06-05 12:47 ` [9front] " Ethan Gardener
  0 siblings, 1 reply; 2+ messages in thread
From: Ethan Gardener @ 2020-03-15 17:55 UTC (permalink / raw)
  To: 9front

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 file    True if the file exists and has execute permis-
term% 

/rc/bin/rc-httpd/handlers/dir-index has a broken workaround for this. the workaround is to omit a necessary -a like so:
    if(! test -r $full_path -x $full_path){
it should be:
    if(! test -r $full_path -a -x $full_path) {
evidently, omitting -a (and) makes it default to logical or, breaking the logic of this line. (this default in the absence of -a or -o is undocumented in plan 9 & gnu.) the indended logic (with -a) is useful, it helps with debugging folder permissions.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-05 12:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15 17:55 test -x broken & rc-httpd has broken workaround Ethan Gardener
2020-06-05 12:47 ` [9front] " Ethan Gardener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).