~ubuntu-branches/ubuntu/trusty/python3.4/trusty-proposed

« back to all changes in this revision

Viewing changes to Doc/library/spwd.rst

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-11-25 09:44:27 UTC
  • Revision ID: package-import@ubuntu.com-20131125094427-lzxj8ap5w01lmo7f
Tags: upstream-3.4~b1
ImportĀ upstreamĀ versionĀ 3.4~b1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
:mod:`spwd` --- The shadow password database
 
2
============================================
 
3
 
 
4
.. module:: spwd
 
5
   :platform: Unix
 
6
   :synopsis: The shadow password database (getspnam() and friends).
 
7
 
 
8
 
 
9
This module provides access to the Unix shadow password database. It is
 
10
available on various Unix versions.
 
11
 
 
12
You must have enough privileges to access the shadow password database (this
 
13
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 ``spwd`` structure (Attribute field
 
17
below, see ``<shadow.h>``):
 
18
 
 
19
+-------+---------------+---------------------------------+
 
20
| Index | Attribute     | Meaning                         |
 
21
+=======+===============+=================================+
 
22
| 0     | ``sp_namp``   | Login name                      |
 
23
+-------+---------------+---------------------------------+
 
24
| 1     | ``sp_pwdp``   | Encrypted password              |
 
25
+-------+---------------+---------------------------------+
 
26
| 2     | ``sp_lstchg`` | Date of last change             |
 
27
+-------+---------------+---------------------------------+
 
28
| 3     | ``sp_min``    | Minimal number of days between  |
 
29
|       |               | changes                         |
 
30
+-------+---------------+---------------------------------+
 
31
| 4     | ``sp_max``    | Maximum number of days between  |
 
32
|       |               | changes                         |
 
33
+-------+---------------+---------------------------------+
 
34
| 5     | ``sp_warn``   | Number of days before password  |
 
35
|       |               | expires to warn user about it   |
 
36
+-------+---------------+---------------------------------+
 
37
| 6     | ``sp_inact``  | Number of days after password   |
 
38
|       |               | expires until account is        |
 
39
|       |               | disabled                        |
 
40
+-------+---------------+---------------------------------+
 
41
| 7     | ``sp_expire`` | Number of days since 1970-01-01 |
 
42
|       |               | when account expires            |
 
43
+-------+---------------+---------------------------------+
 
44
| 8     | ``sp_flag``   | Reserved                        |
 
45
+-------+---------------+---------------------------------+
 
46
 
 
47
The sp_namp and sp_pwdp items are strings, all others are integers.
 
48
:exc:`KeyError` is raised if the entry asked for cannot be found.
 
49
 
 
50
The following functions are defined:
 
51
 
 
52
 
 
53
.. function:: getspnam(name)
 
54
 
 
55
   Return the shadow password database entry for the given user name.
 
56
 
 
57
 
 
58
.. function:: getspall()
 
59
 
 
60
   Return a list of all available shadow password database entries, in arbitrary
 
61
   order.
 
62
 
 
63
 
 
64
.. seealso::
 
65
 
 
66
   Module :mod:`grp`
 
67
      An interface to the group database, similar to this.
 
68
 
 
69
   Module :mod:`pwd`
 
70
      An interface to the normal password database, similar to this.
 
71