[SCM] Samba Shared Repository - branch master updated

Garming Sam garming at samba.org
Mon Aug 7 03:35:02 UTC 2017

The branch, master has been updated
       via  6d65d67 tests samba_tool: fix flapping user-virtualCryptSHA test
      from  3a2a9d8 idmap: remove unused function idmap_is_online()


- Log -----------------------------------------------------------------
commit 6d65d679f151aea7b4d8137112aad25455c803d8
Author: Gary Lockyer <gary at catalyst.net.nz>
Date:   Fri Aug 4 06:45:37 2017 +1200

    tests samba_tool: fix flapping user-virtualCryptSHA test
    Fix flapping test, occasionally a password would be generated that failed
    the password criteria, which resulted in the test user not being
    created.  The tests relying on this user being present then failed.
    This patch ensures that the generated password contains at least one digit,
    at least one upper case letter and at least one lower case letter.
    The generated passwords do not contain special characters to avoid shell
    escaping issues.
    Signed-off-by: Gary Lockyer <gary at catalyst.net.nz>
    Reviewed-by: Garming Sam <garming at catalyst.net.nz>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    Autobuild-User(master): Garming Sam <garming at samba.org>
    Autobuild-Date(master): Mon Aug  7 05:34:24 CEST 2017 on sn-devel-144


Summary of changes:
 python/samba/tests/samba_tool/user_virtualCryptSHA.py | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

Changeset truncated at 500 lines:

diff --git a/python/samba/tests/samba_tool/user_virtualCryptSHA.py b/python/samba/tests/samba_tool/user_virtualCryptSHA.py
index 3ac4661..909de37 100644
--- a/python/samba/tests/samba_tool/user_virtualCryptSHA.py
+++ b/python/samba/tests/samba_tool/user_virtualCryptSHA.py
@@ -37,9 +37,17 @@ import string
 USER_NAME = "CryptSHATestUser"
 # Create a random 32 character password, containing only letters and
 # digits to avoid issues when used on the command line.
-USER_PASS = ''.join(random.choice(string.ascii_uppercase +
-                                  string.ascii_lowercase +
-                                  string.digits) for _ in range(32))
+# Ensuring the password includes at least:
+#   1 upper case letter
+#   1 lower case letter
+#   1 digit.
+USER_PASS = (''.join(random.choice(string.ascii_uppercase +
+                                   string.ascii_lowercase +
+                                   string.digits) for _ in range(29)) +
+             random.choice(string.ascii_uppercase) +
+             random.choice(string.ascii_lowercase) +
+             random.choice(string.digits))
 HASH_OPTION = "password hash userPassword schemes"
 # Get the value of an attribute from the output string

Samba Shared Repository

More information about the samba-cvs mailing list