Martin v. Löwis | c300175 | 2005-01-23 09:27:24 +0000 | [diff] [blame] | 1 | \section{\module{spwd} --- |
| 2 | The shadow password database} |
| 3 | |
| 4 | \declaremodule{builtin}{spwd} |
| 5 | \platform{Unix} |
| 6 | \modulesynopsis{The shadow password database (\function{getspnam()} and friends).} |
| 7 | |
| 8 | This module provides access to the \UNIX{} shadow password database. |
| 9 | It is available on various Unix versions. |
| 10 | |
| 11 | You must have enough privileges to access the shadow password database |
| 12 | (this usually means you have to be root). |
| 13 | |
| 14 | Shadow password database entries are reported as a tuple-like object, whose |
| 15 | attributes correspond to the members of the \code{spwd} structure |
| 16 | (Attribute field below, see \code{<shadow.h>}): |
| 17 | |
| 18 | \begin{tableiii}{r|l|l}{textrm}{Index}{Attribute}{Meaning} |
| 19 | \lineiii{0}{\code{sp_nam}}{Login name} |
| 20 | \lineiii{1}{\code{sp_pwd}}{Encrypted password} |
| 21 | \lineiii{2}{\code{sp_lstchg}}{Date of last change} |
| 22 | \lineiii{3}{\code{sp_min}}{Minimal number of days between changes} |
| 23 | \lineiii{4}{\code{sp_max}}{Maximum number of days between changes} |
| 24 | \lineiii{5}{\code{sp_warn}}{Number of days before password expires to warn user about it} |
| 25 | \lineiii{6}{\code{sp_inact}}{Number of days after password expires until account is blocked} |
| 26 | \lineiii{7}{\code{sp_expire}}{Number of days since 1970-01-01 until account is disabled} |
| 27 | \lineiii{8}{\code{sp_flag}}{Reserved} |
| 28 | \end{tableiii} |
| 29 | |
| 30 | The sp_nam and sp_pwd items are strings, all others are integers. |
| 31 | \exception{KeyError} is raised if the entry asked for cannot be found. |
| 32 | |
| 33 | It defines the following items: |
| 34 | |
| 35 | \begin{funcdesc}{getspnam}{name} |
| 36 | Return the shadow password database entry for the given user name. |
| 37 | \end{funcdesc} |
| 38 | |
| 39 | \begin{funcdesc}{getspall}{} |
| 40 | Return a list of all available shadow password database entries, in arbitrary order. |
| 41 | \end{funcdesc} |
| 42 | |
| 43 | |
| 44 | \begin{seealso} |
| 45 | \seemodule{pwd}{An interface to the normal password database, similar to this.} |
| 46 | \end{seealso} |