classification
Title: fix test_grp failing on RedHat 6.2
Type: Stage:
Components: Extension Modules Versions: Python 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: anthonybaxter Nosy List: anthonybaxter, barry, doerwalter, jafo, jbrouwers, nnorwitz (6)
Priority: high Keywords patch

Created on 2003-07-22 23:07 by nnorwitz, last changed 2008-01-04 00:10 by christian.heimes.

Files
File name Uploaded Description Edit Remove
grp.diff nnorwitz, 2003-07-22 23:07 patch to Modules/grpmodule.c
Messages (10)
msg17264 - (view) Author: Neal Norwitz (nnorwitz) Date: 2003-07-22 23:07
I didn't really think this should go into 2.3, but I'll
let you make the decision.  This patch fixes the
test_grp failure on RedHat 6.2/Alpha (asmodean) in the
snake-farm.  I thought it was specific to RH 6.2,
apparently it's not.  If you add a + as the last line
in /etc/group the test will fail on RH 9 too.

Walter Doerwald may know more about how best to fix
this.  I'm not certain if it's really a problem in the
extension module or the test.
If you want to fix the test, the patch is included here:

     def check_value(self, value):
         # check that a grp tuple has the entries and
         # attributes promised by the docs
+        if value == ('+', None, 0, []):
+            # some libc's return the last line of +
+            return
msg17265 - (view) Author: Barry A. Warsaw (barry) Date: 2003-07-27 16:22
Logged In: YES 
user_id=12800

Remind me what + on a line means in /etc/group.  "man group"
on RH9 gives no clue.  I'm still nervous about it, can we
defer until 2.3.1?
msg17266 - (view) Author: Walter Dörwald (doerwalter) Date: 2003-07-28 18:36
Logged In: YES 
user_id=89016

pwdmodule.c hasn't changed in 7 months, so I'd say this is a
problem with the test. But ('+', None, 0, []) doesn't seem
to be a valid entry, so (although it's not a bug in Python)
maybe Python should hide this entry.
msg17267 - (view) Author: Neal Norwitz (nnorwitz) Date: 2003-07-28 21:56
Logged In: YES 
user_id=33168

I don't recall what the + is for either.  Does it have
something to do with YP/NIS?  I don't think this is really
critical so I'm droping the priority.  If  pwdmodule.c is
changed, it will be an interface change so it's questionable
for 2.3.1.

This was found on the snake farm, never reported by a user.
msg17268 - (view) Author: Jean M. Brouwers (jbrouwers) Date: 2003-07-28 23:24
Logged In: YES 
user_id=832557

The '+ ...' line at the end of the /etc/passwd file tells
the system to also pickup information from the appropriate
map in LDAP, or NIS (yellow pages).  See also section 7.2 on
this page:

<http://www.ibiblio.org/mdw/HOWTO/NIS-HOWTO/settingup_client.html>
msg17269 - (view) Author: Barry A. Warsaw (barry) Date: 2003-07-29 03:01
Logged In: YES 
user_id=12800

Thanks Jean for the independent verification.  We'll fix
this for Python 2.3.1.
msg17270 - (view) Author: Walter Dörwald (doerwalter) Date: 2003-08-30 17:28
Logged In: YES 
user_id=89016

Now that 2.3 is out the door, should this be checked in?
msg17271 - (view) Author: Anthony Baxter (anthonybaxter) Date: 2003-11-06 15:35
Logged In: YES 
user_id=29957

I'll fix this for 2.3.3, because it causes test failures on
the HP testdrive boxes, and that annoys me <wink>.
msg17272 - (view) Author: Walter Dörwald (doerwalter) Date: 2005-10-09 19:56
Logged In: YES 
user_id=89016

Anthony, can this go into 2.5?
msg55360 - (view) Author: Sean Reifschneider (jafo) Date: 2007-08-28 09:14
A few comments on this one:

Perhaps the tests should be patched instead of the grp module?  Because
it may be useful for someone to know that old-style NIS maps are being
referenced.

I presume if the change is made in grp that it should also be made in pwd?

Shouldn't the patch do a "continue" instead of a break?  I believe the
"+" entry means "include the contents of the NIS map here (I don't
believe it can be used for LDAP), and as far as I know does not HAVE to
be included at the end of the file.

We probably don't care, but just to be canonical it seems that there are
also "+name" and "-name" entries in /etc/group and /etc/passwd.  "+name"
in an entry is the same as a "name" entry, but the additional fields are
read from NIS.  "-name" means that "name" is not a valid user (in other
words, don't let "name" login, even if they exist in NIS).  I can't
imagine we want to implement those though, because...

Note that the "+" syntax is the old syntax from before nsswitch was
introduced.  As far as I know, + syntax was deprecated back in 1995 when
nsswitch.conf was added.

In conclusion, I think the tests that the tests that annoy Anthony
should be fixed, but I'm not convinced the behavior of grp should be
changed.  Particularly without a corresponding change in pwd.

Thoughts?

See the following URL for more information about the +/- syntax: 
http://bama.ua.edu/cgi-bin/man-cgi?nsswitch.conf+4
History
Date User Action Args
2008-01-04 00:57:20christian.heimeslinkissue779218 superseder
2008-01-04 00:10:00christian.heimessetkeywords: + patch
versions: + Python 2.5, - Python 2.3
2007-08-28 09:14:55jafosetnosy: + jafo
messages: + msg55360
2003-07-22 23:07:48nnorwitzcreate