We always call take_gids after init_gids, so just squash them together.
Reported-by: Jos Collin <jcollin@redhat.com>
Signed-off-by: Jeff Layton <jlayton@redhat.com>
void init_gids(gid_t* _gids, int count) {
gids = _gids;
gid_count = count;
+ alloced_gids = true;
}
- void take_gids() { alloced_gids = true; }
void shallow_copy(const UserPerm& o) {
m_uid = o.m_uid;
m_gid = o.m_gid;
if (count > 0) {
perms.init_gids(gids, count);
- perms.take_gids();
} else if (count < 0) {
derr << __func__ << ": getgroups failed: " << cpp_strerror(-count)
<< dendl;