File indexing completed on 2024-04-28 15:53:59

0001 #!/usr/bin/env python2.7
0002 # -*- coding: utf-8 -*-
0003 """:platform: Unix
0004 :synopsis: The password database (getpwnam() and friends).
0005 
0006 
0007 This module provides access to the Unix user account and password database.  It
0008 is available on all Unix versions.
0009 
0010 Password database entries are reported as a tuple-like object, whose attributes
0011 correspond to the members of the ``passwd`` structure (Attribute field below,
0012 see ``<pwd.h>``):
0013 
0014 +-------+---------------+-----------------------------+
0015 | Index | Attribute     | Meaning                     |
0016 +=======+===============+=============================+
0017 | 0     | ``pw_name``   | Login name                  |
0018 +-------+---------------+-----------------------------+
0019 | 1     | ``pw_passwd`` | Optional encrypted password |
0020 +-------+---------------+-----------------------------+
0021 | 2     | ``pw_uid``    | Numerical user ID           |
0022 +-------+---------------+-----------------------------+
0023 | 3     | ``pw_gid``    | Numerical group ID          |
0024 +-------+---------------+-----------------------------+
0025 | 4     | ``pw_gecos``  | User name or comment field  |
0026 +-------+---------------+-----------------------------+
0027 | 5     | ``pw_dir``    | User home directory         |
0028 +-------+---------------+-----------------------------+
0029 | 6     | ``pw_shell``  | User command interpreter    |
0030 +-------+---------------+-----------------------------+
0031 
0032 The uid and gid items are integers, all others are strings. :exc:`KeyError` is
0033 raised if the entry asked for cannot be found.
0034 
0035 """
0036 def getpwuid(uid):
0037     """
0038     Return the password database entry for the given numeric user ID.
0039     
0040     
0041     """
0042     pass
0043     
0044 def getpwnam(name):
0045     """
0046     Return the password database entry for the given user name.
0047     
0048     
0049     """
0050     pass
0051     
0052 def getpwall():
0053     """
0054     Return a list of all available password database entries, in arbitrary order.
0055     
0056     
0057     """
0058     pass
0059