About v11, ISTM that the recursive function should check for symbolic links and possibly avoid them:

 sh> cd data/base
 sh> ln -s .. foo

 psql> SELECT * FROM pg_ls_dir_recurse('.');
 ERROR:  could not stat file 
"./base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo/base/foo":
 Too many levels of symbolic links
 CONTEXT:  SQL function "pg_ls_dir_recurse" statement 1

This probably means using lstat instead of (in supplement to?) stat, and probably tell if something is a link, and if so not recurse in them.

--
Fabien.


Reply via email to