2005-01-23 05:27:24 -04:00
|
|
|
\section{\module{spwd} ---
|
|
|
|
The shadow password database}
|
|
|
|
|
|
|
|
\declaremodule{builtin}{spwd}
|
|
|
|
\platform{Unix}
|
|
|
|
\modulesynopsis{The shadow password database (\function{getspnam()} and friends).}
|
2005-08-27 14:04:58 -03:00
|
|
|
\versionadded{2.5}
|
2005-01-23 05:27:24 -04:00
|
|
|
|
|
|
|
This module provides access to the \UNIX{} shadow password database.
|
2005-08-27 14:04:58 -03:00
|
|
|
It is available on various \UNIX{} versions.
|
2005-01-23 05:27:24 -04:00
|
|
|
|
|
|
|
You must have enough privileges to access the shadow password database
|
|
|
|
(this usually means you have to be root).
|
|
|
|
|
|
|
|
Shadow password database entries are reported as a tuple-like object, whose
|
|
|
|
attributes correspond to the members of the \code{spwd} structure
|
|
|
|
(Attribute field below, see \code{<shadow.h>}):
|
|
|
|
|
|
|
|
\begin{tableiii}{r|l|l}{textrm}{Index}{Attribute}{Meaning}
|
|
|
|
\lineiii{0}{\code{sp_nam}}{Login name}
|
|
|
|
\lineiii{1}{\code{sp_pwd}}{Encrypted password}
|
|
|
|
\lineiii{2}{\code{sp_lstchg}}{Date of last change}
|
|
|
|
\lineiii{3}{\code{sp_min}}{Minimal number of days between changes}
|
|
|
|
\lineiii{4}{\code{sp_max}}{Maximum number of days between changes}
|
|
|
|
\lineiii{5}{\code{sp_warn}}{Number of days before password expires to warn user about it}
|
|
|
|
\lineiii{6}{\code{sp_inact}}{Number of days after password expires until account is blocked}
|
|
|
|
\lineiii{7}{\code{sp_expire}}{Number of days since 1970-01-01 until account is disabled}
|
|
|
|
\lineiii{8}{\code{sp_flag}}{Reserved}
|
|
|
|
\end{tableiii}
|
|
|
|
|
|
|
|
The sp_nam and sp_pwd items are strings, all others are integers.
|
|
|
|
\exception{KeyError} is raised if the entry asked for cannot be found.
|
|
|
|
|
|
|
|
It defines the following items:
|
|
|
|
|
|
|
|
\begin{funcdesc}{getspnam}{name}
|
|
|
|
Return the shadow password database entry for the given user name.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
\begin{funcdesc}{getspall}{}
|
|
|
|
Return a list of all available shadow password database entries, in arbitrary order.
|
|
|
|
\end{funcdesc}
|
|
|
|
|
|
|
|
|
|
|
|
\begin{seealso}
|
2005-08-27 14:04:58 -03:00
|
|
|
\seemodule{grp}{An interface to the group database, similar to this.}
|
2005-01-23 05:27:24 -04:00
|
|
|
\seemodule{pwd}{An interface to the normal password database, similar to this.}
|
|
|
|
\end{seealso}
|