7 #include <arc/Thread.h> 24 bool set(
const struct passwd*);
31 User(
const std::string& name,
const std::string& group=
"");
34 User(
int uid,
int gid=-1);
36 operator bool()
const {
44 const std::string&
Name(
void)
const {
48 const std::string&
Home(
void)
const {
98 static int suid_count;
99 static int suid_uid_orig;
100 static int suid_gid_orig;
108 operator bool(
void) {
return valid; };
Arc namespace contains all core ARC classes.
Definition: ArcConfig.h:11
Simple triggered condition.
Definition: Thread.h:150
bool operator==(const std::string &n)
Returns true if this User's name is the same as n.
Definition: User.h:60
UserSwitch(int uid, int gid)
Switch uid and gid.
const std::string & Name(void) const
Returns the name of this user.
Definition: User.h:44
bool SwitchUser() const
Change the owner of the current process.
int check_file_access(const std::string &path, int flags) const
Check if this User has the rights specified by flags on the given path.
int get_gid(void) const
Returns the user's gid.
Definition: User.h:56
bool operator!() const
Returns true is this is not a valid user.
Definition: User.h:40
~UserSwitch(void)
Switch back to old uid and gid and release lock on this class.
User()
Construct user from current process owner.
Class for temporary switching of user id.
Definition: User.h:95
const std::string & Home(void) const
Returns the path to the user's home directory.
Definition: User.h:48
Platform independent representation of system user.
Definition: User.h:16
int get_uid(void) const
Returns the user's uid.
Definition: User.h:52