1
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
<html xmlns="http://www.w3.org/1999/xhtml">
7
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<title>35.3. spwd — The shadow password database — Python 3.5.2 documentation</title>
11
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
12
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
14
<script type="text/javascript">
15
var DOCUMENTATION_OPTIONS = {
18
COLLAPSE_INDEX: false,
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" />
38
<script type="text/javascript" src="../_static/copybutton.js"></script>
39
<script type="text/javascript" src="../_static/version_switch.js"></script>
45
<body role="document">
46
<div class="related" role="navigation" aria-label="related navigation">
49
<li class="right" style="margin-right: 10px">
50
<a href="../genindex.html" title="General Index"
51
accesskey="I">index</a></li>
53
<a href="../py-modindex.html" title="Python Module Index"
56
<a href="grp.html" title="35.4. grp — The group database"
57
accesskey="N">next</a> |</li>
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> »</li>
65
<span class="version_switcher_placeholder">3.5.2</span>
66
<a href="../index.html">Documentation </a> »
69
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
70
<li class="nav-item nav-item-2"><a href="unix.html" accesskey="U">35. Unix Specific Services</a> »</li>
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" />
82
<script type="text/javascript">$('.inline-search').show(0);</script>
89
<div class="document">
90
<div class="documentwrapper">
91
<div class="bodywrapper">
92
<div class="body" role="main">
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> — 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"><shadow.h></span></code>):</p>
104
<table border="1" class="docutils">
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>
117
<tr class="row-even"><td>0</td>
118
<td><code class="docutils literal"><span class="pre">sp_namp</span></code></td>
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>
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>
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
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
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>
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
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>
155
<tr class="row-even"><td>8</td>
156
<td><code class="docutils literal"><span class="pre">sp_flag</span></code></td>
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>
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
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>
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> — The password database</a></p>
198
<p class="topless"><a href="grp.html"
199
title="next chapter">35.4. <code class="docutils literal"><span class="pre">grp</span></code> — The group database</a></p>
200
<div role="note" aria-label="source link">
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>
210
<div class="clearer"></div>
212
<div class="related" role="navigation" aria-label="related navigation">
215
<li class="right" style="margin-right: 10px">
216
<a href="../genindex.html" title="General Index"
219
<a href="../py-modindex.html" title="Python Module Index"
222
<a href="grp.html" title="35.4. grp — The group database"
225
<a href="pwd.html" title="35.2. pwd — The password database"
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> »</li>
231
<span class="version_switcher_placeholder">3.5.2</span>
232
<a href="../index.html">Documentation </a> »
235
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> »</li>
236
<li class="nav-item nav-item-2"><a href="unix.html" >35. Unix Specific Services</a> »</li>
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" />
248
<script type="text/javascript">$('.inline-search').show(0);</script>
255
© <a href="../copyright.html">Copyright</a> 2001-2016, Python Software Foundation.
257
The Python Software Foundation is a non-profit corporation.
258
<a href="https://www.python.org/psf/donations/">Please donate.</a>
260
Last updated on Sep 23, 2016.
261
<a href="../bugs.html">Found a bug</a>?
263
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.3.3.
b'\\ No newline at end of file'