Rudiments
userentry.h
1 // Copyright (c) 2002-2014 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_USERENTRY_H
5 #define RUDIMENTS_USERENTRY_H
6 
7 #include <rudiments/private/userentryincludes.h>
8 
9 class userentryprivate;
10 
13 class RUDIMENTS_DLLSPEC userentry {
14  public:
15 
17  userentry();
18 
21  userentry(const userentry &u);
22 
25  userentry &operator=(const userentry &u);
26 
28  ~userentry();
29 
32  bool initialize(const char *username);
33 
36  bool initialize(uid_t userid);
37 
39  const char *getName() const;
40 
42  const char *getPassword() const;
43 
54  uid_t getUserId() const;
55 
63  const char *getSidString() const;
64  const void *getSid() const;
65  uint64_t getSidSize() const;
66 
68  gid_t getPrimaryGroupId() const;
69 
71  const char *getRealName() const;
72 
74  const char *getHomeDirectory() const;
75 
77  const char *getShell() const;
78 
80  const char *getEncryptedPassword() const;
81 
85  long getLastChangeDate() const;
86 
89  int32_t getDaysBeforeChangeAllowed() const;
90 
93  int32_t getDaysBeforeChangeRequired() const;
94 
97  int32_t getDaysBeforeExpirationWarning() const;
98 
101  int32_t getDaysOfInactivityAllowed() const;
102 
105  int32_t getExpirationDate() const;
106 
108  int32_t getFlag() const;
109 
110 
119  static char *getName(uid_t userid);
120 
127  static uid_t getUserId(const char *username);
128 
139  static char *getSidString(const char *username);
140 
146  static bool platformSupportsFormalSid();
147 
150  static bool needsMutex();
151 
155  static void setMutex(threadmutex *mtx);
156 
157  #include <rudiments/private/userentry.h>
158 };
159 
160 #endif
Definition: threadmutex.h:13
Definition: userentry.h:13