Guido van Rossum | 5fdeeea | 1994-01-02 01:22:07 +0000 | [diff] [blame^] | 1 | \section{Built-in Module \sectcode{pwd}} |
| 2 | |
| 3 | \bimodindex{pwd} |
| 4 | This module provides access to the \UNIX{} password database. |
| 5 | It is available on all \UNIX{} versions. |
| 6 | |
| 7 | Password database entries are reported as 7-tuples containing the |
| 8 | following items from the password database (see \file{<pwd.h>}), in order: |
| 9 | \code{pw_name}, |
| 10 | \code{pw_passwd}, |
| 11 | \code{pw_uid}, |
| 12 | \code{pw_gid}, |
| 13 | \code{pw_gecos}, |
| 14 | \code{pw_dir}, |
| 15 | \code{pw_shell}. |
| 16 | The uid and gid items are integers, all others are strings. |
| 17 | An exception is raised if the entry asked for cannot be found. |
| 18 | |
| 19 | It defines the following items: |
| 20 | |
| 21 | \renewcommand{\indexsubitem}{(in module pwd)} |
| 22 | \begin{funcdesc}{getpwuid}{uid} |
| 23 | Return the password database entry for the given numeric user ID. |
| 24 | \end{funcdesc} |
| 25 | |
| 26 | \begin{funcdesc}{getpwnam}{name} |
| 27 | Return the password database entry for the given user name. |
| 28 | \end{funcdesc} |
| 29 | |
| 30 | \begin{funcdesc}{getpwall}{} |
| 31 | Return a list of all available password database entries, in arbitrary order. |
| 32 | \end{funcdesc} |