From 99f8ce096bc5569adbfea1911dbcda24c28d8d8b Mon Sep 17 00:00:00 2001 From: Ben Summers Date: Fri, 14 Oct 2005 08:50:54 +0000 Subject: Box Backup 0.09 with a few tweeks --- lib/common/UnixUser.h | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100755 lib/common/UnixUser.h (limited to 'lib/common/UnixUser.h') diff --git a/lib/common/UnixUser.h b/lib/common/UnixUser.h new file mode 100755 index 00000000..c895eb2a --- /dev/null +++ b/lib/common/UnixUser.h @@ -0,0 +1,37 @@ +// -------------------------------------------------------------------------- +// +// File +// Name: UnixUser.h +// Purpose: Interface for managing the UNIX user of the current process +// Created: 21/1/04 +// +// -------------------------------------------------------------------------- + +#ifndef UNIXUSER__H +#define UNIXUSER__H + +class UnixUser +{ +public: + UnixUser(const char *Username); + UnixUser(uid_t UID, gid_t GID); + ~UnixUser(); +private: + // no copying allowed + UnixUser(const UnixUser &); + UnixUser &operator=(const UnixUser &); +public: + + void ChangeProcessUser(bool Temporary = false); + + uid_t GetUID() {return mUID;} + gid_t GetGID() {return mGID;} + +private: + uid_t mUID; + gid_t mGID; + bool mRevertOnDestruction; +}; + +#endif // UNIXUSER__H + -- cgit v1.2.3 From 8b99bea2180508f1a8720074fa043828583ce98b Mon Sep 17 00:00:00 2001 From: Martin Ebourne Date: Mon, 12 Dec 2005 21:03:38 +0000 Subject: Fixing up svn:executable properties. You may need a new checkout to see this. --- lib/common/UnixUser.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/common/UnixUser.h (limited to 'lib/common/UnixUser.h') diff --git a/lib/common/UnixUser.h b/lib/common/UnixUser.h old mode 100755 new mode 100644 -- cgit v1.2.3 From 46bb5c32a5273b4c7c936569a4da3ca1ecc05ec8 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 29 Jun 2012 22:18:36 +0000 Subject: Allow UnixUser to be created with a std::string for C++ style. --- lib/common/UnixUser.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/common/UnixUser.h') diff --git a/lib/common/UnixUser.h b/lib/common/UnixUser.h index c895eb2a..dafe6aa7 100644 --- a/lib/common/UnixUser.h +++ b/lib/common/UnixUser.h @@ -13,7 +13,7 @@ class UnixUser { public: - UnixUser(const char *Username); + UnixUser(const std::string& Username); UnixUser(uid_t UID, gid_t GID); ~UnixUser(); private: -- cgit v1.2.3