Bug 124557 - [PATCH] ypcat fakemap does not error
[PATCH] ypcat fakemap does not error
Product: Red Hat Enterprise Linux 3
Classification: Red Hat
Component: ypserv (Show other bugs)
All Linux
medium Severity high
: ---
: ---
Assigned To: Chris Feist
Jay Turner
: 85262 (view as bug list)
Depends On:
Blocks: 123574
  Show dependency treegraph
Reported: 2004-05-27 10:26 EDT by Aaron Spangler
Modified: 2015-01-07 19:07 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2005-01-18 08:13:50 EST
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 14:14 EDT, Aaron Spangler
no flags Details | Diff
new nomap patch (2.55 KB, patch)
2004-09-01 12:46 EDT, Steve Dickson
no flags Details | Diff
Ethereal captures of ypserv-2.10 (147.96 KB, application/gzip)
2004-12-06 14:53 EST, Aaron Spangler
no flags Details

  None (edit)
Description Aaron Spangler 2004-05-27 10:26:01 EDT
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 14:11:06 EDT
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 14:14:37 EDT
Created attachment 100636 [details]
replacement 'nomap' patch
Comment 3 Aaron Spangler 2004-05-27 14:16:52 EDT
The attached patch works on ypserv-2.8-1 or ypserv-2.8-6
Comment 6 Steve Dickson 2004-07-02 16:16:45 EDT
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 09:39:31 EDT
ypserv-2.8-6 has the same problem.  (Verified)
Comment 8 Aaron Spangler 2004-07-06 09:42:41 EDT
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 15:21:36 EDT
Fixed in yp-tools-2.8-6
Comment 10 Aaron Spangler 2004-09-01 09:01:57 EDT

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 12:46:42 EDT
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 12:49:43 EDT
No I did mean yp-tools-2.8-6 since does fix bug
in ypcat.
Comment 13 Steve Dickson 2004-09-10 11:10:50 EDT
*** Bug 85262 has been marked as a duplicate of this bug. ***
Comment 14 Steve Dickson 2004-09-14 10:45:29 EDT
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 10:19:07 EST
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 06:25:49 EST
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 14:53:40 EST
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 15:32:55 EST
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 17:27:45 EST
Yup. Same RPM.
Comment 20 John Flanagan 2004-12-21 15:23:42 EST
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 08:13:50 EST
Closing out based on comment 26.
Comment 28 Aaron Spangler 2005-01-18 09:22:48 EST
Comment 26 is not public!    I see comment #20 and comment #27, but thats it. 
Comment 29 Aaron Spangler 2005-01-18 09:23:59 EST
Please let me know the status of this bugzilla. 
Comment 30 Chris Feist 2005-01-18 11:14:32 EST
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 11:22:43 EST
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 11:02:09 EST
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.