summaryrefslogtreecommitdiff
path: root/lib/common
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2012-06-29 22:18:36 +0000
committerChris Wilson <chris+github@qwirx.com>2012-06-29 22:18:36 +0000
commit46bb5c32a5273b4c7c936569a4da3ca1ecc05ec8 (patch)
tree9fbc79c460c3fc13410eee52edcbad34ba104289 /lib/common
parenta9e867a2392349a76b3dbac30b3b85b22b478579 (diff)
Allow UnixUser to be created with a std::string for C++ style.
Diffstat (limited to 'lib/common')
-rw-r--r--lib/common/UnixUser.cpp4
-rw-r--r--lib/common/UnixUser.h2
2 files changed, 3 insertions, 3 deletions
diff --git a/lib/common/UnixUser.cpp b/lib/common/UnixUser.cpp
index f81b474c..32acacfa 100644
--- a/lib/common/UnixUser.cpp
+++ b/lib/common/UnixUser.cpp
@@ -31,13 +31,13 @@
// Created: 21/1/04
//
// --------------------------------------------------------------------------
-UnixUser::UnixUser(const char *Username)
+UnixUser::UnixUser(const std::string& Username)
: mUID(0),
mGID(0),
mRevertOnDestruction(false)
{
// Get password info
- struct passwd *pwd = ::getpwnam(Username);
+ struct passwd *pwd = ::getpwnam(Username.c_str());
if(pwd == 0)
{
THROW_EXCEPTION(CommonException, CouldNotLookUpUsername)
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: