AIX patch for openssh-3.7.1p2

Matt Richards matter at sover.net
Wed Oct 29 01:48:15 EST 2003


There are a couple of bugs in the openssh-3.7.1p2. The aix_setauthdb
function does not work with other types of authentication such as AFS/DFS.

The loginfailed test in configure is not correct. Also, AIX can use the
wtmp logging which I added in configure. Attached is the patch.

Thanks,
Matt Richards
-------------- next part --------------
*** openssh-3.7.1p2/openbsd-compat/port-aix.c	Mon Jul 14 02:41:55 2003
--- openssh-3.7.1p2.patched/openbsd-compat/port-aix.c	Mon Sep 22 12:42:00 2003
***************
*** 96,102 ****
--- 96,104 ----
  	if (geteuid() != 0)
  		return;
  
+ #if 0
  	aix_setauthdb(user);
+ #endif
  #  ifdef AIX_LOGINFAILED_4ARG
  	loginfailed((char *)user, hostname, (char *)ttyname, AUDIT_FAIL_AUTH);
  #  else
*** openssh-3.7.1p2/auth-passwd.c	Fri Sep 12 20:41:56 2003
--- openssh-3.7.1p2.patched/auth-passwd.c	Mon Sep 22 12:24:15 2003
***************
*** 110,116 ****
--- 110,118 ----
  				pw->pw_name, authmsg);
  
  	        	/* No pty yet, so just label the line as "ssh" */
+ #if 0
  			aix_setauthdb(authctxt->user);
+ #endif
  	        	if (loginsuccess(authctxt->user, host, "ssh", 
  			    &msg) == 0) {
  				if (msg != NULL) {
*** openssh-3.7.1p2/configure	Tue Sep 23 05:55:43 2003
--- openssh-3.7.1p2.patched/configure	Tue Oct 28 08:24:57 2003
***************
*** 3100,3105 ****
--- 3100,3106 ----
  # Check for some target-specific stuff
  case "$host" in
  *-*-aix*)
+ 	conf_wtmp_location=/var/adm/wtmp
  	CPPFLAGS="$CPPFLAGS -I/usr/local/include"
  	LDFLAGS="$LDFLAGS -L/usr/local/lib"
  	echo "$as_me:3105: checking how to specify blibpath for linker ($LD)" >&5
***************
*** 3284,3326 ****
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    cat >conftest.$ac_ext <<_ACEOF
- #line 3287 "configure"
  #include "confdefs.h"
! #include <usersec.h>
  
  int
  main ()
  {
- #ifndef loginfailed
-   char *p = (char *) loginfailed;
- #endif
  
!   ;
!   return 0;
  }
  _ACEOF
! rm -f conftest.$ac_objext
! if { (eval echo "$as_me:3303: \"$ac_compile\"") >&5
!   (eval $ac_compile) 2>&5
!   ac_status=$?
!   echo "$as_me:3306: \$? = $ac_status" >&5
!   (exit $ac_status); } &&
!          { ac_try='test -s conftest.$ac_objext'
!   { (eval echo "$as_me:3309: \"$ac_try\"") >&5
!   (eval $ac_try) 2>&5
!   ac_status=$?
!   echo "$as_me:3312: \$? = $ac_status" >&5
!   (exit $ac_status); }; }; then
!   ac_cv_have_decl_loginfailed=yes
! else
    echo "$as_me: failed program was:" >&5
! cat conftest.$ac_ext >&5
! ac_cv_have_decl_loginfailed=no
! fi
! rm -f conftest.$ac_objext conftest.$ac_ext
! fi
! echo "$as_me:3322: result: $ac_cv_have_decl_loginfailed" >&5
! echo "${ECHO_T}$ac_cv_have_decl_loginfailed" >&6
  if test $ac_cv_have_decl_loginfailed = yes; then
    echo "$as_me:3325: checking if loginfailed takes 4 arguments" >&5
  echo $ECHO_N "checking if loginfailed takes 4 arguments... $ECHO_C" >&6
--- 3285,3329 ----
    echo $ECHO_N "(cached) $ECHO_C" >&6
  else
    cat >conftest.$ac_ext <<_ACEOF
  #include "confdefs.h"
! #ifdef __cplusplus                                           
! extern "C"                                                   
! #endif           
  
+ int loginfailed ();
+ int (*f) ();
+ 
  int
  main ()
  {
  
! f=loginfailed
! ;
! return 0;
  }
  _ACEOF
! rm -f conftest.$ac_objext conftest$ac_exeext
! if { (eval echo "$as_me:3193: \"$ac_link\"") >&5
!   (eval $ac_link) 2>&5                         
!   ac_status=$?       
!   echo "$as_me:3196: \$? = $ac_status" >&5
!   (exit $ac_status); } &&                
!          { ac_try='test -s conftest$ac_exeext'
!   { (eval echo "$as_me:3199: \"$ac_try\"") >&5
!   (eval $ac_try) 2>&5                        
!   ac_status=$?                               
!   echo "$as_me:3202: \$? = $ac_status" >&5
!   (exit $ac_status); }; }; then          
!   ac_cv_have_decl_loginfailed=yes            
! else                          
    echo "$as_me: failed program was:" >&5
! cat conftest.$ac_ext >&5               
! ac_cv_have_decl_loginfailed=no             
! fi                       
! rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
! fi                                                          
! echo "$as_me:3212: result: $ac_cv_have_decl_loginfailed" >&5    
! echo "${ECHO_T}$ac_cv_have_decl_loginfailed" >&6           
  if test $ac_cv_have_decl_loginfailed = yes; then
    echo "$as_me:3325: checking if loginfailed takes 4 arguments" >&5
  echo $ECHO_N "checking if loginfailed takes 4 arguments... $ECHO_C" >&6


More information about the openssh-unix-dev mailing list