33 long bufSize = ::sysconf(_SC_GETPW_R_SIZE_MAX);
39 std::string message =
"with argument _SC_GETPW_R_SIZE_MAX while getting info about user " + s_name;
40 throw OksSystem::OksSystemCallIssue(
ERS_HERE, errno,
"sysconf", message.c_str());
45 struct passwd *result;
46 char* buf =
new char[bufSize];
48 int res = ::getpwnam_r(s_name.c_str(), &pwd, buf, bufSize, &result);
54 std::string eMsg =
"User " + s_name +
" not found";
55 throw OksSystem::OksSystemCallIssue(
ERS_HERE, errno,
"getpwnam_r", eMsg.c_str());
59 std::string message =
"while getting info about user " + s_name;
60 throw OksSystem::OksSystemCallIssue(
ERS_HERE, res,
"getpwnam_r", message.c_str());
109 long bufSize = ::sysconf(_SC_GETPW_R_SIZE_MAX);
115 std::ostringstream message;
116 message <<
"with argument _SC_GETPW_R_SIZE_MAX while getting info about user with id " <<
m_user_id;
117 throw OksSystem::OksSystemCallIssue(
ERS_HERE, errno,
"sysconf", message.str().c_str());
122 struct passwd *result;
123 char* buf =
new char[bufSize];
125 int res = ::getpwuid_r(
m_user_id, &pwd, buf, bufSize, &result);
133 std::ostringstream eMsg;
134 eMsg <<
"User " <<
m_user_id <<
" not found";
135 throw OksSystem::OksSystemCallIssue(
ERS_HERE, errno,
"getpwuid_r", eMsg.str().c_str());
139 std::ostringstream message;
140 message <<
"while getting info about user with id " <<
m_user_id;
141 throw OksSystem::OksSystemCallIssue(
ERS_HERE, res,
"getpwnam_r", message.str().c_str());
155 long bufSize = ::sysconf(_SC_GETPW_R_SIZE_MAX);
169 struct passwd *result;
170 char* buf =
new char[bufSize];
171 int res = ::getpwuid_r(
m_user_id, &pwd, buf, bufSize, &result);