]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r5431: couple of cimpile fixes from Jason Mader <jason@ncac.gwu.edu> -- BUGS 2341...
authorGerald Carter <jerry@samba.org>
Thu, 17 Feb 2005 15:17:16 +0000 (15:17 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 15:55:40 +0000 (10:55 -0500)
source/auth/auth_util.c
source/lib/util_unistr.c

index 7a186f65cdd0f25559f8e43e7ef7209387d47d42..f3c01a58ca68efea5a1c2b9dc8d5e3917834f2f3 100644 (file)
@@ -61,7 +61,6 @@ static int smb_create_user(const char *domain, const char *unix_username, const
 
 void auth_add_user_script(const char *domain, const char *username)
 {
-       uint32 rid;
        /*
         * User validated ok against Domain controller.
         * If the admin wants us to try and create a UNIX
@@ -79,7 +78,6 @@ void auth_add_user_script(const char *domain, const char *username)
                   
                if ( !winbind_create_user(username, NULL) ) {
                        DEBUG(5,("auth_add_user_script: winbindd_create_user() failed\n"));
-                       rid = 0;
                }
        }
 }
index bb9d69b164d2b00aafeb0bda7abc2cbd21cecf6e..55a21ebcbbcebf2bc22206e2ec8917493e8f7696 100644 (file)
@@ -454,16 +454,20 @@ smb_ucs2_t *strnrchr_w(const smb_ucs2_t *s, smb_ucs2_t c, unsigned int n)
 smb_ucs2_t *strstr_w(const smb_ucs2_t *s, const smb_ucs2_t *ins)
 {
        smb_ucs2_t *r;
-       size_t slen, inslen;
+       size_t inslen;
+
+       if (!s || !*s || !ins || !*ins) 
+               return NULL;
 
-       if (!s || !*s || !ins || !*ins) return NULL;
-       slen = strlen_w(s);
        inslen = strlen_w(ins);
        r = (smb_ucs2_t *)s;
+
        while ((r = strchr_w(r, *ins))) {
-               if (strncmp_w(r, ins, inslen) == 0) return r;
+               if (strncmp_w(r, ins, inslen) == 0) 
+                       return r;
                r++;
        }
+
        return NULL;
 }
 
@@ -736,16 +740,20 @@ smb_ucs2_t *strpbrk_wa(const smb_ucs2_t *s, const char *p)
 smb_ucs2_t *strstr_wa(const smb_ucs2_t *s, const char *ins)
 {
        smb_ucs2_t *r;
-       size_t slen, inslen;
+       size_t inslen;
+
+       if (!s || !*s || !ins || !*ins) 
+               return NULL;
 
-       if (!s || !*s || !ins || !*ins) return NULL;
-       slen = strlen_w(s);
        inslen = strlen(ins);
        r = (smb_ucs2_t *)s;
+
        while ((r = strchr_w(r, UCS2_CHAR(*ins)))) {
-               if (strncmp_wa(r, ins, inslen) == 0) return r;
+               if (strncmp_wa(r, ins, inslen) == 0) 
+                       return r;
                r++;
        }
+
        return NULL;
 }