FBB::User(3bobcat) | /etc/passwd user info | FBB::User(3bobcat) |
FBB::User - Provides the /etc/passwd info of the current user
#include <bobcat/user>
Linking option: -lbobcat
This class retrieves the information of the current user from the information in /etc/passwd. The class is a simple wrapper class around the getpwent(3) function.
FBB
All constructors, members, operators and manipulators, mentioned in this
man-page, are defined in the namespace FBB.
-
The copy and move assignment operators are available.
#include <bobcat/user> #include <iostream> using namespace std; using namespace FBB; int main() {
User user;
cout << "\n"
"name : " << user.name() << "\n" <<
"password : " << user.password() << "\n" <<
"user id : " << user.userid() << "\n" <<
"group id : " << user.groupid() << "\n" <<
"real name : " << user.realname() << "\n" <<
"home dir : " << user.homedir() << "\n" <<
"shell : " << user.shell() << "\n" << endl; }
bobcat/user - defines the class interface
If the user is a member of multiple groups, only the group id listed in /etc/passwd is returned by groupid().
If shadow passwording is used, the string returned by password() will probably not contain the encrypted password.
Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.
This is free software, distributed under the terms of the GNU General Public License (GPL).
Frank B. Brokken (f.b.brokken@rug.nl).
2005-2018 | libbobcat-dev_4.08.06-x.tar.gz |