Author: gd
Date: 2005-05-31 16:22:12 +0000 (Tue, 31 May 2005)
New Revision: 7146

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=7146

Log:
merge from 3_0. 

Guenther

Modified:
   trunk/source/nsswitch/pam_winbind.c


Changeset:
Modified: trunk/source/nsswitch/pam_winbind.c
===================================================================
--- trunk/source/nsswitch/pam_winbind.c 2005-05-31 16:21:06 UTC (rev 7145)
+++ trunk/source/nsswitch/pam_winbind.c 2005-05-31 16:22:12 UTC (rev 7146)
@@ -487,22 +487,24 @@
 #endif
      }
 
-     /* Retrieve membership-string here */
-     for ( i=0; i<argc; i++ ) {
+     if (ctrl & WINBIND_REQUIRED_MEMBERSHIP) {
+            
+         for ( i=0; i<argc; i++ ) {
 
-        if ((strncmp(argv[i], "require_membership_of", 
strlen("require_membership_of")) == 0) 
-            || (strncmp(argv[i], "require-membership-of", 
strlen("require-membership-of")) == 0)) {
+            if ((strncmp(argv[i], "require_membership_of", 
strlen("require_membership_of")) == 0) ||
+                (strncmp(argv[i], "require-membership-of", 
strlen("require-membership-of")) == 0)) {
 
-            char *p;
-            char *parm = strdup(argv[i]);
+               char *p;
+               char *parm = strdup(argv[i]);
 
-            if ( (p = strchr( parm, '=' )) == NULL) {
-               _pam_log(LOG_INFO, "no \"=\" delimiter for 
\"require_membership_of\" found\n");
-               break;
+               if ( (p = strchr( parm, '=' )) == NULL) {
+                  _pam_log(LOG_INFO, "no \"=\" delimiter for 
\"require_membership_of\" found\n");
+                  break;
+               }
+
+               member = strdup(p+1);
             }
-
-            member = strdup(p+1);
-        }
+         }
      }
 
      /* Now use the username to look up password */

Reply via email to