| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,7 +30,9 @@ correspond to the members of the ``group`` structure (Attribute field below, see | |||
| 30 | 30 | The gid is an integer, name and password are strings, and the member list is a | |
| 31 | 31 | list of strings. (Note that most users are not explicitly listed as members of | |
| 32 | 32 | the group they are in according to the password database. Check both databases | |
| 33 | - to get complete membership information.) | ||
| 33 | + to get complete membership information. Also note that a ``gr_name`` that | ||
| 34 | + starts with a ``+`` or ``-`` is likely to be a YP/NIS reference and may not be | ||
| 35 | + accessible via :func:`getgrnam` or :func:`getgrgid`.) | ||
| 34 | 36 | ||
| 35 | 37 | It defines the following items: | |
| 36 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -33,12 +33,16 @@ def test_values(self): | |||
| 33 | 33 | e2 = grp.getgrgid(e.gr_gid) | |
| 34 | 34 | self.check_value(e2) | |
| 35 | 35 | self.assertEqual(e2.gr_gid, e.gr_gid) | |
| 36 | - e2 = grp.getgrnam(e.gr_name) | ||
| 36 | + name = e.gr_name | ||
| 37 | + if name.startswith('+') or name.startswith('-'): | ||
| 38 | + # NIS-related entry | ||
| 39 | + continue | ||
| 40 | + e2 = grp.getgrnam(name) | ||
| 37 | 41 | self.check_value(e2) | |
| 38 | 42 | # There are instances where getgrall() returns group names in | |
| 39 | 43 | # lowercase while getgrgid() returns proper casing. | |
| 40 | 44 | # Discovered on Ubuntu 5.04 (custom). | |
| 41 | - self.assertEqual(e2.gr_name.lower(), e.gr_name.lower()) | ||
| 45 | + self.assertEqual(e2.gr_name.lower(), name.lower()) | ||
| 42 | 46 | ||
| 43 | 47 | def test_errors(self): | |
| 44 | 48 | self.assertRaises(TypeError, grp.getgrgid) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -398,6 +398,7 @@ Gerhard Häring | |||
| 398 | 398 | Fredrik Håård | |
| 399 | 399 | Mihai Ibanescu | |
| 400 | 400 | Lars Immisch | |
| 401 | + Bobby Impollonia | ||
| 401 | 402 | Meador Inge | |
| 402 | 403 | Tony Ingraldi | |
| 403 | 404 | John Interrante | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -38,6 +38,13 @@ Library | |||
| 38 | 38 | or otherwise not wait for exiting child processes. | |
| 39 | 39 | ||
| 40 | 40 | ||
| 41 | + Tests | ||
| 42 | + ----- | ||
| 43 | + | ||
| 44 | + - Issue #775964: test_grp now skips YP/NIS entries instead of failing when | ||
| 45 | + encountering them. | ||
| 46 | + | ||
| 47 | + | ||
| 41 | 48 | What's New in Python 3.2 Beta 1? | |
| 42 | 49 | ================================ | |
| 43 | 50 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,7 +159,9 @@ Return the group database entry for the given group name. If\n\ | |||
| 159 | 159 | name is not valid, raise KeyError."}, | |
| 160 | 160 | {"getgrall", grp_getgrall, METH_NOARGS, | |
| 161 | 161 | "getgrall() -> list of tuples\n\ | |
| 162 | - Return a list of all available group entries, in arbitrary order."}, | ||
| 162 | + Return a list of all available group entries, in arbitrary order.\n\ | ||
| 163 | + An entry whose name starts with '+' or '-' represents an instruction\n\ | ||
| 164 | + to use YP/NIS and may not be accessible via getgrnam or getgrgid."}, | ||
| 163 | 165 | {NULL, NULL} /* sentinel */ | |
| 164 | 166 | }; | |
| 165 | 167 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments