The match_gid() function needed to affect the *flags_ptr value