shadowentry Class Reference

## Public Member Functions

| shadowentry ()
| shadowentry (const shadowentry &s)
shadowentry & | operator= (const shadowentry &s)
| ~shadowentry ()
bool | initialize (const char *username)
const char * | getName () const
const char * | getEncryptedPassword () const
long | getLastChangeDate () const
int32_t | getDaysBeforeChangeAllowed () const
int32_t | getDaysBeforeChangeRequired () const
int32_t | getDaysBeforeExpirationWarning () const
int32_t | getDaysOfInactivityAllowed () const
int32_t | getExpirationDate () const
int32_t | getFlag () const

## Static Public Member Functions

static bool | needsMutex ()
static void | setMutex (threadmutex *mtx)

## Detailed Description

The shadowentry class provides methods for retrieving entries from the shadow password file (/etc/shadow on unix).

## Constructor & Destructor Documentation

shadowentry::shadowentry | ( |  | ) |

Creates an instance of the shadowentry class.

shadowentry::shadowentry | ( | const shadowentry & | s | ) |

Creates an instance of the shadowentry class that is a copy of "s".

shadowentry::~shadowentry | ( |  | ) |

Deletes this instance of the shadowentry class.

## Member Function Documentation

int32_t shadowentry::getDaysBeforeChangeAllowed | ( |  | ) | const

Returns the number of days before the password for the shadow entry may be changed.

int32_t shadowentry::getDaysBeforeChangeRequired | ( |  | ) | const

Returns the number of days before the password for the shadow entry is required to be changed.

int32_t shadowentry::getDaysBeforeExpirationWarning | ( |  | ) | const

Returns the number of days before a warning that the password for the shadow entry will expire should be displayed.

int32_t shadowentry::getDaysOfInactivityAllowed | ( |  | ) | const

Returns the number of days of inactivity that are allowed for the shadow entry before the password will expire.

const char* shadowentry::getEncryptedPassword | ( |  | ) | const

Returns the encrypted password of the shadow entry.

int32_t shadowentry::getExpirationDate | ( |  | ) | const

Returns the expiration date of the shadown entry. The date is returned as the number of seconds since 1970.

int32_t shadowentry::getFlag | ( |  | ) | const

Returns the system-specific set of flags for the shadow entry.

long shadowentry::getLastChangeDate | ( |  | ) | const

Returns the last time that the password for the shadow entry was changed. The time is given as the number of seconds since 1970.

const char* shadowentry::getName | ( |  | ) | const

Returns the name of the shadow entry.

bool shadowentry::initialize | ( | const char * | username | ) |

Looks up a shadow entry by name. Returns true on success and false on failure.

static bool shadowentry::needsMutex | ( |  | ) |

static

Returns true if this class needs a mutex to operate safely in a threaded environment and false otherwise.

shadowentry& shadowentry::operator= | ( | const shadowentry & | s | ) |

Makes this instance of the shadowentry class identical to "s".

static void shadowentry::setMutex | ( | threadmutex * | mtx | ) |

static

Allows you to supply a mutex is the class needs it. (see needsMutex()). If your application is not multithreaded, then there is no need to supply a mutex.