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

NIS storm fix II



I compiled a new c library and its availabe from
ftp.fuller.edu/Linux/debian/libc

My initial patch was totally wrong...

And also my assertion that the NIS code for groups does not work. I
checked it while at this stuff and it worked to my surprise.

I did not reboot my system after installing it and it seems that the login
process still does the old exhaustive search one time but when the shell
comes up no NIS search is done anymore. Wonder whats going on here?
Do I need to reboot?

So this patch will reduce functionality.  You will loose the group
membership made through listing userid after the password entry for the
tools using initgroup to figure out the extra groups a user belongs to.
The regular group listed after the uid entry in /etc/passwd will work
fine.

Groups can be made NIS searchable with

+group

in /etc/groups. Only the 
+::::
and
+

will be omitted when doing the initgroups() 


--- initgroups.c.orig	Wed May 31 22:08:15 1995
+++ initgroups.c	Thu Sep 26 14:41:13 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)
         {


{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
{}    Snail Mail:   FTS Box 466, 135 N.Oakland Ave, Pasadena, CA 91182        {}
{}    FISH Internet System Administrator at Fuller Theological Seminary       {}
{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}{}
PGP Public Key  =  FB 9B 31 21 04 1E 3A 33  C7 62 2F C0 CD 81 CA B5 


Reply to: