[Python-bugs-list] [ python-Bugs-233084 ] nis.match('username', 'aliases') does not work under Linux

noreply@sourceforge.net noreply@sourceforge.net
Thu, 15 Aug 2002 17:47:11 -0700


Bugs item #233084, was opened at 2001-02-19 07:17
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=233084&group_id=5470

Category: Python Library
Group: None
Status: Closed
Resolution: Wont Fix
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Fred L. Drake, Jr. (fdrake)
Summary: nis.match('username', 'aliases') does not work under Linux

Initial Comment:
The exception 'nis.error: No such key in map' is thrown
when issuing

>>> nis.match('username', 'aliases')

under SuSE-Linux 6.4 and 7.0 with both Python 2.0 and 
Python 2.1a2, even if 'username' is valid and 

$ ypmatch username aliases

works.

Fix: Apply the following patch to Modules/nismodule.c

--- nismodule.c.sv      Mon Feb 19 16:12:10 2001
+++ nismodule.c Mon Feb 19 16:15:28 2001
@@ -43,7 +43,7 @@
        {"hosts",       "hosts.byname",         0},
        {"protocols",   "protocols.bynumber",   0},
        {"services",    "services.byname",      0},
-       {"aliases",     "mail.aliases",         1}, /* created with 'makedbm -a' */
+       {"aliases",     "mail.aliases",         0}, /* created with 'makedbm -a' */
        {"ethers",      "ethers.byname",        0},
        {0L,            0L,                     0}
 };


----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2002-08-15 17:47

Message:
Logged In: NO 

Actually I think the right fix is to remove the bogus 'fix'
code from nismodule.c.  It seems to do the wrong thing in
several places.  It's broken under MacOS X and Solaris, at
least with Python 2.2.

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-07-19 07:22

Message:
Logged In: YES 
user_id=3066

After soliciting information from python-dev, it appears
that there's no clear fix -- fixing this properly may not be
possible, as it has a lot to do with the server
configuration.  See the "NIS on Linux, others?" thread that
starts at:

http://mail.python.org/pipermail/python-dev/2001-June/015633.html

Closing this as "Won't Fix".  If there is a portable and
reliable way to fix this, please submit a patch.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-06-29 05:39

Message:
Logged In: NO 

The fix (or the Python 1.5.2 behavior) is correct for such
platforms as RedHat Linux 6.2 (NIS server BSDI 2.1) and an
unknown FreeBSD version.

The need for the "fix" flag is likely dependent on the
server, not the client, and may very well need to be guessed
at runtime.

A related bug causes a segmentation violation in memcpy()
for 'nis.cat("aliases")' when a zero-length key or value
appears in the map, because (unsigned)-1 is passed as the
length argument.

----------------------------------------------------------------------

Comment By: Nobody/Anonymous (nobody)
Date: 2001-02-23 11:52

Message:
You are all going down on this one

----------------------------------------------------------------------

Comment By: Fred L. Drake, Jr. (fdrake)
Date: 2001-02-19 13:33

Message:
Can anyone confirm this bug for other platforms?  How about the fix?  I don't have any access a network that uses NIS these days.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=233084&group_id=5470