I have some troubles with subj and proper utmpx/wtmpx functionality. After successfull ssh connect to Solaris 8 box, I run #w 11:59am up 13:45, 1 user, load average: 0.00, 0.01, 0.02 User tty login@ idle JCPU PCPU what root console 11:43am 9 bash # Record about my pts/1 login is absent. Next command I run from Solaris 8 console after my ssh session is finished #who root console May 26 11:43 who: Error --- entry has ut_type of 29808 when maximum is 9 who: Error --- entry has ut_type of 29808 when maximum is 9 # Do anyone has some ideas? Max
On Fri, 26 May 2000, Max Pashkov wrote:> I have some troubles with subj and proper utmpx/wtmpx functionality. > After successfull ssh connect to Solaris 8 box, I runWhat options did you pass to ./configure? Could you send me the output of such configure. Thanks, Damien Miller -- | "Bombay is 250ms from New York in the new world order" - Alan Cox | Damien Miller - http://www.mindrot.org/ | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)
Damien Miller wrote:> On Fri, 26 May 2000, Max Pashkov wrote: > > > I have some troubles with subj and proper utmpx/wtmpx functionality. > > After successfull ssh connect to Solaris 8 box, I run > > What options did you pass to ./configure? Could you send me the output > of such configure../configure --sysconfdir=/usr/local/etc/ssh --with-ipv4-default creating cache ./config.cache checking for gcc... gcc checking whether the C compiler (gcc ) works... yes checking whether the C compiler (gcc ) is a cross-compiler... no checking whether we are using GNU C... yes checking whether gcc accepts -g... yes checking host system type... i386-pc-solaris2.8 checking how to run the C preprocessor... gcc -E checking for ranlib... ranlib checking for a BSD compatible install... ./install-sh -c checking for ar... ar checking for perl... /usr/bin/perl checking for ent... no checking for inline... inline checking for deflate in -lz... yes checking for login in -lutil... no checking for yp_match in -lnsl... yes checking for main in -lsocket... yes checking for bstring.h... no checking for endian.h... no checking for lastlog.h... yes checking for login.h... no checking for maillock.h... yes checking for netdb.h... yes checking for netgroup.h... no checking for netinet/in_systm.h... yes checking for paths.h... no checking for poll.h... yes checking for pty.h... no checking for shadow.h... yes checking for security/pam_appl.h... yes checking for sys/bitypes.h... no checking for sys/bsdtty.h... no checking for sys/cdefs.h... no checking for sys/poll.h... yes checking for sys/select.h... yes checking for sys/stropts.h... yes checking for sys/sysmacros.h... yes checking for sys/time.h... yes checking for sys/ttcompat.h... yes checking for stddef.h... yes checking for util.h... no checking for utmp.h... yes checking for utmpx.h... yes checking for arc4random... no checking for b64_ntop... no checking for bcopy... yes checking for bindresvport_af... no checking for clock... yes checking for freeaddrinfo... yes checking for gai_strerror... yes checking for getaddrinfo... yes checking for getnameinfo... yes checking for getrusage... yes checking for innetgr... yes checking for md5_crypt... no checking for memmove... yes checking for mkdtemp... no checking for openpty... no checking for rresvport_af... yes checking for setenv... no checking for seteuid... yes checking for setlogin... no checking for setproctitle... no checking for setreuid... yes checking for snprintf... yes checking for strlcat... yes checking for strlcpy... yes checking for updwtmpx... yes checking for vsnprintf... yes checking for vhangup... yes checking for _getpty... no checking for __b64_ntop... no checking for login... no checking for login in -lbsd... no checking for daemon... no checking for daemon in -lbsd... no checking for getpagesize... yes checking for dlopen in -ldl... yes checking for pam_getenvlist... yes checking whether pam_strerror takes only one argument... no checking for OpenSSL directory... (system) checking for RSA support... yes checking size of char... 1 checking size of short int... 2 checking size of int... 4 checking size of long int... 4 checking size of long long int... 8 checking for intXX_t types... yes checking for u_intXX_t types... no checking for intXX_t and u_intXX_t types in sys/bitypes.h... no checking for uintXX_t types... yes checking for socklen_t... yes checking for size_t... yes checking for ssize_t... yes checking for struct sockaddr_storage... yes checking for struct sockaddr_in6... yes checking for struct in6_addr... yes checking for struct addrinfo... yes checking for ut_host field in utmp.h... no checking for ut_host field in utmpx.h... yes checking for syslen field in utmpx.h... yes checking for ut_pid field in utmp.h... yes checking for ut_type field in utmp.h... yes checking for ut_type field in utmpx.h... yes checking for ut_tv field in utmp.h... no checking for ut_id field in utmp.h... yes checking for ut_addr field in utmp.h... no checking for ut_addr field in utmpx.h... no checking for ut_addr_v6 field in utmp.h... no checking for ut_addr_v6 field in utmpx.h... no checking for ss_family field in struct sockaddr_storage... yes checking for __ss_family field in struct sockaddr_storage... no checking if libc defines __progname... no checking for rsh... /usr/bin/rsh checking for xauth... no checking location of lastlog file... /var/adm/lastlog checking for /dev/ptmx... yes checking for /dev/ptc... no checking for /dev/urandom... no checking for ls... /usr/bin/ls checking for netstat... /usr/bin/netstat checking for arp... /usr/sbin/arp checking for ifconfig... /usr/sbin/ifconfig checking for ps... /usr/bin/ps checking for w... /usr/bin/w checking for who... /usr/bin/who checking for last... /usr/bin/last checking for lastlog... no checking for df... /usr/sbin/df checking for vmstat... /usr/bin/vmstat checking for uptime... /usr/bin/uptime checking for ipcs... no checking for tail... /usr/bin/tail checking for ls... (cached) /usr/bin/ls checking if we need to convert IPv4 in IPv6-mapped addresses... no (default) updating cache ./config.cache creating ./config.status creating Makefile creating ssh_prng_cmds creating config.h Here some sshd output in debug mode: RSA key generation complete. debug: Server will not fork when running in debugging mode. Connection from 212.15.113.8 port 38154 debug: Client protocol version 1.5; client software version 1.2.27 debug: Local version string SSH-1.99-OpenSSH-2.1 debug: Sent 768 bit public key and 1024 bit host key. debug: Encryption type: 3des debug: Received session key; encryption turned on. debug: Installing crc compensation attack detector. debug: Starting up PAM with username "root" debug: Attempting authentication for root. debug: PAM Password authentication accepted for user "root" Accepted password for ROOT from 212.15.113.8 port 38154 debug: PAM setting rhost to "cymax" debug: session_new: init debug: session_new: session 0 debug: Allocating pty. debug: PAM setting tty to "/dev/pts/1" debug: PAM establishing creds debug: Entering interactive session. debug: fd 8 setting O_NONBLOCK debug: server_init_dispatch_13 debug: server_init_dispatch_15 debug: tvp!=NULL kid 0 mili 10 debug: tvp!=NULL kid 0 mili 10 debug: tvp!=NULL kid 0 mili 10 debug: End of interactive session; stdin 15, stdout (read 444, sent 444), stderr 0 bytes. debug: Received SIGCHLD. debug: Command exited with status 0. debug: Received exit confirmation. debug: session_pty_cleanup: session 0 release /dev/pts/1 No tty slot found at logout Closing connection to 212.15.113.8 Cannot delete credentials: Permission denied debug: writing PRNG seed to file //.ssh/prng_seed> Thanks, > Damien Miller > > -- > | "Bombay is 250ms from New York in the new world order" - Alan Cox > | Damien Miller - http://www.mindrot.org/ > | Email: djm at mindrot.org (home) -or- djm at ibs.com.au (work)
> I have some troubles with subj and proper utmpx/wtmpx functionality. > After successfull ssh connect to Solaris 8 box, I runThe problem arises because if you check line 154 of bsd-login.c, OpenSSH writes out a *utmp* record into utmpx. (Along with a variety of other nasty things, like opening the same file twice and not closing any of them, etc...) I think somebody already mentioned this problem on the list, and submitted a patch. I avoided the problem by gutting login() to look like: void login(utp,utx) struct utmp *utp; struct utmpx *utx; { struct utmpx *old_utx; if((old_utx = pututxline(utx)) == NULL) { log("Could not update utmpx!"); } updwtmpx(_PATH_WTMPX, utx); endutxent(); } Obviously it destroys portability to other platforms, but it was just a quick "make it go" fix. -- Brandon Hume - hume -> BOFH.Halifax.NS.Ca, http://WWW.BOFH.Halifax.NS.Ca/ -> Solaris Snob and general NOCMonkey
Thanks, that's work. './configure --with-utmpx' don't resolves this problem, but patching bsd-login.c do. I hope such Solaris 8 login functionality will being incorporated into next patchlevel of portable openssh.> > I have some troubles with subj and proper utmpx/wtmpx functionality. > > After successfull ssh connect to Solaris 8 box, I run > > The problem arises because if you check line 154 of bsd-login.c, OpenSSH > writes out a *utmp* record into utmpx. (Along with a variety of other nasty > things, like opening the same file twice and not closing any of them, etc...) > > I think somebody already mentioned this problem on the list, and submitted a > patch. > > I avoided the problem by gutting login() to look like: > > void > login(utp,utx) > struct utmp *utp; > struct utmpx *utx; > { > struct utmpx *old_utx; > > if((old_utx = pututxline(utx)) == NULL) { > log("Could not update utmpx!"); > } > > updwtmpx(_PATH_WTMPX, utx); > endutxent(); > } > > Obviously it destroys portability to other platforms, but it was just a quick > "make it go" fix. > > -- > Brandon Hume - hume -> BOFH.Halifax.NS.Ca, http://WWW.BOFH.Halifax.NS.Ca/ > -> Solaris Snob and general NOCMonkey > >