Mailing List Archive

Solaris utmp problems
Could all those who were having problems with utmp logging on Solaris
please try the test release at:

http://violet.ibs.com.au/openssh/files/test/openssh-TEST-2000053100.tar.gz

Users on other platforms, particularly HP/UX, AIX and SCO are invited
as well, to test compatibility.

The login code is heaps cleaner now.

-d


--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
Re: Solaris utmp problems [ In reply to ]
> http://violet.ibs.com.au/openssh/files/test/openssh-TEST-2000053100.tar.gz

I tried on Solaris8/sparc (with IPv6 enabled).
login.c should be fixed to compile all.

% diff login.c.orig login.c
256c256
< login(&utx);
---
> login(&u,&utx);

then compilation and installation done smoothly,
though I saw many warning messages like

gcc -g -O2 -Wall -I/usr/local/include -I/opt/openssl/include
-DETCDIR=\"/opt/openssh/etc\" -DSSH_PROGRAM=\"/opt/openssh/bin/ssh\"
-DSSH_ASKPASS_DEFAULT=\"/opt/openssh/libexec/ssh/ssh-askpass\"
-DHAVE_CONFIG_H -c -o pty.o pty.c
pty.c: In function `pty_setowner':
pty.c:298: warning: int format, uid_t arg (arg 3)
pty.c:298: warning: int format, gid_t arg (arg 4)
pty.c:301: warning: unsigned int format, mode_t arg (arg 3)

actually I did the following three-step;

% configure --prefix=/opt/openssh --with-utmpx --with-catman=cat
% make
% make install

but I have two (and one more) problems.

(1)
looks like sshd doesn't update utmpx (and other files?) appropriately.
I login to the system, but last command indicates nothing.

% last -n 10
reboot system boot Wed May 31 17:52
yozo console Wed May 31 17:44 - down (00:08)
reboot system boot Wed May 31 17:43
yozo console Wed May 31 17:39 - down (00:03)

moreover, w and who commands don't work.

% w
8:36pm up 11157 day(s), 19:50, 0 users, load average: 0.02, 0.03, 0.04
User tty login@ idle JCPU PCPU what
% who
Segmentation Fault (core dumped)
%


(2)
sshd opens two IPv4 sockets for tcp port 22.
in the following, one process(pid 712) of sshd is serving my login session,
another process(pid 326) is opening two sockets for ipv4, one socket for ipv6.

% ps -ef | grep ssh
root 326 1 0 17:52:43 ? 0:01 /opt/openssh/sbin/sshd
root 712 326 0 19:57:20 ? 0:01 /opt/openssh/sbin/sshd
yozo 1174 748 0 20:41:54 pts/1 0:00 grep ssh
% netstat -an | grep 22
*.22 *.* 0 0 24576 0 LISTEN
*.22 *.* 0 0 24576 0 LISTEN
*.22 *.* 0 0 24576 0 LISTEN
fe80::a00:20ff:fecf:d309.22 fe80::a00:20ff:fecf:d339.32771 25920 19 25920 0 ESTABLISHED
%

I don't know how openssh treats IPv4 and IPv6 sockets,
but I think the problem is in IPv4 part.

(3)
when connecting to openssh hosts from ssh-2.0.12 hosts,
publickey authentication doesn't work.
openssh sshd writes the following message to syslog;

May 31 18:21:52 host sshd[525]: [ID 800047 auth.info] bug compatibility w
ith ssh-2.0.13 pubkey not implemented

I suppose this part is not yet implemented...

-- yozo.
Re: Solaris utmp problems [ In reply to ]
On Wed, May 31, 2000 at 09:15:51PM +0900, Yozo TODA wrote:
> > http://violet.ibs.com.au/openssh/files/test/openssh-TEST-2000053100.tar.gz
>
> I tried on Solaris8/sparc (with IPv6 enabled).
> login.c should be fixed to compile all.
>
> % diff login.c.orig login.c
> 256c256
> < login(&utx);
> ---
> > login(&u,&utx);

Same holds for HP-UX 10.20.

> (1)
> looks like sshd doesn't update utmpx (and other files?) appropriately.
> I login to the system, but last command indicates nothing.
...

Same for HP-UX 10.20.

> moreover, w and who commands don't work.
>
> % w
> 8:36pm up 11157 day(s), 19:50, 0 users, load average: 0.02, 0.03, 0.04
> User tty login@ idle JCPU PCPU what
> % who
> Segmentation Fault (core dumped)
> %

I don't see this on HP-UX 10.20.

Best regards,
Lutz
--
Lutz Jaenicke Lutz.Jaenicke@aet.TU-Cottbus.DE
BTU Cottbus http://www.aet.TU-Cottbus.DE/personen/jaenicke/
Lehrstuhl Allgemeine Elektrotechnik Tel. +49 355 69-4129
Universitaetsplatz 3-4, D-03044 Cottbus Fax. +49 355 69-4153
Re: Solaris utmp problems [ In reply to ]
On Wed, 31 May 2000, Yozo TODA wrote:

> looks like sshd doesn't update utmpx (and other files?) appropriately.
> I login to the system, but last command indicates nothing.

Can you send me the output of a ./configure run?

--
| "Bombay is 250ms from New York in the new world order" - Alan Cox
| Damien Miller - http://www.mindrot.org/
| Email: djm@mindrot.org (home) -or- djm@ibs.com.au (work)
Re: Solaris utmp problems [ In reply to ]
> The login code is heaps cleaner now.

The prototype for login() in bsd-login.h and the actual declaration don't
appear to agree:

.h contains:

# if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
# include <utmpx.h>
void login(struct utmp *utp, struct utmpx *utx);
# else /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
void login(struct utmp *utp);
# endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */

While .c has:

#if defined(HAVE_UTMPX_H) && defined(USE_UTMPX)
void login(struct utmpx *utx)
#else /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */
void login(struct utmp *utp)
#endif /* defined(HAVE_UTMPX_H) && defined(USE_UTMPX) */

And... just as a note... the code for dealing with utmpx and utmp in
bsd-login seems almost like two separate functions interleaved with #ifdefs.
Might it be useful to separate them out as two functions chosen with a fewer
number of #ifs?

--
Brandon Hume - hume -> BOFH.Halifax.NS.Ca, http://WWW.BOFH.Halifax.NS.Ca/
-> Solaris Snob and general NOCMonkey
Re: Solaris utmp problems [ In reply to ]
Damien Miller wrote:
>
> Could all those who were having problems with utmp logging on Solaris
> please try the test release at:
>
> http://violet.ibs.com.au/openssh/files/test/openssh-TEST-2000053100.tar.gz
>
> Users on other platforms, particularly HP/UX, AIX and SCO are invited
> as well, to test compatibility.

On AIX, utmp is updated correctly, but not wtmp.

If config.h contains

#define HAVE_PUTUTXLINE
#undef HAVE_UPDWTMPX

or

#define HAVE_PUTUTLINE
#undef HAVE_UPDWTMP

no code is created in bsd-login.c to update wtmp. If anyone knows the
correct way to update wtmp using putut{,x}line I'll be happy to patch
and test it. In the meantime I'll do a little experimenting...

Oh, and line 128 of bsd-login.c should probably read
"# if defined(HAVE_UPDWTMP)"
--
Tom Bertelson "Any sufficiently advanced technology
RHI Consulting is indistinguishable from magic."
tbert@abac.com -- Arthur C. Clarke
Re: Solaris utmp problems [ In reply to ]
On Wed, May 31, 2000 at 09:15:51PM +0900, Yozo TODA wrote:
> (3)
> when connecting to openssh hosts from ssh-2.0.12 hosts,
> publickey authentication doesn't work.
> openssh sshd writes the following message to syslog;
>
> May 31 18:21:52 host sshd[525]: [ID 800047 auth.info] bug compatibility w
> ith ssh-2.0.13 pubkey not implemented
>
> I suppose this part is not yet implemented...

these bugs from ssh-2.0.12 have been fixed in ssh.com's latest release.
Re: Solaris utmp problems [ In reply to ]
> Can you send me the output of a ./configure run?

I used script command to record the installation procedure.
please pick up by ftp

ftp://aohakobe.ipc.chiba-u.ac.jp
/misc/docs/SECURITY/SecureShell
/openssh/portable/log-openssh-TEST-2000053100-solaris8-sparc.tar.gz

sorry for the long long URL.
well, the file log-openssh-TEST-2000053100-solaris8-sparc.tar.gz
from the ftp server aohakobe.ipc.chiba-u.ac.jp,
the directory /misc/docs/SECURITY/SecureShell/openssh/portable/.

-- yozo.