utmpx bug in samba-2.2.3-pre cvs

Jeremy Allison jra at samba.org
Tue Dec 18 00:21:02 GMT 2001


On Tue, Dec 18, 2001 at 06:57:09PM +1100, Benjamin Kuit wrote:
> 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() ..

I just added a fix to tidy this up in SAMBA_2_2 and HEAD.

Anyone interested in utmp support please CVS update and test...

Thanks,

	Jeremy.




More information about the samba-technical mailing list