~dkuhlman/python-training-materials/Materials

« back to all changes in this revision

Viewing changes to python-3.5.2-docs-html/library/spwd.html

  • Committer: Dave Kuhlman
  • Date: 2017-04-15 16:24:56 UTC
  • Revision ID: dkuhlman@davekuhlman.org-20170415162456-iav9vozzg4iwqwv3
Updated docs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
 
2
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
3
 
 
4
 
 
5
<html xmlns="http://www.w3.org/1999/xhtml">
 
6
  <head>
 
7
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
8
    
 
9
    <title>35.3. spwd — The shadow password database &mdash; Python 3.5.2 documentation</title>
 
10
    
 
11
    <link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
 
12
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
 
13
    
 
14
    <script type="text/javascript">
 
15
      var DOCUMENTATION_OPTIONS = {
 
16
        URL_ROOT:    '../',
 
17
        VERSION:     '3.5.2',
 
18
        COLLAPSE_INDEX: false,
 
19
        FILE_SUFFIX: '.html',
 
20
        HAS_SOURCE:  true
 
21
      };
 
22
    </script>
 
23
    <script type="text/javascript" src="../_static/jquery.js"></script>
 
24
    <script type="text/javascript" src="../_static/underscore.js"></script>
 
25
    <script type="text/javascript" src="../_static/doctools.js"></script>
 
26
    <script type="text/javascript" src="../_static/sidebar.js"></script>
 
27
    <link rel="search" type="application/opensearchdescription+xml"
 
28
          title="Search within Python 3.5.2 documentation"
 
29
          href="../_static/opensearch.xml"/>
 
30
    <link rel="author" title="About these documents" href="../about.html" />
 
31
    <link rel="copyright" title="Copyright" href="../copyright.html" />
 
32
    <link rel="top" title="Python 3.5.2 documentation" href="../contents.html" />
 
33
    <link rel="up" title="35. Unix Specific Services" href="unix.html" />
 
34
    <link rel="next" title="35.4. grp — The group database" href="grp.html" />
 
35
    <link rel="prev" title="35.2. pwd — The password database" href="pwd.html" />
 
36
    <link rel="shortcut icon" type="image/png" href="../_static/py.png" />
 
37
    
 
38
    <script type="text/javascript" src="../_static/copybutton.js"></script>
 
39
    <script type="text/javascript" src="../_static/version_switch.js"></script>
 
40
    
 
41
    
 
42
 
 
43
 
 
44
  </head>
 
45
  <body role="document">  
 
46
    <div class="related" role="navigation" aria-label="related navigation">
 
47
      <h3>Navigation</h3>
 
48
      <ul>
 
49
        <li class="right" style="margin-right: 10px">
 
50
          <a href="../genindex.html" title="General Index"
 
51
             accesskey="I">index</a></li>
 
52
        <li class="right" >
 
53
          <a href="../py-modindex.html" title="Python Module Index"
 
54
             >modules</a> |</li>
 
55
        <li class="right" >
 
56
          <a href="grp.html" title="35.4. grp — The group database"
 
57
             accesskey="N">next</a> |</li>
 
58
        <li class="right" >
 
59
          <a href="pwd.html" title="35.2. pwd — The password database"
 
60
             accesskey="P">previous</a> |</li>
 
61
        <li><img src="../_static/py.png" alt=""
 
62
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
63
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
64
        <li>
 
65
          <span class="version_switcher_placeholder">3.5.2</span>
 
66
          <a href="../index.html">Documentation </a> &raquo;
 
67
        </li>
 
68
 
 
69
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
70
          <li class="nav-item nav-item-2"><a href="unix.html" accesskey="U">35. Unix Specific Services</a> &raquo;</li>
 
71
    <li class="right">
 
72
        
 
73
 
 
74
    <div class="inline-search" style="display: none" role="search">
 
75
        <form class="inline-search" action="../search.html" method="get">
 
76
          <input placeholder="Quick search" type="text" name="q" />
 
77
          <input type="submit" value="Go" />
 
78
          <input type="hidden" name="check_keywords" value="yes" />
 
79
          <input type="hidden" name="area" value="default" />
 
80
        </form>
 
81
    </div>
 
82
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
83
         |
 
84
    </li>
 
85
 
 
86
      </ul>
 
87
    </div>    
 
88
 
 
89
    <div class="document">
 
90
      <div class="documentwrapper">
 
91
        <div class="bodywrapper">
 
92
          <div class="body" role="main">
 
93
            
 
94
  <div class="section" id="module-spwd">
 
95
<span id="spwd-the-shadow-password-database"></span><h1>35.3. <a class="reference internal" href="#module-spwd" title="spwd: The shadow password database (getspnam() and friends). (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">spwd</span></code></a> &#8212; The shadow password database<a class="headerlink" href="#module-spwd" title="Permalink to this headline">¶</a></h1>
 
96
<hr class="docutils" />
 
97
<p>This module provides access to the Unix shadow password database. It is
 
98
available on various Unix versions.</p>
 
99
<p>You must have enough privileges to access the shadow password database (this
 
100
usually means you have to be root).</p>
 
101
<p>Shadow password database entries are reported as a tuple-like object, whose
 
102
attributes correspond to the members of the <code class="docutils literal"><span class="pre">spwd</span></code> structure (Attribute field
 
103
below, see <code class="docutils literal"><span class="pre">&lt;shadow.h&gt;</span></code>):</p>
 
104
<table border="1" class="docutils">
 
105
<colgroup>
 
106
<col width="13%" />
 
107
<col width="27%" />
 
108
<col width="60%" />
 
109
</colgroup>
 
110
<thead valign="bottom">
 
111
<tr class="row-odd"><th class="head">Index</th>
 
112
<th class="head">Attribute</th>
 
113
<th class="head">Meaning</th>
 
114
</tr>
 
115
</thead>
 
116
<tbody valign="top">
 
117
<tr class="row-even"><td>0</td>
 
118
<td><code class="docutils literal"><span class="pre">sp_namp</span></code></td>
 
119
<td>Login name</td>
 
120
</tr>
 
121
<tr class="row-odd"><td>1</td>
 
122
<td><code class="docutils literal"><span class="pre">sp_pwdp</span></code></td>
 
123
<td>Encrypted password</td>
 
124
</tr>
 
125
<tr class="row-even"><td>2</td>
 
126
<td><code class="docutils literal"><span class="pre">sp_lstchg</span></code></td>
 
127
<td>Date of last change</td>
 
128
</tr>
 
129
<tr class="row-odd"><td>3</td>
 
130
<td><code class="docutils literal"><span class="pre">sp_min</span></code></td>
 
131
<td>Minimal number of days between
 
132
changes</td>
 
133
</tr>
 
134
<tr class="row-even"><td>4</td>
 
135
<td><code class="docutils literal"><span class="pre">sp_max</span></code></td>
 
136
<td>Maximum number of days between
 
137
changes</td>
 
138
</tr>
 
139
<tr class="row-odd"><td>5</td>
 
140
<td><code class="docutils literal"><span class="pre">sp_warn</span></code></td>
 
141
<td>Number of days before password
 
142
expires to warn user about it</td>
 
143
</tr>
 
144
<tr class="row-even"><td>6</td>
 
145
<td><code class="docutils literal"><span class="pre">sp_inact</span></code></td>
 
146
<td>Number of days after password
 
147
expires until account is
 
148
disabled</td>
 
149
</tr>
 
150
<tr class="row-odd"><td>7</td>
 
151
<td><code class="docutils literal"><span class="pre">sp_expire</span></code></td>
 
152
<td>Number of days since 1970-01-01
 
153
when account expires</td>
 
154
</tr>
 
155
<tr class="row-even"><td>8</td>
 
156
<td><code class="docutils literal"><span class="pre">sp_flag</span></code></td>
 
157
<td>Reserved</td>
 
158
</tr>
 
159
</tbody>
 
160
</table>
 
161
<p>The sp_namp and sp_pwdp items are strings, all others are integers.
 
162
<a class="reference internal" href="exceptions.html#KeyError" title="KeyError"><code class="xref py py-exc docutils literal"><span class="pre">KeyError</span></code></a> is raised if the entry asked for cannot be found.</p>
 
163
<p>The following functions are defined:</p>
 
164
<dl class="function">
 
165
<dt id="spwd.getspnam">
 
166
<code class="descclassname">spwd.</code><code class="descname">getspnam</code><span class="sig-paren">(</span><em>name</em><span class="sig-paren">)</span><a class="headerlink" href="#spwd.getspnam" title="Permalink to this definition">¶</a></dt>
 
167
<dd><p>Return the shadow password database entry for the given user name.</p>
 
168
</dd></dl>
 
169
 
 
170
<dl class="function">
 
171
<dt id="spwd.getspall">
 
172
<code class="descclassname">spwd.</code><code class="descname">getspall</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#spwd.getspall" title="Permalink to this definition">¶</a></dt>
 
173
<dd><p>Return a list of all available shadow password database entries, in arbitrary
 
174
order.</p>
 
175
</dd></dl>
 
176
 
 
177
<div class="admonition seealso">
 
178
<p class="first admonition-title">See also</p>
 
179
<dl class="last docutils">
 
180
<dt>Module <a class="reference internal" href="grp.html#module-grp" title="grp: The group database (getgrnam() and friends). (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">grp</span></code></a></dt>
 
181
<dd>An interface to the group database, similar to this.</dd>
 
182
<dt>Module <a class="reference internal" href="pwd.html#module-pwd" title="pwd: The password database (getpwnam() and friends). (Unix)"><code class="xref py py-mod docutils literal"><span class="pre">pwd</span></code></a></dt>
 
183
<dd>An interface to the normal password database, similar to this.</dd>
 
184
</dl>
 
185
</div>
 
186
</div>
 
187
 
 
188
 
 
189
          </div>
 
190
        </div>
 
191
      </div>
 
192
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
 
193
        <div class="sphinxsidebarwrapper">
 
194
  <h4>Previous topic</h4>
 
195
  <p class="topless"><a href="pwd.html"
 
196
                        title="previous chapter">35.2. <code class="docutils literal"><span class="pre">pwd</span></code> &#8212; The password database</a></p>
 
197
  <h4>Next topic</h4>
 
198
  <p class="topless"><a href="grp.html"
 
199
                        title="next chapter">35.4. <code class="docutils literal"><span class="pre">grp</span></code> &#8212; The group database</a></p>
 
200
  <div role="note" aria-label="source link">
 
201
    <h3>This Page</h3>
 
202
    <ul class="this-page-menu">
 
203
      <li><a href="../bugs.html">Report a Bug</a></li>
 
204
      <li><a href="../_sources/library/spwd.txt"
 
205
            rel="nofollow">Show Source</a></li>
 
206
    </ul>
 
207
  </div>
 
208
        </div>
 
209
      </div>
 
210
      <div class="clearer"></div>
 
211
    </div>  
 
212
    <div class="related" role="navigation" aria-label="related navigation">
 
213
      <h3>Navigation</h3>
 
214
      <ul>
 
215
        <li class="right" style="margin-right: 10px">
 
216
          <a href="../genindex.html" title="General Index"
 
217
             >index</a></li>
 
218
        <li class="right" >
 
219
          <a href="../py-modindex.html" title="Python Module Index"
 
220
             >modules</a> |</li>
 
221
        <li class="right" >
 
222
          <a href="grp.html" title="35.4. grp — The group database"
 
223
             >next</a> |</li>
 
224
        <li class="right" >
 
225
          <a href="pwd.html" title="35.2. pwd — The password database"
 
226
             >previous</a> |</li>
 
227
        <li><img src="../_static/py.png" alt=""
 
228
                 style="vertical-align: middle; margin-top: -1px"/></li>
 
229
        <li><a href="https://www.python.org/">Python</a> &raquo;</li>
 
230
        <li>
 
231
          <span class="version_switcher_placeholder">3.5.2</span>
 
232
          <a href="../index.html">Documentation </a> &raquo;
 
233
        </li>
 
234
 
 
235
          <li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &raquo;</li>
 
236
          <li class="nav-item nav-item-2"><a href="unix.html" >35. Unix Specific Services</a> &raquo;</li>
 
237
    <li class="right">
 
238
        
 
239
 
 
240
    <div class="inline-search" style="display: none" role="search">
 
241
        <form class="inline-search" action="../search.html" method="get">
 
242
          <input placeholder="Quick search" type="text" name="q" />
 
243
          <input type="submit" value="Go" />
 
244
          <input type="hidden" name="check_keywords" value="yes" />
 
245
          <input type="hidden" name="area" value="default" />
 
246
        </form>
 
247
    </div>
 
248
    <script type="text/javascript">$('.inline-search').show(0);</script>
 
249
         |
 
250
    </li>
 
251
 
 
252
      </ul>
 
253
    </div>  
 
254
    <div class="footer">
 
255
    &copy; <a href="../copyright.html">Copyright</a> 2001-2016, Python Software Foundation.
 
256
    <br />
 
257
    The Python Software Foundation is a non-profit corporation.
 
258
    <a href="https://www.python.org/psf/donations/">Please donate.</a>
 
259
    <br />
 
260
    Last updated on Sep 23, 2016.
 
261
    <a href="../bugs.html">Found a bug</a>?
 
262
    <br />
 
263
    Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
 
264
    </div>
 
265
 
 
266
  </body>
 
267
</html>
 
 
b'\\ No newline at end of file'