[BACK]Return to groupaccess.c CVS log [TXT][DIR] Up to [local] / src / usr.bin / ssh

Diff for /src/usr.bin/ssh/groupaccess.c between version 1.12 and 1.13

version 1.12, 2006/08/03 03:34:42 version 1.13, 2008/07/04 03:44:59
Line 29 
Line 29 
 #include <grp.h>  #include <grp.h>
 #include <unistd.h>  #include <unistd.h>
 #include <stdarg.h>  #include <stdarg.h>
   #include <string.h>
   
 #include "xmalloc.h"  #include "xmalloc.h"
 #include "groupaccess.h"  #include "groupaccess.h"
Line 75 
Line 76 
                         if (match_pattern(groups_byname[i], groups[j]))                          if (match_pattern(groups_byname[i], groups[j]))
                                 return 1;                                  return 1;
         return 0;          return 0;
   }
   
   /*
    * Return 1 if one of user's groups matches group_pattern list.
    * Return 0 on negated or no match.
    */
   int
   ga_match_pattern_list(const char *group_pattern)
   {
           int i, found = 0;
           size_t len = strlen(group_pattern);
   
           for (i = 0; i < ngroups; i++) {
                   switch (match_pattern_list(groups_byname[i],
                       group_pattern, len, 0)) {
                   case -1:
                           return 0;       /* Negated match wins */
                   case 0:
                           continue;
                   case 1:
                           found = 1;
                   }
           }
           return found;
 }  }
   
 /*  /*

Legend:
Removed from v.1.12  
changed lines
  Added in v.1.13