Rudiments
shadowentry.h
1 // Copyright (c) 2002 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_SHADOWENTRY_H
5 #define RUDIMENTS_SHADOWENTRY_H
6 
7 #include <rudiments/private/shadowentryincludes.h>
8 
9 #ifdef RUDIMENTS_NAMESPACE
10 namespace rudiments {
11 #endif
12 
13 class shadowentryprivate;
14 
17 class RUDIMENTS_DLLSPEC shadowentry {
18  public:
19 
26  static bool getEncryptedPassword(const char *username,
27  char **password);
28 
34  static bool getLastChangeDate(const char *username,
35  long *lstchg);
36 
41  static bool getDaysBeforeChangeAllowed(
42  const char *username,
43  int32_t *min);
44 
49  static bool getDaysBeforeChangeRequired(
50  const char *username,
51  int32_t *max);
52 
58  static bool getDaysBeforeExpirationWarning(
59  const char *username,
60  int32_t *warn);
61 
66  static bool getDaysOfInactivityAllowed(
67  const char *username,
68  int32_t *inact);
69 
75  static bool getExpirationDate(const char *username,
76  int32_t *expire);
77 
82  static bool getFlag(const char *username,
83  int32_t *flag);
84 
86  shadowentry();
87 
90  shadowentry(const shadowentry &s);
91 
94  shadowentry &operator=(const shadowentry &s);
95 
97  ~shadowentry();
98 
101  bool initialize(const char *username);
102 
104  const char *getName() const;
105 
107  const char *getEncryptedPassword() const;
108 
112  long getLastChangeDate() const;
113 
116  int32_t getDaysBeforeChangeAllowed() const;
117 
120  int32_t getDaysBeforeChangeRequired() const;
121 
125  int32_t getDaysBeforeExpirationWarning() const;
126 
129  int32_t getDaysOfInactivityAllowed() const;
130 
133  int32_t getExpirationDate() const;
134 
137  int32_t getFlag() const;
138 
140  void print() const;
141 
144  static bool needsMutex();
145 
149  static void setMutex(mutex *mtx);
150 
151  #include <rudiments/private/shadowentry.h>
152 };
153 
154 #ifdef RUDIMENTS_NAMESPACE
155 }
156 #endif
157 
158 #endif