r12279: unix_mask_match has been broken for *ever*... (How).
authorJeremy Allison <jra@samba.org>
Fri, 16 Dec 2005 01:41:12 +0000 (01:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:05:51 +0000 (11:05 -0500)
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. Essential for 3.0.21 release.
Jeremy.
(This used to be commit 0c7b8a7637e760fcb6629092f36b610b8c71f5c9)

source3/auth/pampass.c
source3/lib/util.c
source3/modules/vfs_recycle.c
source3/smbd/chgpasswd.c

index 18d83ee36485459bdcca1eb749730a8cb71bab20..26b45c5ff8a8ff347dfe04a42627007cea5e59e7 100644 (file)
@@ -310,7 +310,7 @@ static int smb_pam_passchange_conv(int num_msg,
                                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 @@ static int smb_pam_passchange_conv(int num_msg,
                                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);
index 677871e2d061a99ccf0cee48386a99a81bffcf9e..38878befc776e4454c3c54b660d6c1986045cdfd 100644 (file)
@@ -2640,6 +2640,7 @@ static BOOL unix_do_match(const char *regexp, const char *str)
 
 /*******************************************************************
  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 @@ BOOL unix_wild_match(const char *pattern, const char *string)
        if (strequal(p2,"*"))
                return True;
 
-       return unix_do_match(p2, s2) == 0;      
+       return unix_do_match(p2, s2);
 }
 
 /**********************************************************************
index 0abcc29bcf94a4bd94f9e35cc463cc18cf33fb76..28593f4fbb72a5126e662bc6d26a6828cfe3a2df 100644 (file)
@@ -319,7 +319,7 @@ static BOOL matchparam(const char **haystack_list, const char *needle)
        }
 
        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;
                }
        }
index c1168583ae7e2a9969fc45832167b8986c61a117..fed73db043f2327eaf5a14fad1c7b0e56e98f8e3 100644 (file)
@@ -263,7 +263,7 @@ static int expect(int master, char *issue, char *expected)
                                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;
                                }