Bug 205472 - autofs compatilibity issue between nsswitch and NIS+ server
autofs compatilibity issue between nsswitch and NIS+ server
Status: CLOSED ERRATA
Product: Red Hat Enterprise Linux 4
Classification: Red Hat
Component: autofs (Show other bugs)
4.4
All Linux
medium Severity high
: ---
: ---
Assigned To: Jeffrey Moyer
Brock Organ
: Regression
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-09-06 12:25 EDT by Jeffrey Moyer
Modified: 2007-11-16 20:14 EST (History)
6 users (show)

See Also:
Fixed In Version: RHBA-2007-0274
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2007-05-07 19:28:16 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Fallback to yp_master if yp_order fails in nsswitch. (1.14 KB, patch)
2006-09-11 17:42 EDT, Jeffrey Moyer
no flags Details | Diff
Suppress errors from the nsswitch command (513 bytes, patch)
2006-09-12 14:27 EDT, Jeffrey Moyer
no flags Details | Diff

  None (edit)
Description Jeffrey Moyer 2006-09-06 12:25:20 EDT
+++ This bug was initially created as a clone of Bug #201972 +++

Description of problem:

autofs init script fails when nsswitch is called

yp_order function call in nsswitch is not working in our environment where yp 
is bound to NIS+ server running in compat mode.
(http://docs.sun.com/app/docs/doc/816-0214/6m6nf1pbg?a=view)

i have created a patch and it looks working fine anyway.
( still got the same error message when yp_order is called :( )

yp_master function is called right after yp_order call fails to check yp map 
is available under the mentioned situation.

i'm not sure whether yp_order call itself can be replaced with yp_master call 
or not but it seems possible.

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


How reproducible:
always when yp is bound to NIS+ server running in compatibility mode

Steps to Reproduce:
1. #/usr/lib64/autofs/nsswitch auto_master
  
Actual results:
do_ypcall: clnt_call: RPC: Procedure unavailable
do_ypcall: clnt_call: RPC: Procedure unavailable


Expected results:
yp:auto_master

Additional info:
following patch is created after rpmbuild -bp autofs.spec

--- autofs-4.1.3/lib/nsswitch.c.orig	2006-08-09 16:44:08.000000000 +0900
+++ autofs-4.1.3/lib/nsswitch.c	2006-08-09 16:58:53.000000000 +0900
@@ -15,6 +15,7 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <rpcsvc/ypclnt.h>
+#include <rpc/types.h>
 #include "automount.h"
 
 #define MODPREFIX "nsswitch: "
@@ -204,6 +205,9 @@ static int isypmap(const char *loc)
 		return 0;
 	}
 	if ((err = yp_order(domainname, loc, &order)) != YPERR_SUCCESS) {
+		char hostname[MAXHOSTNAMELEN+1];
+		if ((err = yp_master(domainname, loc, (char**)&hostname)) == 
YPERR_SUCCESS)
+			return 1;
 		debug(MODPREFIX "unable to find map, %s in domain, %s",
 		      loc, domainname);
 		return 0;

-- Additional comment from jmoyer@redhat.com on 2006-08-11 09:59 EST --
Thanks for the problem report and the patch.  You've got a bug in that patch,
though.  yp_master expects a char **, true, but it fills that in via strdup. 
So, you really want something like:

char *hostname;

if ((err = yp_master(domainname, loc, &hostname) == YPERR_SUCCESSS) {
        free(hostname);
        return 1;
}

I'll fix this up and queue it.  The way it's written, it is pretty safe to
include, I think.  This is a regression from previous versions of autofs, right?

It's strange that yp_order isn't supported by your nisplus implementation.  Be
sure to file a bug there, too!

-- Additional comment from hyunmo.kang@hynix.com on 2006-08-13 19:36 EST --
thanks for the additional work ! :)

i'm afraid that they are not going to fix this because they've already 
specified "This function is not supported if the ypbind process on the 
client's system is bound to an NIS+ server running in "YP-compatibility 
mode.""(quoted from the link) and that is exactly what our configuration is :(



-- Additional comment from tkincaid@redhat.com on 2006-08-25 13:15 EST --
Adding keyword regression.
Comment 1 RHEL Product and Program Management 2006-09-06 12:33:55 EDT
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.
Comment 4 Jeffrey Moyer 2006-09-11 17:42:47 EDT
Created attachment 136037 [details]
Fallback to yp_master if yp_order fails in nsswitch.

Here is the patch I put together for this problem.
Comment 5 Jeffrey Moyer 2006-09-12 08:56:04 EDT
A fix for this issue was built into autofs version 4.1.3-190.  Test rpms are
available at the following URL:
  http://people.redhat.com/jmoyer/autofs/rhel4/4.1.3-190
Comment 7 Jeffrey Moyer 2006-09-12 14:27:31 EDT
Created attachment 136096 [details]
Suppress errors from the nsswitch command

Does this patch clear up the errors being reported?
Comment 12 Jeffrey Moyer 2006-10-16 12:19:20 EDT
Any testing results from 4.1.3-194?
Comment 16 Jeffrey Moyer 2006-10-20 18:14:16 EDT
I seem to have missed an invocation of nsswitch.  autofs-4.1.3-196 has a fix for
this.
Comment 20 RHEL Product and Program Management 2006-12-12 12:06:06 EST
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being marked as a blocker for this release.  

Please resolve ASAP.
Comment 21 RHEL Product and Program Management 2006-12-12 12:06:06 EST
This bugzilla has Keywords: Regression.  

Since no regressions are allowed between releases, 
it is also being marked as a blocker for this release.  

Please resolve ASAP.
Comment 23 Alexander Antipov 2007-03-02 06:44:14 EST
In my case (Solaris 10 as NIS+ server running in compat mode) works ONLY 4.1.3-
67.
All another rpms from RHN updates (4.1.3-131, 4.1.3-155, 4.1.3-169, 4.1.3-187), 
and all versions from http://people.redhat.com/~jmoyer/autofs/rhel4/ don`t work.
Comment 26 Red Hat Bugzilla 2007-05-07 19:28:16 EDT
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.

http://rhn.redhat.com/errata/RHBA-2007-0274.html

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