Thayne Harbaugh <[EMAIL PROTECTED]> writes:

> More specificly, I notice that lshd exits with the following error:
> 
> DEBUG: Received USERAUTH_REQUEST *****
> handle_connection: Received packet of type 50 (USERAUTH_REQUEST)
> DEBUG: Sent USERAUTH_SUCCESS (size 1 = 0x1)
> 00000000: 34                                4
> 
> write_buffer: do_write length = 36
> write_buffer: do_write closure->length = 36
> channel.c: do_connection_service()
> tcpforward_commands.c: do_make_tcpip_forward_handler()
> lsh_string_free: Not string!
> Aborted

I haven't tried to reproduce exactly your problem, but I found a bug
that had similar symptoms, so it might be it. Try the patch below. The
crucial part was the missing return statement. I wonder how old this
bug is.

/Niels

Index: src/server_password.c
===================================================================
RCS file: /lysator/cvsroot/nisse/lsh/src/server_password.c,v
retrieving revision 1.31
diff -u -a -r1.31 server_password.c
--- src/server_password.c       2000/10/15 20:22:26     1.31
+++ src/server_password.c       2001/01/31 18:04:45
@@ -53,7 +53,6 @@
 {
   CAST(userauth_password, self, s);

-  struct lsh_string *password = NULL;
   int change_passwd;

   username = utf8_to_local(username, 1, 1);
@@ -65,6 +64,8 @@

   if (parse_boolean(args, &change_passwd))
     {
+      struct lsh_string *password = NULL;
+
       if (change_passwd)
        {
          static const struct exception passwd_change_not_implemented
@@ -103,15 +104,15 @@
            }

          USER_VERIFY_PASSWORD(user, password, c, e);
+         return;
        }
+      if (password)
+       lsh_string_free(password);
     }

   /* Request was invalid */
   lsh_string_free(username);
-
-  if (password)
-    lsh_string_free(password);
-
+
   PROTOCOL_ERROR(e, "Invalid password USERAUTH message.");
 }


Reply via email to