diff options
author | Georg Brandl <georg@python.org> | 2007-08-15 14:28:01 (GMT) |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2007-08-15 14:28:01 (GMT) |
commit | 8ec7f656134b1230ab23003a94ba3266d7064122 (patch) | |
tree | bc730d5fb3302dc375edd26b26f750d609b61d72 /Doc/library/grp.rst | |
parent | f56181ff53ba00b7bed3997a4dccd9a1b6217b57 (diff) | |
download | cpython-8ec7f656134b1230ab23003a94ba3266d7064122.zip cpython-8ec7f656134b1230ab23003a94ba3266d7064122.tar.gz cpython-8ec7f656134b1230ab23003a94ba3266d7064122.tar.bz2 |
Move the 2.6 reST doc tree in place.
Diffstat (limited to 'Doc/library/grp.rst')
-rw-r--r-- | Doc/library/grp.rst | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/Doc/library/grp.rst b/Doc/library/grp.rst new file mode 100644 index 0000000..a71c308 --- /dev/null +++ b/Doc/library/grp.rst @@ -0,0 +1,63 @@ + +:mod:`grp` --- The group database +================================= + +.. module:: grp + :platform: Unix + :synopsis: The group database (getgrnam() and friends). + + +This module provides access to the Unix group database. It is available on all +Unix versions. + +Group database entries are reported as a tuple-like object, whose attributes +correspond to the members of the ``group`` structure (Attribute field below, see +``<pwd.h>``): + ++-------+-----------+---------------------------------+ +| Index | Attribute | Meaning | ++=======+===========+=================================+ +| 0 | gr_name | the name of the group | ++-------+-----------+---------------------------------+ +| 1 | gr_passwd | the (encrypted) group password; | +| | | often empty | ++-------+-----------+---------------------------------+ +| 2 | gr_gid | the numerical group ID | ++-------+-----------+---------------------------------+ +| 3 | gr_mem | all the group member's user | +| | | names | ++-------+-----------+---------------------------------+ + +The gid is an integer, name and password are strings, and the member list is a +list of strings. (Note that most users are not explicitly listed as members of +the group they are in according to the password database. Check both databases +to get complete membership information.) + +It defines the following items: + + +.. function:: getgrgid(gid) + + Return the group database entry for the given numeric group ID. :exc:`KeyError` + is raised if the entry asked for cannot be found. + + +.. function:: getgrnam(name) + + Return the group database entry for the given group name. :exc:`KeyError` is + raised if the entry asked for cannot be found. + + +.. function:: getgrall() + + Return a list of all available group entries, in arbitrary order. + + +.. seealso:: + + Module :mod:`pwd` + An interface to the user database, similar to this. + + Module :mod:`spwd` + An interface to the shadow password database, similar to this. + |