Bug 124557 - [PATCH] ypcat fakemap does not error
Summary: [PATCH] ypcat fakemap does not error
Alias: None
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ypserv   
(Show other bugs)
Version: 3.0
Hardware: All Linux
Target Milestone: ---
Assignee: Chris Feist
QA Contact: Jay Turner
: 85262 (view as bug list)
Depends On:
Blocks: 123574
TreeView+ depends on / blocked
Reported: 2004-05-27 14:26 UTC by Aaron Spangler
Modified: 2015-01-08 00:07 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-18 13:13:50 UTC
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
replacement 'nomap' patch (247 bytes, patch)
2004-05-27 18:14 UTC, Aaron Spangler
no flags Details | Diff
new nomap patch (2.55 KB, patch)
2004-09-01 16:46 UTC, Steve Dickson
no flags Details | Diff
Ethereal captures of ypserv-2.10 (147.96 KB, application/gzip)
2004-12-06 19:53 UTC, Aaron Spangler
no flags Details

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2004:578 normal SHIPPED_LIVE Updated ypserv package 2004-12-21 05:00:00 UTC

Description Aaron Spangler 2004-05-27 14:26:01 UTC
Description of problem:
ypcat fakemap returns a map of zero entries rather than
"No such map".  In our environment, this causes great problems.

For example, programs such as automounter try to determine the correct
NIS map name for the auto-master file.  (Various distros try
auto-master, auto.master, auto_master).  Most automounters then select
the first of these maps they find.  Since ypserv is saying that such a
map exists, but no entries are present instead of returning YP_NOMAP,
automounter and other programs do not operate properly.

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. On RHEL3, setup ypserv in master or slave mode
2. Ensure 'fakemap' does not exist in the maps
3. Do 'ypcat fakemap'
Actual results:
No Error message, Empty result set

Expected results:
No such map fakemap. Reason: No such map in server's domain

Additional info:

Running 'ypserv -d' does infact show the 'gdbm error 3' but it does
not correctly propagate it back to the client. (verified with ethereal)

This bug is present in both ypproc_all_2_svc() & ypproc_first_2_svc()
(in ypserv/server.c)

The ypserv-2.6-nomap.patch does seem to help (enough?)  Maybe this
patch should be discarded and rewritten.

Newer version of ypserv from kernel.org have this problem fixed.
I built ypserv-2.13 using RedHat's SPEC file and it works great.
They address the problem by almost alrays returning YP_NOMAP instead
of other error messages in ypserv/server.c

Feel free to contact me.  I would be glad to provide additional tests
and debugging.

Comment 1 Aaron Spangler 2004-05-27 18:11:06 UTC
My proposed fix is to remove the defective 
ypserv-2.6-nomap.patch that was introduced earlier and replace it with
the attached patch.  The broken account doesn't take into account the
handling the return code -4 by each of the callers to is_valid().

The new patch is much simpler, handles each use case properly, and is
identical to how it was fixed in later versions of ypserv on kernel.org.

Please see attached patch...
-Aaron Spangler

Comment 2 Aaron Spangler 2004-05-27 18:14:37 UTC
Created attachment 100636 [details]
replacement 'nomap' patch

Comment 3 Aaron Spangler 2004-05-27 18:16:52 UTC
The attached patch works on ypserv-2.8-1 or ypserv-2.8-6

Comment 6 Steve Dickson 2004-07-02 20:16:45 UTC
In the latest release 2.8-6, is issue is addressed by setting
the status to -4 which means fakemaps are silently ignored. 

Comment 7 Aaron Spangler 2004-07-06 13:39:31 UTC
ypserv-2.8-6 has the same problem.  (Verified)

Comment 8 Aaron Spangler 2004-07-06 13:42:41 UTC
In fact I first tried 2.8-6 before I even posted the bugzilla report.
 Maybe you are saying that the 'Actual Results' is the desired
behavior rathar than the 'Expected Results' (as described above)?

Please elaborate.

Comment 9 Steve Dickson 2004-08-31 19:21:36 UTC
Fixed in yp-tools-2.8-6

Comment 10 Aaron Spangler 2004-09-01 13:01:57 UTC

Umm - do you *ypserv* 2.8-6?  That was a defective patch.  In fact, I
did additional testing was against ypserv 2.8-6.  It does not properly
address the symptoms on Solaris automounters that are NIS clients of
Redhat ypserv 2.8-6.  Please recall the NOMAP patch in 2.8-6 and
replace it with the patch one suggested in Bug 124557.

Please let me know if you want more information.  I would even be
willing to setup lots of additional tests.  Provide network traces,
etc to show that 2.8-6 was defective.


Comment 11 Steve Dickson 2004-09-01 16:46:42 UTC
Created attachment 103344 [details]
new nomap patch

Please try this new nomap patch to see if 
takes care of the Solaris issue

Comment 12 Steve Dickson 2004-09-01 16:49:43 UTC
No I did mean yp-tools-2.8-6 since does fix bug
in ypcat.

Comment 13 Steve Dickson 2004-09-10 15:10:50 UTC
*** Bug 85262 has been marked as a duplicate of this bug. ***

Comment 14 Steve Dickson 2004-09-14 14:45:29 UTC
The fix for this bug is in the ypserv-2.8-9 rpm for RHEL3
and in ypserv-2.8-7.21 rpm for AS2.1

Comment 15 Aaron Spangler 2004-11-11 15:19:07 UTC
Tried ypserv-2.8-10.  It does not fix it either.  Can we please use my
patch now?

Comment 16 Steve Dickson 2004-11-12 11:25:49 UTC
It did at this end.... could you please post a new ethereal
trace and the output of 'ypcat nomap'

Aaron, your patch does not address the entire problem
and I'm never been a fan of applying half fixes.... 

Comment 17 Aaron Spangler 2004-12-06 19:53:40 UTC
Created attachment 107982 [details]
Ethereal captures of ypserv-2.10 

Attached tar.gz file containing:

The *.pdf files contain the printout of the relavent packets.  But the entire
dumps (*.tcpdump) can be read with ethereal.  The 6nwie3 is our internally
patched version with the same patch I am promoting.  The 2.8-10 is the most
recent rev you asked me to test.

Nis Client: (Solairs 8)
Nis Server: (RHEL4U1 w/ corresponding ypserv)

Please let me know if I can provide more information.


Comment 18 Steve Dickson 2004-12-06 20:32:55 UTC
Just to be sure....  'rpm -q --changelog ypserv' has an entry
that says:

* Fri Oct 08 2004 Steve Dickson <SteveD@RedHat.com>

- Found a hole in the yp_first/yp_next code
  where YP_NOMAP was not being set

Comment 19 Aaron Spangler 2004-12-08 22:27:45 UTC
Yup. Same RPM.

Comment 20 John Flanagan 2004-12-21 20:23:42 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on the solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.


Comment 27 Jay Turner 2005-01-18 13:13:50 UTC
Closing out based on comment 26.

Comment 28 Aaron Spangler 2005-01-18 14:22:48 UTC
Comment 26 is not public!    I see comment #20 and comment #27, but thats it. 

Comment 29 Aaron Spangler 2005-01-18 14:23:59 UTC
Please let me know the status of this bugzilla. 

Comment 30 Chris Feist 2005-01-18 16:14:32 UTC
This bug has been fixed, another similiar bug #136509 has been opened which
should detail the other problems that you're having.  Let me know if this isn't
the case,  and I'll re-open the bug.

Comment 31 Aaron Spangler 2005-01-18 16:22:43 UTC
Chris, This has NOT been fixed.  I disagree considering I am the person who 
opened up this bug (see above) and also did all the network traces AND even 
submitted the actual patch.  Until this patch (or similar) is applied or until 
the network traces of the new package demonstrate that the problem is fixed, 
then how can it be fixed?

Comment 32 Chris Feist 2005-03-24 16:02:09 UTC
A *test* version of the ypserv with the fixes is available at

Note You need to log in before you can comment on or make changes to this bug.