UTMP IP address implimentation

Andrew Bartlett abartlet at samba.org
Wed Apr 23 07:30:53 GMT 2003

On Wed, 2003-04-23 at 15:52, Philip Anderson wrote:
> I just made a simple attempt at implimenting ut->addr in utmp.c so that
> 'last -i' wouldp produce the client's IP address.  I tried it, and all
> appears to work on my RedHat 9 machine.  Is this a valid solution?
> I added the following lines to the end of sys_utmp_fill in utmp.c:
> #if defined(HAVE_UT_UT_ADDR)
>         inet_pton(AF_INET,hostname,&(u->ut_addr));
> #endif

That doesn't look quite right - you should ask the code further up to
give you the raw IP address, still in it's struct, and use that

With the right options, we will actually fill 'hostname' with the
reverse DNS name.

Andrew Bartlett

Andrew Bartlett                                 abartlet at pcug.org.au
Manager, Authentication Subsystems, Samba Team  abartlet at samba.org
Student Network Administrator, Hawker College   abartlet at hawkerc.net
http://samba.org     http://build.samba.org     http://hawkerc.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.samba.org/archive/samba-technical/attachments/20030423/a77c0f9e/attachment.bin

More information about the samba-technical mailing list