summaryrefslogtreecommitdiff
path: root/source3/smbd/chgpasswd.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/chgpasswd.c')
-rw-r--r--source3/smbd/chgpasswd.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/chgpasswd.c b/source3/smbd/chgpasswd.c
index d99570ff7c..5caf78e41a 100644
--- a/source3/smbd/chgpasswd.c
+++ b/source3/smbd/chgpasswd.c
@@ -245,7 +245,8 @@ static int expect(int master, char *issue, char *expected)
if (strequal(expected, "."))
return True;
- timeout = 2000;
+ /* Initial timeout. */
+ timeout = lp_passwd_chat_timeout() * 1000;
nread = 0;
buffer[nread] = 0;
@@ -261,8 +262,10 @@ static int expect(int master, char *issue, char *expected)
pstrcpy( str, buffer);
trim_char( str, ' ', ' ');
- if ((match = (unix_wild_match(expected, str) == 0)))
- timeout = 200;
+ if ((match = (unix_wild_match(expected, str) == 0))) {
+ /* Now data has started to return, lower timeout. */
+ timeout = lp_passwd_chat_timeout() * 100;
+ }
}
}