ncurses 6.2_p20200308-r0 has wrong terminfo search order
This update came in the last two weeks. Ncurses changed the search order, so that now /usr/share/terminfo gets searched before $HOME/.terminfo. I did a chmod 0000 on /usr/share/terminfo so attempting to use it fails, but still shows the order in strace:
stat("/usr/share/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/home/nero/.terminfo", {st_mode=S_IFDIR|S_ISGID|0755, st_size=4096, ...}) = 0
stat("/etc/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
stat("/lib/terminfo", 0x7ffd1a7bf4b0) = -1 ENOENT (No such file or directory)
stat("/usr/lib/terminfo", {st_mode=S_IFDIR|0755, st_size=4096, ...}) = 0
access("/usr/share/terminfo/v/vt520", R_OK) = -1 EACCES (Permission denied)
access("/home/nero/.terminfo/v/vt520", R_OK) = 0
open("/home/nero/.terminfo/v/vt520", O_RDONLY) = 3
You can see that /usr/share/terminfo/v/vt520
is attempted to use before /home/nero/.terminfo/v/vt520
.