Thanks everyone for important pointers!
The problem seems to be brought by bash between alpine official container
3.13 and any later versions.
The external command /usr/bin/[ and sh/ash from busybox both work
correctly, see:
5513a6a8232d:/task/output/files$ cat /etc/alpine-release
3.17.1
5513a6a8232d:/task/output/files$ busybox | head -1
BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary.
5513a6a8232d:/task/output/files$ echo $BASH_VERSION
5.2.15(1)-release
5513a6a8232d:/task/output/files$ [ -r cnb_rate_eur_czk.csv ] && echo READABLE
5513a6a8232d:/task/output/files$ [[ -r cnb_rate_eur_czk.csv ]] && echo READABLE
5513a6a8232d:/task/output/files$ /usr/bin/[ -r cnb_rate_eur_czk.csv ] &&
echo READABLE
READABLE
5513a6a8232d:/task/output/files$ /usr/bin/[[ -r cnb_rate_eur_czk.csv ]] &&
echo READABLE
READABLE
5513a6a8232d:/task/output/files$ ls -la /bin/*sh
lrwxrwxrwx 1 root root 12 Jan 9 12:46 /bin/ash ->
/bin/busybox
-rwxr-xr-x 1 root root 789064 Dec 14 02:37 /bin/bash
lrwxrwxrwx 1 root root 12 Jan 9 12:46 /bin/fdflush ->
/bin/busybox
lrwxrwxrwx 1 root root 12 Jan 9 12:46 /bin/sh ->
/bin/busybox
5513a6a8232d:/task/output/files$ /bin/sh
/task/output/files $ set| head -1
BB_ASH_VERSION='1.35.0'
/task/output/files $ [ -r cnb_rate_eur_czk.csv ] && echo READABLE
READABLE
There was a bash-5.1.16-r0 in alpine:3.13, which was the latest version,
where test -r worked correctly for me.
So sorry for bugging here. I need to find out now what to do next to pursue
this.
Thanks again,
Vlada
On 13. 02. 23 12:35, alice wrote:On Mon Feb 13, 2023 at 12:14 PM CET,
Dominique Martinet wrote:
b4adb3ccf49f:/task/output/files$ id
uid=2001(setup) gid=2000(project) groups=2000(project),2000(project)
b4adb3ccf49f:/task/output/files$ ls -lad . .. cnb_rate_eur_czk.csv
drwxr-xr-x 1 root root 40 Feb 13 11:08 .
drwxrwx--- 1 setup project 10 Feb 13 11:07 ..
-rw-r--r-- 1 task project 4 Feb 13 11:01 cnb_rate_eur_czk.csv
b4adb3ccf49f:/task/output/files$ busybox | head -n 1
BusyBox v1.35.0 (2022-11-19 10:13:10 UTC) multi-call binary.
b4adb3ccf49f:/task/output/files$ [ -r cnb_rate_eur_czk.csv ] && echo READABLE
READABLE
b4adb3ccf49f:/task/output/files$ [[ -r cnb_rate_eur_czk.csv ]] && echo READABLE
READABLE
b4adb3ccf49f:/task/output/files$ /usr/bin/[ -r cnb_rate_eur_czk.csv ] && echo
READABLE
READABLE
b4adb3ccf49f:/task/output/files$ cat /etc/alpine-release
3.17.2
this doesn't seem like accurate reproduction-
the . directory is not '770' like originally.
nevertheless, i can't reproduce this on any alpine version with the same
directory layout in a container, so indeed, "strace or it didn't happen" is
accurate.
the container build output curiously has a "bash" in the list of packages
installed- so i tried running this from inside bash in case the bash builtins
for this were broken- no difference.
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox