ast
ast copied to clipboard
`pathexists()` function does not invalidate cache
Description of problem:
pathexists()
function caches file permissions in a tree structure, but does not invalidate the entries. This will return invalid results if file permissions on cached path changes.
Ksh version: 2017.0.0-devel-2552-g68ea9cb8
As is typical in this project the tree structure incorrectly defines the variable length element at the end of the structure to have a non-zero length:
char name[1];
This might be related to the static Tree_t tree;
definition since using that object requires the variable length name
structure refer to an empty string. But that is an awful way to ensure that since it masks off by one problems with dynamically allocating that structure.
P.S., Google (not to mention searching the code in this project) suggests that config var PATH_ATTRIBUTES
is wholly undocumented. Which is another reason to remove the AST getconf code.