sanitize the path before calling an external program