[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] examples: Fix disconnect after auth in ssh_server_fork
[Thread Prev] | [Thread Next]
- Subject: Re: [PATCH] examples: Fix disconnect after auth in ssh_server_fork
- From: Aris Adamantiadis <aris@xxxxxxxxxxxx>
- Reply-to: libssh@xxxxxxxxxx
- Date: Mon, 09 Jun 2014 23:30:27 +0200
- To: libssh@xxxxxxxxxx
Hi Audrius,
Thanks for your patch, we will commit your patch when possible.
Aris
Le 6/06/14 11:06, Audrius Butkevicius a écrit :
> It is very likely that auth packets and channel request packets get
> handled by
> separate poll calls, causing to disconnect the client if he has
> authenticated
> on the 3rd attempt, but has not yet had a channel allocated.
>
> Signed-off-by: Audrius Butkevicius <audrius.butkevicius@xxxxxxxxx>
> ---
> examples/ssh_server_fork.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/examples/ssh_server_fork.c b/examples/ssh_server_fork.c
> index 837db6f..70adaf8 100644
> --- a/examples/ssh_server_fork.c
> +++ b/examples/ssh_server_fork.c
> @@ -534,7 +534,7 @@ static void handle_session(ssh_event event,
> ssh_session session) {
> while (sdata.authenticated == 0 || sdata.channel == NULL) {
> /* If the user has used up all attempts, or if he hasn't been
> able to
> * authenticate in 10 seconds (n * 100ms), disconnect. */
> - if (sdata.auth_attempts >= 3 || n >= 100) {
> + if ((sdata.authenticated == 0 && sdata.auth_attempts >= 3) ||
> n > 100) {
> return;
> }
>
> --
> 1.7.2.5
>
>
>
>
>
>
>
| [PATCH] examples: Fix disconnect after auth in ssh_server_fork | Audrius Butkevicius <audrius.butkevicius@xxxxxxxxxxxxxxxx> |