Make using `realpath` safer
Merge pull request #424 from greezybacon/issue/361

Make using `realpath` safer

Reviewed-By: Peter Rotich <peter@osticket.com>