Author: gd
Date: 2005-05-31 16:21:06 +0000 (Tue, 31 May 2005)
New Revision: 7145

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

Log:
reuse the WINBIND_REQUIRED_MEMBERSHIP constant. 

This is just cosmetic but prevents people from thinking that the
pam_winbind "require_membership_of"-option is not yet implemented :)

Guenther

Modified:
   branches/SAMBA_3_0/source/nsswitch/pam_winbind.c


Changeset:
Modified: branches/SAMBA_3_0/source/nsswitch/pam_winbind.c
===================================================================
--- branches/SAMBA_3_0/source/nsswitch/pam_winbind.c    2005-05-31 16:11:46 UTC 
(rev 7144)
+++ branches/SAMBA_3_0/source/nsswitch/pam_winbind.c    2005-05-31 16:21:06 UTC 
(rev 7145)
@@ -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