wasi-filesystem icon indicating copy to clipboard operation
wasi-filesystem copied to clipboard

Should `readlink` fail if the target is absolute?

Open sunfishcode opened this issue 4 years ago • 2 comments

Since WASI can't currently open symlinks with absolute paths, should readlink, fail when reading a symlink with an absolute path? That would avoid accidental leakage of host filesystem paths in some cases.

sunfishcode avatar Jul 14 '20 17:07 sunfishcode

Hmm to convolute matters a bit more, most if not all "major" implementations allow remapping of pre-opened directories so they can be opened if the directory is mapped...

caspervonb avatar Jul 14 '20 18:07 caspervonb

That's a good point; if someone is using readlink to do manual path resolution with preopens, this would break them.

sunfishcode avatar Jul 16 '20 07:07 sunfishcode