<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<body text="#000000" bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000" alink="#000088">
I spent some time with 3.0.2p1 to discover why OpenSSH on HP/UX 11.00 64-bit
corrupts the /var/adm/wtmp file. The problem is with the utmp structure
itself. When building with 32-bit compilation flags, the size of
the utmp structure is 60 bytes. When building under 64-bit, the size
is 72 bytes. The size difference is due to structure alignment and
using basic types whose size changes depending on the integer size (like
long). The OS and tools like "last" expect a wtmp entry to be 60
bytes in size. So, when OpenSSH is built with 64-bit options, it
writes 72 byte entries into the wtmp causing "last" to seg fault.
<p>I do not know what a good work around could be. I temporarily
modified the /usr/include/utmp.h structure to use int32_t as the type for
ut_time instead of long and rebuilt loginrec.o and relinked sshd.
OpenSSH performed correctly, updating wtmp like a champ. I thought
that we could use utmpname and the pututline tools (which will convert
the 72 byte structure to a 60 byte structure somehow), but their behavior
is not actually compatible with wtmp. I also thought about defining
a custom utmp structure when building on HP-UX 64-bit, but that really
seems like a bad way of doing it.
<p>As far as I can tell, there are no patches from HP regarding this issue.
<p>So, that is why wtmp gets corrupted, but I wish I had a real work-around.
<p>--
<br><a href="mailto:quentin.bracken@eds.com">Quentin Bracken</a>
<br>Infrastructure Specialist
<br>EDS
<br>
<br>
</body>
</html>