This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: nss_compat in glibc-2.2.3 (Was: static binaries & netgroups)


Torsten Duwe <duwe@caldera.de> writes:

> To follow up on this older thread...
> 
>     HJL> On Fri, Feb 16, 2001 at 06:09:14PM +0100, Torsten Duwe wrote:
>     >> >> static binary doing getpwuid() or such + "passwd: compat" in >>
>     >> /etc/nsswitch.conf + "-@SOMEGROUP::::::" in /etc/passwd = crash.
>     >> 
>     >> >> Reducing "compat" to "files nis" eliminates the problem, as does
>     >> the >> removal of netgroup entries from passwd. Linking dynamically
>     >> also >> helps.
>     >> 
>     HJL> Please provide a complete testcase. I will look into it when I find
>     HJL> time.
> [...]
>     HJL> I don't have netgroups. You have to tell me how to reproduce it,
>     HJL> assuming I don't use NIS and know every little about netgroups.
> 
> OK, glibc-2.2.3 now breaks it completely; you don't even need netgroups any
> more :-( The failure happens even with dynamically linked programs.

This has been fixed since ages and even a patch has been put up on ftp
for this.  I'm appending it below.  Did you apply that patch?

> If you use "passwd: files nis" in /etc/nsswitch.conf everything works.
> A backward-compatible equivalent should be to change /etc/nsswitch.conf to
> "passwd: compat" and to append "+::::::" to /etc/passwd . Now even root
> cannot log in any more e.g. the getpw* functions return NULL.
> 
> I can provide a complete test case if this isn't enough, provided you already
> have NIS (passwd.by* maps at least) running.
> 
> Nobody uses nss_compat, it seems ?

That was a last minute change before the release - and Ulrich fixed it
just after the release.

Andreas

2001-04-27  Ulrich Drepper  <drepper@redhat.com>

	* nis/nss-nis.h: Correct test for invalid error number.
	* nis/nss-nisplus.h: Likewise.

	* nis/Makefile (libnss_compat-rountines): Add nss-nisplus.


Index: nis/nss-nis.h
===================================================================
RCS file: /cvs/glibc/libc/nis/nss-nis.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- nis/nss-nis.h	2001/04/26 13:43:15	1.2
+++ nis/nss-nis.h	2001/04/28 02:17:52	1.3
@@ -31,9 +31,9 @@
 static inline enum nss_status
 yperr2nss (int errval)
 {
-  if ((unsigned int) errval > __yperr2nss_count)
+  if ((unsigned int) errval >= __yperr2nss_count)
     return NSS_STATUS_UNAVAIL;
-  return __yperr2nss_tab[errval];
+  return __yperr2nss_tab[(unsigned int) errval];
 }
 
 #endif /* nis/nss-nis.h */
Index: nis/nss-nisplus.h
===================================================================
RCS file: /cvs/glibc/libc/nis/nss-nisplus.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- nis/nss-nisplus.h	2001/04/26 13:52:40	1.4
+++ nis/nss-nisplus.h	2001/04/28 02:19:00	1.5
@@ -32,9 +32,9 @@
 static inline enum nss_status
 niserr2nss (int errval)
 {
-  if ((unsigned int) errval > __niserr2nss_count)
+  if ((unsigned int) errval >= __niserr2nss_count)
     return NSS_STATUS_UNAVAIL;
-  return __niserr2nss_tab[errval];
+  return __niserr2nss_tab[(unsigned int) errval];
 }
 
 #endif /* nis/nss-nisplus.h */
Index: nis/Makefile
===================================================================
RCS file: /cvs/glibc/libc/nis/Makefile,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- nis/Makefile	2001/04/26 13:53:05	1.26
+++ nis/Makefile	2001/04/28 04:20:43	1.27
@@ -55,7 +55,7 @@
 		  nis_clone_res
 
 libnss_compat-routines	:= $(addprefix compat-,grp pwd spwd initgroups) \
-			   nisplus-parser nss-nis
+			   nisplus-parser nss-nis nss-nisplus
 libnss_compat-inhibit-o	= $(filter-out .os,$(object-suffixes))
 
 libnss_nis-routines	:= $(addprefix nis-,$(databases)) nis-initgroups \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]