Alternative solution of 427483c660 commit.

It's using 'realpath' and 'grep -E' to find if the file path is outside of SNOTES_DB path.

I prefer this solution because 427483c660 restricts the user.