2#include <cosmos/PasswdInfo.hxx>
3#include <cosmos/private/InfoBase.hxx>
4#include <cosmos/utils.hxx>
9 auto call = [&](
struct passwd **res) ->
int {
10 return getpwnam_r(name.raw(), &
m_info,
15 m_valid =
getInfo(call,
"getpwnam_r()");
22 auto call = [&](
struct passwd **res) ->
int {
23 return getpwuid_r(to_integral(uid), &
m_info,
28 m_valid =
getInfo(call,
"getpwuid_r()");
bool getInfo(std::function< int(struct passwd **)> get_func, const char *errlabel)
std::vector< char > m_buf
SysString passwd() const
Returns the optional encrypted password.
PasswdInfo(const SysString name)
Obtains PasswdInfo for the given username name.
Wrapper type around a C-style string for use with system APIs.