On OpenBSD 6.6 amd64 patch 006, i get peculiar results from readlink(1)
with arguments -f with a symlink to /

$ readlink -f /
/

$ ln -s / test; readlink -f test; rm test
readlink: test: Is a directory

$ readlink -f /.
/

$ ln -s /. test; readlink -f test; rm test
/

I have tried with many arguments to readlink -f and the result seems to be
the same for a direct argument as for a symbolic link with the same
content.  Except for a symbolic link to exactly /

Bug|Glitch|Feature?

I also noticed that if readlink -f is told to traverse above / it this that
is ok.  Would that merit an error instead?

$ readlink -f /var
/var
$ readlink -f /../var
/var
$ readlink -f /../../var
/var

Best regards
-- 

/ Raimo Niskanen, Erlang/OTP, Ericsson AB

Reply via email to