svn commit: samba r12280 - in trunk/source: auth lib modules smbd

jra at samba.org jra at samba.org
Fri Dec 16 01:41:17 GMT 2005


Author: jra
Date: 2005-12-16 01:41:15 +0000 (Fri, 16 Dec 2005)
New Revision: 12280

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

Log:
unix_mask_match has been broken for *ever*... (How).
Ensure it returns a BOOL.
Jerry (and anyone else) please check this, I think
all uses are now correct but could do with another
set of eyes.
Jeremy.

Modified:
   trunk/source/auth/pampass.c
   trunk/source/lib/util.c
   trunk/source/modules/vfs_recycle.c
   trunk/source/smbd/chgpasswd.c


Changeset:
Modified: trunk/source/auth/pampass.c
===================================================================
--- trunk/source/auth/pampass.c	2005-12-16 01:41:12 UTC (rev 12279)
+++ trunk/source/auth/pampass.c	2005-12-16 01:41:15 UTC (rev 12280)
@@ -310,7 +310,7 @@
 				DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: trying to match |%s| to |%s|\n",
 						t->prompt, current_prompt ));
 
-				if (unix_wild_match(t->prompt, current_prompt) == 0) {
+				if (unix_wild_match(t->prompt, current_prompt)) {
 					fstrcpy(current_reply, t->reply);
 					DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_ON: We sent: %s\n", current_reply));
 					pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);
@@ -341,7 +341,7 @@
 				DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: trying to match |%s| to |%s|\n",
 						t->prompt, current_prompt ));
 
-				if (unix_wild_match(t->prompt, current_prompt) == 0) {
+				if (unix_wild_match(t->prompt, current_prompt)) {
 					fstrcpy(current_reply, t->reply);
 					DEBUG(10,("smb_pam_passchange_conv: PAM_PROMPT_ECHO_OFF: We sent: %s\n", current_reply));
 					pwd_sub(current_reply, udp->PAM_username, udp->PAM_password, udp->PAM_newpassword);

Modified: trunk/source/lib/util.c
===================================================================
--- trunk/source/lib/util.c	2005-12-16 01:41:12 UTC (rev 12279)
+++ trunk/source/lib/util.c	2005-12-16 01:41:15 UTC (rev 12280)
@@ -2640,6 +2640,7 @@
 
 /*******************************************************************
  Simple case insensitive interface to a UNIX wildcard matcher.
+ Returns True if match, False if not.
 *******************************************************************/
 
 BOOL unix_wild_match(const char *pattern, const char *string)
@@ -2660,7 +2661,7 @@
 	if (strequal(p2,"*"))
 		return True;
 
-	return unix_do_match(p2, s2) == 0;	
+	return unix_do_match(p2, s2);
 }
 
 /**********************************************************************

Modified: trunk/source/modules/vfs_recycle.c
===================================================================
--- trunk/source/modules/vfs_recycle.c	2005-12-16 01:41:12 UTC (rev 12279)
+++ trunk/source/modules/vfs_recycle.c	2005-12-16 01:41:15 UTC (rev 12280)
@@ -319,7 +319,7 @@
 	}
 
 	for(i=0; haystack_list[i] ; i++) {
-		if(!unix_wild_match(haystack_list[i], needle)) {
+		if(unix_wild_match(haystack_list[i], needle)) {
 			return True;
 		}
 	}

Modified: trunk/source/smbd/chgpasswd.c
===================================================================
--- trunk/source/smbd/chgpasswd.c	2005-12-16 01:41:12 UTC (rev 12279)
+++ trunk/source/smbd/chgpasswd.c	2005-12-16 01:41:15 UTC (rev 12280)
@@ -263,7 +263,7 @@
 				pstrcpy( str, buffer);
 				trim_char( str, ' ', ' ');
 
-				if ((match = (unix_wild_match(expected, str) == 0))) {
+				if ((match = unix_wild_match(expected, str)) == True) {
 					/* Now data has started to return, lower timeout. */
 					timeout = lp_passwd_chat_timeout() * 100;
 				}



More information about the samba-cvs mailing list