Uni/Passwd#

Interface to the passwd struct from <pwd.h>.

Info

To use declarations from this page, include the <essence/uni/passwd.hpp> header.

class uni::password#

Wrapper for the Unix passwd C struct.

password::password()#

Constructor which queries the process invoker’s user id.

password::password(uid_t i)#

Constructor accepting a user id.

password::password(const std::string &pname)#

Constructor accepting a username.

uid_t uid() const noexcept#

Get the user id.

gid_t gid() const noexcept#

Get the group id.

std::string name() const#

Get the user’s username.

std::string pass() const#

Get the user password, typically x, as the real password is often handled by shadow.

std::string gecos() const#

Get the gecos (AKA the comment or real name) of the entry.

std::filesystem::path directory() const#

Get the directory of the entry.

std::string shell() const#

Get the entry’s shell.

std::string str() const#

Get a string representation of the passwd, in the format returned by getent