[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Patch for NIS searches in libc



Here is a patch against the grp/initgroups.c file that will switch off
exhaustive searches. We have around 800 users right now and a search
through all those 800 groups takes awhile. This search is done usually
every minute (at) and on every login and other occasions when the userid
is changed. It can tie up your whole network easily with the current
debian scheme of using one group per user.

I would like to:

1. Have this put into libc5.4.X for Debian 1.2

2. Document this in the README.debian file for the Library.

libc5.2.X is running patched like this since awhile on campus.

Any Opposition?

--- initgroups.c.orig	Tue Oct  1 00:23:36 1996
+++ initgroups.c	Tue Oct  1 00:23:36 1996
@@ -73,20 +73,20 @@
             /* FIXME: must remember this group, it must not show up
                in grouplist! */
         continue;
-      
-      if ('+' == g->gr_name[0] && '\0' != g->gr_name[1])
+/* The following code was modified so that
+   1. +:::: or + in /etc/group does not lead to an exhaustive NIS search here
+   2. +<groupname> still works so if the sysop decides to have the overhead
+      then its still possible to have some groups evaluated via initgroups.
+  
+   Christoph Lameter, September 26, 1996
+*/
+      if ('+' == g->gr_name[0] && '\0' != g->gr_name[1] && ':' != g->gr_name[1])
         {
           g = __nis_getgrnam(g->gr_name + 1, g->gr_mem, info);
           if (NULL == g)
             continue;
         }
-      else if (0 == strcmp(g->gr_name, "+"))
-        {
-          ypmode = 1;
-          g = __nis_getgrent(1, info);
-          if (NULL == g)
-            break;
-        }
+      else if (g->gr_name[0]=='+') break;
 #endif /* YP */
       if (g->gr_gid != group)
         {


--- +++ --- +++ --- +++ --- +++ --- +++ --- +++ --- +++ ---
PGP Public Key  =  FB 9B 31 21 04 1E 3A 33  C7 62 2F C0 CD 81 CA B5 

--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-REQUEST@lists.debian.org . Trouble? e-mail to Bruce@Pixar.com


Reply to: