vul_user_info.h
Go to the documentation of this file.
1 // This is core/vul/vul_user_info.h
2 #ifndef vul_user_info_h_
3 #define vul_user_info_h_
4 //:
5 // \file
6 // \brief Reads information about a user from the password file.
7 // \author Andrew W. Fitzgibbon, Oxford RRG
8 // \date 08 Apr 1999
9 //
10 // \verbatim
11 // Modifications
12 // 990408 AWF Initial version.
13 // 010321 C. Beeston documentation changes
14 // \endverbatim
15 //-----------------------------------------------------------------------------
16 
17 #include <string>
18 #ifdef _MSC_VER
19 # include <vcl_msvc_warnings.h>
20 #endif
21 
22 //: Reads information about a user from the password file
23 class vul_user_info
24 {
25  public:
26  typedef unsigned long uid_type;
27 
28  bool ok;
31  std::string name; // login name
32  std::string home_directory;
33  std::string full_name;
34  std::string shell;
35  std::string passwd;
36 
37  // Constructors/Destructors--------------------------------------------------
38 
39  //: Lookup info from numeric user-id
40  vul_user_info(uid_type u_id) { init(u_id); }
41  //: Lookup info from login name
42  vul_user_info(char const* nam) { init(nam); }
43  //: Lookup info from login name
44  vul_user_info(std::string const& nam) { init(nam.c_str()); }
45  //: NYI
46  void init(uid_type);
47  //: initialise vul_user_info for given login name
48  void init(char const* nam);
49 };
50 
51 #endif // vul_user_info_h_
Reads information about a user from the password file.
Definition: vul_user_info.h:22
uid_type gid
Definition: vul_user_info.h:29
std::string passwd
Definition: vul_user_info.h:34
void init(uid_type)
NYI.
std::string name
Definition: vul_user_info.h:30
vul_user_info(uid_type u_id)
Lookup info from numeric user-id.
Definition: vul_user_info.h:39
unsigned long uid_type
Definition: vul_user_info.h:25
std::string full_name
Definition: vul_user_info.h:32
uid_type uid
Definition: vul_user_info.h:28
std::string shell
Definition: vul_user_info.h:33
std::string home_directory
Definition: vul_user_info.h:31