Signed-off-by: Greg Farnum <gfarnum@redhat.com>
void set_filepath2(const filepath& fp) { path2 = fp; }
void set_string2(const char *s) { path2.set_path(s, 0); }
void set_caller_perms(const UserPerm& _perms) {
- perms = _perms;
+ perms.shallow_copy(_perms);
head.caller_uid = perms.uid();
head.caller_gid = perms.gid();
}
deep_copy(*this, o);
return *this;
}
- // FIXME: stop doing a deep-copy all the time. We need it on stuff
- // that lasts longer than a single "syscall", but not for MetaRequests et al
+
uid_t uid() const { return m_uid; }
gid_t gid() const { return m_gid; }
bool gid_in_groups(gid_t gid) const {
gid_count = count;
}
void take_gids() { alloced_gids = true; }
+ void shallow_copy(const UserPerm& o) {
+ m_uid = o.m_uid;
+ m_gid = o.m_gid;
+ gid_count = o.gid_count;
+ gids = o.gids;
+ alloced_gids = false;
+ }
};
#endif