AIX usrinfo() cleanup.

Ben Lindstrom mouring at etoh.eviladmin.org
Sat Jun 29 03:03:15 EST 2002


Can we do this?  Or should we drop the whole char *tty; ?  There will
be no way of setting the TTY= correctly while  using privsep (Mainly for
multiple streams over single session).

The only thing we really could do is do:

In do_setusercontext()

if (use_privsep)
	aix_usrinfo(pw, NULL);

and back in the old spot put:

if (!use_privsep)
	aix_usrinfo(pw, s->ttyfd == -1 ? NULL : s->tty);


that should allow users who need TTY set to at least have a working
OpenSSH. Maybe add in a line to INSTALL or README about this issue.

I'm more in favor of totally dumping TTY= setting until someone screams.

- Ben


Index: session.c
===================================================================
RCS file: /var/cvs/openssh/session.c,v
retrieving revision 1.208
diff -u -r1.208 session.c
--- session.c	26 Jun 2002 13:51:06 -0000	1.208
+++ session.c	28 Jun 2002 17:07:11 -0000
@@ -1210,7 +1210,7 @@
 #  endif /* defined(WITH_IRIX_PROJECT) || defined(WITH_IRIX_JOBS) || defined(WITH_IRIX_ARRAY) */
 # ifdef _AIX
 		/* XXX: Disable tty setting.  Enabled if required later */
-		aix_usrinfo(pw, &tty, -1);
+		aix_usrinfo(pw, NULL);
 # endif /* _AIX */
 		/* Permanently switch to the desired uid. */
 		permanently_set_uid(pw);
 #else /* HAVE_OSF_SIA */
Index: openbsd-compat/port-aix.c
===================================================================
RCS file: /var/cvs/openssh/openbsd-compat/port-aix.c,v
retrieving revision 1.3
diff -u -r1.3 port-aix.c
--- openbsd-compat/port-aix.c	21 Jun 2002 00:01:19 -0000	1.3
+++ openbsd-compat/port-aix.c	28 Jun 2002 17:07:11 -0000
@@ -11,13 +11,11 @@
  * actually use this and die if it's not set
  */
 void
-aix_usrinfo(struct passwd *pw, char *tty, int ttyfd)
+aix_usrinfo(struct passwd *pw, char *tty)
 {
 	u_int i;
 	char *cp=NULL;

-	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, tty, 0, 0);
Index: openbsd-compat/port-aix.h
===================================================================
RCS file: /var/cvs/openssh/openbsd-compat/port-aix.h,v
retrieving revision 1.4
diff -u -r1.4 port-aix.h
--- openbsd-compat/port-aix.h	21 Jun 2002 00:01:19 -0000	1.4
+++ openbsd-compat/port-aix.h	28 Jun 2002 17:07:11 -0000
@@ -1,5 +1,5 @@
 #ifdef _AIX

-void aix_usrinfo(struct passwd *pw, char *tty, int ttyfd);
+void aix_usrinfo(struct passwd *pw, char *tty);

 #endif /* _AIX */





More information about the openssh-unix-dev mailing list