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 */
At 12:03 PM -0500 6/28/02, Ben Lindstrom wrote:>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).Forgive a stupid question, but what is the implication of this? My possibiily incorrect understanding is that if it isn't set by OpenSSH, it can be set by "login" if UseLogin is set to yes. Sorry, but I'd like to understand what changes I might have to expect. Thanks, -S-> >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 */ > > >_______________________________________________ >openssh-unix-dev at mindrot.org mailing list >http://www.mindrot.org/mailman/listinfo/openssh-unix-dev-- Sandor W. Sklar - Unix Systems Administrator - Stanford University ITSS Non impediti ratione cogitationis. http://whippet.stanford.edu/~ssklar/
Hi, On Fri, Jun 28, 2002 at 12:03:15PM -0500, Ben Lindstrom wrote:> I'm more in favor of totally dumping TTY= setting until someone screams.If you ask me: drop it, and throw out junky code. If someone besides us needs usrinfo (and we do not use TTY=) they will complain. It should be mentioned in a README nonetheless (so that people running into "it works with rlogin but not with ssh" have a chance to guess why) gert -- USENET is *not* the non-clickable part of WWW! //www.muc.de/~gert/ Gert Doering - Munich, Germany gert at greenie.muc.de fax: +49-89-35655025 gert.doering at physik.tu-muenchen.de
Ya I saw that after I walked away to figure out how to fix the mess the last owners left me under my deck. It should be fixed plus the aix_usrinfo() patch is in now. - Ben On Thu, 4 Jul 2002, Darren Tucker wrote:> In late-breaking news, this is building from -current on AIX: > > gcc -o ssh-keysign ssh-keysign.o -L. -Lopenbsd-compat/ -L/usr/local/lib > -lssh -lopenbsd-compat -lz -lcrypto > ld: 0711-317 ERROR: Undefined symbol: .initialize_options > ld: 0711-317 ERROR: Undefined symbol: .read_config_file > ld: 0711-317 ERROR: Undefined symbol: .fill_default_options > ld: 0711-345 Use the -bloadmap or -bnoquiet option to obtain more > information. > collect2: ld returned 8 exit status > make: *** [ssh-keysign] Error 1 > > It looks like ssh-keysign now needs these functions from readconf.c. > Adding readconf.o to the gcc line allows it to link. > > -- > Darren Tucker (dtucker at zip.com.au) > GPG Fingerprint D9A3 86E9 7EEE AF4B B2D4 37C9 C982 80C7 8FF4 FA69 > Good judgement comes with experience. Unfortunately, the experience > usually comes from bad judgement. >