utmpx bug in samba-2.2.3-pre cvs

Benjamin Kuit bj at it.uts.edu.au
Mon Dec 17 23:59:02 GMT 2001


When enabling utmp support on my solaris8 box, it rightly so configures
itself to use utmpx entries.

However I'm sure that the following line is the cause of my daemons
to crash when connections are closed.

in smbd/utmp.c:sys_utmp_update:

#if defined(HAVE_UX_UT_SYSLEN)
        if (hostname)
                ux.ut_syslen = strlen(hostname) + 1;    /* include end NULL */
        else
                ux.ut_syslen = 0;
#endif  
	utmp_strcpy(ux.ut_host, hostname, sizeof(ux.ut_host));

sys_utmp_update can be called with hostname = NULL when a connection is
closed, so utmp_strcpy copies NULL to ux.ut_host.

The same happens with the call to utmp_nox_update(u, hostname, claim) a few
lines further in the same function.

My samba stops crashing when I if (hostname) utmp_strcpy() ..

Bj

-- 
+-------------------------------+--------------------------------------+
|      Benjamin (Bj) Kuit       |  Building 4, 447                     |
|      Systems Programmer       |  Faculty of Information Technology   |
|      Phone: 02 9514 1841      |  University of Technology, Sydney    |
|      Mobile: 0416 184 972     |  Email: bj at it.uts.edu.au             |
+-------------------------------+--------------------------------------+




More information about the samba-technical mailing list