Call for testing.

Ben Lindstrom mouring at etoh.eviladmin.org
Mon Feb 25 04:18:46 EST 2002


On Sun, 24 Feb 2002, Manton, Doug wrote:

> Hi Ben,
>
> The compilation of port-aix fails because the Session type is undefined.
> I tried moving this definition out of session.c into session-types.h and
> including it from port-aix.h and session.c.  I had to include auth.h,
> usersec.h and xmalloc.h to get port-aix to compile cleanly since it
> relies on types and functions defined therein.
>
> However, this broke sshconnect2.c.  It seems that sshconnect2.c defines
> an Authctxt that conflicts with the one defined in auth.h.
>
> Patch attached to clarify my explanation.  I will continue to look at
> this during the week.  Any ideas greatly received.
>
Eep.. I got a better idea.=) Lets leave the session structures where
they belong and just pass what we need from them to do the work.  Try
the attached patch.

Somewhere in the back of my mind I knew I should not have depending
on 'Session *s' to be useful. =)

Index: session.c
===================================================================
RCS file: /var/cvs/openssh/session.c,v
retrieving revision 1.181
diff -u -r1.181 session.c
--- session.c	21 Feb 2002 15:37:04 -0000	1.181
+++ session.c	24 Feb 2002 18:04:44 -0000
@@ -57,10 +57,6 @@
 #include "canohost.h"
 #include "session.h"

-#if defined(HAVE_USERSEC_H)
-#include <usersec.h>
-#endif
-
 #ifdef HAVE_CYGWIN
 #include <windows.h>
 #include <sys/cygwin.h>
@@ -1147,7 +1143,7 @@
 		irix_setusercontext(pw);
 #  endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
 #ifdef _AIX
-		aix_usrinfo(s)
+		aix_usrinfo(s->pw, s->tty, s->ttyfd);
 #endif
 		/* Permanently switch to the desired uid. */
 		permanently_set_uid(pw);
Index: openbsd-compat/port-aix.c
===================================================================
RCS file: /var/cvs/openssh/openbsd-compat/port-aix.c,v
retrieving revision 1.1
diff -u -r1.1 port-aix.c
--- openbsd-compat/port-aix.c	19 Feb 2002 20:27:57 -0000	1.1
+++ openbsd-compat/port-aix.c	24 Feb 2002 18:04:44 -0000
@@ -2,7 +2,12 @@

 #ifdef _AIX

+#ifdef HAVE_USERSEC_H
+#include <usersec.h>
+#endif /* HAVE_USERSEC_H */
+
 #include <uinfo.h>
+#include <../xmalloc.h>

 /* AIX limits */
 #if defined(HAVE_GETUSERATTR) && !defined(S_UFSIZE_HARD) && defined(S_UFSIZE)
@@ -101,17 +106,16 @@
  * actually use this and die if it's not set
  */
 void
-aix_usrinfo(Session *s)
+aix_usrinfo(struct passwd *pw, char *tty, int ttyfd)
 {
-	struct passwd *pw = s->pw;
 	u_int i;
-	const char *cp=NULL;
+	char *cp=NULL;

-	if (s->ttyfd == -1)
-		s->tty[0] = '\0';
-	cp = xmalloc(22 + strlen(s->tty) + 2 * strlen(pw->pw_name));
+	if (ttyfd == -1)
+		tty[0] = '\0';
+	cp = xmalloc(22 + strlen(tty) + 2 * strlen(pw->pw_name));
 	i = sprintf(cp, "LOGNAME=%s%cNAME=%s%cTTY=%s%c%c", pw->pw_name, 0,
-	    pw->pw_name, 0, s->tty, 0, 0);
+	    pw->pw_name, 0, tty, 0, 0);
 	if (usrinfo(SETUINFO, cp, i) == -1)
 		fatal("Couldn't set usrinfo: %s", strerror(errno));
 	debug3("AIX/UsrInfo: set len %d", i);




More information about the openssh-unix-dev mailing list