The Samba-Bugzilla – Attachment 7798 Details for
Bug 9105
check_password_quality does not properly handle non-ASCII characters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
This patch seems to fix the bug.
0001-support-for-non-ascii-in-check_password_quality.patch (text/plain), 1.37 KB, created by
Arvid Requate
on 2012-08-21 17:22:27 UTC
(
hide
)
Description:
This patch seems to fix the bug.
Filename:
MIME Type:
Creator:
Arvid Requate
Created:
2012-08-21 17:22:27 UTC
Size:
1.37 KB
patch
obsolete
>From cf0bc703b3939e79c38c604a4142a53757a0a90e Mon Sep 17 00:00:00 2001 >From: Arvid Requate <requate@univention.de> >Date: Tue, 21 Aug 2012 19:09:36 +0200 >Subject: [PATCH] support for non-ascii in check_password_quality > >--- > lib/util/genrand.c | 11 ++++++++--- > 1 file changed, 8 insertions(+), 3 deletions(-) > >diff --git a/lib/util/genrand.c b/lib/util/genrand.c >index 57884ef..72208be 100644 >--- a/lib/util/genrand.c >+++ b/lib/util/genrand.c >@@ -22,6 +22,7 @@ > #include "includes.h" > #include "system/filesys.h" > #include "../lib/crypto/crypto.h" >+#include "lib/util/charset/charset.h" > #include "system/locale.h" > > /** >@@ -304,19 +305,23 @@ _PUBLIC_ bool check_password_quality(const char *s) > { > int has_digit=0, has_capital=0, has_lower=0, has_special=0, has_high=0; > const char* reals = s; >+ struct smb_iconv_handle *ic = get_iconv_handle(); > while (*s) { >+ size_t c_size; >+ codepoint_t c = next_codepoint_handle(ic, s, &c_size); >+ > if (isdigit((unsigned char)*s)) { > has_digit |= 1; >- } else if (isupper((unsigned char)*s)) { >+ } else if (isupper_m(c)) { > has_capital |= 1; >- } else if (islower((unsigned char)*s)) { >+ } else if (islower_m(c)) { > has_lower |= 1; > } else if (isascii((unsigned char)*s)) { > has_special |= 1; > } else { > has_high++; > } >- s++; >+ s += c_size; > } > > return ((has_digit + has_lower + has_capital + has_special) >= 3 >-- >1.7.10.4 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 9105
:
7798
|
7804
|
7805
|
8530