Description of problem: Suns ypserver sends the YP_NOMORE status at the end of yp_all map transfers (such as ypcat passwd). Some programs rely on the final status message to ensure a complete map transfer. An example of such program is a perl module called Net::NIS. Comparing packet sniffs when a nis client is bound to a Solaris ypserv versus Linux ypserv shows the last record is missing. Version-Release number of selected component (if applicable): using current redhat ypserv-2.8-6.src.rpm How reproducible: Every Time Steps to Reproduce: 1. Setup Solaris & Linux Slave NIS servers. 2. Select a small nis map (such as auto.master) 3. Start packet sniffer when nis client is bound to Solaris ypserv 4. Perform 'ypcat auto.master' on client (or similar map) 5. Stop packet sniffer 6. rebind client to Linux box 7. Restart packet sniffer 8. Perform 'ypcat auto.master' again. 9. Stop sniffer 10. Compare the responses to 'yp_all' for the auto.master map 11. Notice the Linux one is missing the final record. Actual results: Remote Procedure Call Yellow Pages Service Program Version: 2 V2 Procedure: ALL (8) More: Yes Status: YP_TRUE (1) Value: auto.home -rw,nosuid,wsize=4096,rsize=4096 length: 42 contents: auto.home -rw,nosuid,wsize=4096,rsize=4096 fill bytes: opaque data Key: /home length: 5 contents: /home fill bytes: opaque data More: Yes Status: YP_TRUE (1) Value: auto.direct -ro,nosuid,wsize=4096,rsize=4096 length: 44 contents: auto.direct -ro,nosuid,wsize=4096,rsize=4096 Key: /- length: 2 contents: /- fill bytes: opaque data More: No Expected results: Remote Procedure Call Yellow Pages Service Program Version: 2 V2 Procedure: ALL (8) More: Yes Status: YP_TRUE (1) Value: auto.home -rw,nosuid,wsize=4096,rsize=4096 length: 42 contents: auto.home -rw,nosuid,wsize=4096,rsize=4096 fill bytes: opaque data Key: /home length: 5 contents: /home fill bytes: opaque data More: Yes Status: YP_TRUE (1) Value: auto.direct -ro,nosuid,wsize=4096,rsize=4096 length: 44 contents: auto.direct -ro,nosuid,wsize=4096,rsize=4096 Key: /- length: 2 contents: /- fill bytes: opaque data More: Yes Status: YP_NOMORE (2) Value: auto.direct -ro,nosuid,wsize=4096,rsize=4096 length: 44 contents: auto.direct -ro,nosuid,wsize=4096,rsize=4096 Key: /- length: 2 contents: /- fill bytes: opaque data More: No Additional info: none
The ypserv-2.8 code curently attempts to send the YP_NOMORE status after the last key/value pair is sent, however due to an off by one error in ypserv/ypserv_xdr.c, the last status record is suppressed.
Created attachment 101224 [details] ypserv-2.8-nomore.patch
Created attachment 101607 [details] Attache nomore patch
At first I was not too keen on adding an extra ypall entry just to set the YP_NOMORE status, so I looked into changing ypserver to return the YP_NOMORE status on the last ypall entry that had real data (i.e. exactly how SUN does it). It turns out this approach breaks the yp_all() glibc routine since it only expects ypall entries with a YP_TRUE status to contain data. So the ypall entries (that contained data) but had a YP_NOMORE status were being dropped. So attached is a patch that does the same thing as the original patch but makes sure the YP_NOMORE entries contain zeros instead of garbage.
Tried the augmented patch supplied by Steve. Tried in pre-prod environment. Works great! Exactly what we are looking for. Thanks.
An errata 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. http://rhn.redhat.com/errata/RHBA-2004-394.html