diff options
author | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@localhost> | 2011-05-03 11:25:13 +0000 |
commit | 458120dd40db6b4df55a4e96b650e16798ef06a0 (patch) | |
tree | 8f82685be24fef97e715c6f5ca4c68d34d5074ee /sys/src/cmd/python/Doc/lib/libpwd.tex | |
parent | 3a742c699f6806c1145aea5149bf15de15a0afd7 (diff) |
add hg and python
Diffstat (limited to 'sys/src/cmd/python/Doc/lib/libpwd.tex')
-rw-r--r-- | sys/src/cmd/python/Doc/lib/libpwd.tex | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/sys/src/cmd/python/Doc/lib/libpwd.tex b/sys/src/cmd/python/Doc/lib/libpwd.tex new file mode 100644 index 000000000..0c74d2655 --- /dev/null +++ b/sys/src/cmd/python/Doc/lib/libpwd.tex @@ -0,0 +1,57 @@ +\section{\module{pwd} --- + The password database} + +\declaremodule{builtin}{pwd} + \platform{Unix} +\modulesynopsis{The password database (\function{getpwnam()} and friends).} + +This module provides access to the \UNIX{} user account and password +database. It is available on all \UNIX{} versions. + +Password database entries are reported as a tuple-like object, whose +attributes correspond to the members of the \code{passwd} structure +(Attribute field below, see \code{<pwd.h>}): + +\begin{tableiii}{r|l|l}{textrm}{Index}{Attribute}{Meaning} + \lineiii{0}{\code{pw_name}}{Login name} + \lineiii{1}{\code{pw_passwd}}{Optional encrypted password} + \lineiii{2}{\code{pw_uid}}{Numerical user ID} + \lineiii{3}{\code{pw_gid}}{Numerical group ID} + \lineiii{4}{\code{pw_gecos}}{User name or comment field} + \lineiii{5}{\code{pw_dir}}{User home directory} + \lineiii{6}{\code{pw_shell}}{User command interpreter} +\end{tableiii} + +The uid and gid items are integers, all others are strings. +\exception{KeyError} is raised if the entry asked for cannot be found. + +\note{In traditional \UNIX{} the field \code{pw_passwd} usually +contains a password encrypted with a DES derived algorithm (see module +\refmodule{crypt}\refbimodindex{crypt}). However most modern unices +use a so-called \emph{shadow password} system. On those unices the +\var{pw_passwd} field only contains an asterisk (\code{'*'}) or the +letter \character{x} where the encrypted password is stored in a file +\file{/etc/shadow} which is not world readable. Whether the \var{pw_passwd} +field contains anything useful is system-dependent. If available, the +\module{spwd} module should be used where access to the encrypted password +is required.} + +It defines the following items: + +\begin{funcdesc}{getpwuid}{uid} +Return the password database entry for the given numeric user ID. +\end{funcdesc} + +\begin{funcdesc}{getpwnam}{name} +Return the password database entry for the given user name. +\end{funcdesc} + +\begin{funcdesc}{getpwall}{} +Return a list of all available password database entries, in arbitrary order. +\end{funcdesc} + + +\begin{seealso} + \seemodule{grp}{An interface to the group database, similar to this.} + \seemodule{spwd}{An interface to the shadow password database, similar to this.} +\end{seealso} |