Add open_dir_with_privilege() to ensure we're opening the correct directory when...