mirror of
https://github.com/samba-team/samba.git
synced 2024-12-25 23:21:54 +03:00
Added "passwd chat timeout" parameter. Docs to follow.
Jeremy.
This commit is contained in:
parent
71333299a6
commit
16097f2072
@ -262,6 +262,7 @@ typedef struct
|
||||
BOOL bPamPasswordChange;
|
||||
BOOL bUnixPasswdSync;
|
||||
BOOL bPasswdChatDebug;
|
||||
int iPasswdChatTimeout;
|
||||
BOOL bTimestampLogs;
|
||||
BOOL bNTSmbSupport;
|
||||
BOOL bNTPipeSupport;
|
||||
@ -797,6 +798,7 @@ static struct parm_struct parm_table[] = {
|
||||
{"passwd program", P_STRING, P_GLOBAL, &Globals.szPasswdProgram, NULL, NULL, FLAG_ADVANCED},
|
||||
{"passwd chat", P_STRING, P_GLOBAL, &Globals.szPasswdChat, NULL, NULL, FLAG_ADVANCED},
|
||||
{"passwd chat debug", P_BOOL, P_GLOBAL, &Globals.bPasswdChatDebug, NULL, NULL, FLAG_ADVANCED},
|
||||
{"passwd chat timeout", P_INTEGER, P_GLOBAL, &Globals.iPasswdChatTimeout, NULL, NULL, FLAG_ADVANCED},
|
||||
{"username map", P_STRING, P_GLOBAL, &Globals.szUsernameMap, NULL, NULL, FLAG_ADVANCED},
|
||||
{"password level", P_INTEGER, P_GLOBAL, &Globals.pwordlevel, NULL, NULL, FLAG_ADVANCED},
|
||||
{"username level", P_INTEGER, P_GLOBAL, &Globals.unamelevel, NULL, NULL, FLAG_ADVANCED},
|
||||
@ -1412,6 +1414,7 @@ static void init_globals(void)
|
||||
Globals.bUnixPasswdSync = False;
|
||||
Globals.bPamPasswordChange = False;
|
||||
Globals.bPasswdChatDebug = False;
|
||||
Globals.iPasswdChatTimeout = 2; /* 2 second default. */
|
||||
Globals.bUnicode = True; /* Do unicode on the wire by default */
|
||||
Globals.bNTPipeSupport = True; /* Do NT pipes by default. */
|
||||
Globals.bNTStatusSupport = True; /* Use NT status by default. */
|
||||
@ -1725,6 +1728,7 @@ FN_GLOBAL_BOOL(lp_bind_interfaces_only, &Globals.bBindInterfacesOnly)
|
||||
FN_GLOBAL_BOOL(lp_pam_password_change, &Globals.bPamPasswordChange)
|
||||
FN_GLOBAL_BOOL(lp_unix_password_sync, &Globals.bUnixPasswdSync)
|
||||
FN_GLOBAL_BOOL(lp_passwd_chat_debug, &Globals.bPasswdChatDebug)
|
||||
FN_GLOBAL_INTEGER(lp_passwd_chat_timeout, &Globals.iPasswdChatTimeout)
|
||||
FN_GLOBAL_BOOL(lp_unicode, &Globals.bUnicode)
|
||||
FN_GLOBAL_BOOL(lp_nt_pipe_support, &Globals.bNTPipeSupport)
|
||||
FN_GLOBAL_BOOL(lp_nt_status_support, &Globals.bNTStatusSupport)
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user