Symlinks inspectors not working correclty

(imported topic written by MattPeterson)

I’m having issues finding symlinks in Linux if the file the link points to is missing.

If the fine and link both exist the inspectors work fine:

ls -lrta

-rw-r–r-- 1 root root 7 Jul 24 09:29 testfile

lrwxrwxrwx 1 root root 8 Jul 24 09:30 testlink -> testfile

Q: exist symlink whose (name of it contains “testlink”) of folder “/var/opt/test”

A: True

T: 10521

However, if I the file is missing (testfile in this case), then I cannot use the statement I used above.

rm -rf testfile

ls -lrt

total 4

lrwxrwxrwx 1 root root 8 Jul 24 09:30 testlink -> testfile

Q: exist symlink whose (name of it contains “testlink”) of folder “/var/opt/test”

A: False

T: 8535

The statement above should return true, because I’m looking for the existence of the symlink and not the file. If I look for the symlink directly (without the whose statement), it returns true…

Q: exist symlink “testlink” of folder “/var/opt/test”

A: True

T: 584

The statement below should return the name of my sylink, however if the file is missing, then it will not return anything.

Q: names of symlinks of folder “/var/opt/test”

T: 353

(imported comment written by jgstew)

This does sound like a bug. I would file a PMR and RFE and link back to this and post the link to the RFE here so we can vote on it.

Sorry to bring back from the dead…

RFE 63735 has been opened for this issue (symlink inspectors do not work as advertised on broken symlinks)