switch set{gid,uid} to setres{gid,uid}