follow symlinks and map uid/gid correctly.