AIX loginsuccess and aixloginmsg ?

Jarno Huuskonen jhuuskon at messi.uku.fi
Wed Jan 3 19:31:13 EST 2001


Hi,

I noticed that the AIX specific loginsuccess call uses 
char *aixloginmsg to retrieve login information. Later this message is
printed in session.c (around line 753). Loginsuccess mallocs space for
this message and according to the aix docs it's the responsibility of the
calling program to free this message.

I didn't notice any code in openssh that would free the aixloginmsg.
Can somebody confirm/test if aixloginmsg should be freed ?

If so this little patch might work (I didn't test this  !!!!!):
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^

--- session.c-orig      Wed Jan  3 10:19:31 2001
+++ session.c   Wed Jan  3 10:20:48 2001
@@ -750,8 +750,10 @@
                print_pam_messages();
 #endif /* USE_PAM */
 #ifdef WITH_AIXAUTHENTICATE
-       if (aixloginmsg && *aixloginmsg)
+       if (aixloginmsg && *aixloginmsg) {
                printf("%s\n", aixloginmsg);
+               free(aixloginmsg);
+       }
 #endif /* WITH_AIXAUTHENTICATE */
 
        if (last_login_time != 0) {

Also what about the loginrestrictions call ? Should openssh free the
loginmsg from loginrestrictions call ? The aix docs are not clear about this. 

-Jarno

-- 
Jarno Huuskonen - System Administrator   |  Jarno.Huuskonen at uku.fi
University of Kuopio - Computer Centre   |  Work:   +358 17 162822
PO BOX 1627, 70211 Kuopio, Finland       |  Mobile: +358 40 5388169





More information about the openssh-unix-dev mailing list