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