]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4-smbtorture: add torture_create_testuser_max_pwlen() that allows to set maxpwlen.
authorGünther Deschner <gd@samba.org>
Tue, 11 May 2010 21:55:53 +0000 (23:55 +0200)
committerGünther Deschner <gd@samba.org>
Tue, 11 May 2010 22:16:50 +0000 (00:16 +0200)
required for upcoming rap pwd tests.

Guenther

source4/torture/rpc/testjoin.c

index cad84dbe2f704e9e192d3f33f973cc74dc19cc3b..0e61960fec54a67bb0b4ca0005c23080a4966dda 100644 (file)
@@ -114,11 +114,12 @@ static NTSTATUS DeleteUser_byname(struct dcerpc_binding_handle *b,
   when finished
 */
 
-struct test_join *torture_create_testuser(struct torture_context *torture,
-                                         const char *username, 
-                                         const char *domain,
-                                         uint16_t acct_type,
-                                         const char **random_password)
+struct test_join *torture_create_testuser_max_pwlen(struct torture_context *torture,
+                                                   const char *username,
+                                                   const char *domain,
+                                                   uint16_t acct_type,
+                                                   const char **random_password,
+                                                   int max_pw_len)
 {
        NTSTATUS status;
        struct samr_Connect c;
@@ -317,7 +318,7 @@ again:
                policy_min_pw_len = pwp.out.info->min_password_length;
        }
 
-       random_pw = generate_random_password(join, MAX(8, policy_min_pw_len), 255);
+       random_pw = generate_random_password(join, MAX(8, policy_min_pw_len), max_pw_len);
 
        printf("Setting account password '%s'\n", random_pw);
 
@@ -394,6 +395,15 @@ failed:
 }
 
 
+struct test_join *torture_create_testuser(struct torture_context *torture,
+                                         const char *username,
+                                         const char *domain,
+                                         uint16_t acct_type,
+                                         const char **random_password)
+{
+       return torture_create_testuser_max_pwlen(torture, username, domain, acct_type, random_password, 255);
+}
+
 _PUBLIC_ struct test_join *torture_join_domain(struct torture_context *tctx,
                                               const char *machine_name, 
                                      uint32_t acct_flags,