bug causing SIGSEGV found in 2.2.0 uptmp code.

Toomas Soome tsoome at ut.ee
Wed Jun 13 11:20:09 GMT 2001

I have noticed SIGSEGV messages in smbd log. so I got stack trace, and
here it is:

(gdb) bt
#0  0xff1b303c in strlen () from /usr/lib/libc.so.1
#1  0x34724 in sys_utmp_update (u=0xffbeee10, hostname=0x0, claim=0)
    at smbd/utmp.c:394
#2  0x34dac in sys_utmp_yield (username=0xffbeefc0 "tsoome", 
    hostname=0xffbef0c0 "ipv6x.ccu.ut.ee", id_str=0xffbef1c0 "smb/1",
    at smbd/utmp.c:567

I think, it enouh... basically, sys_utmp_yield() will call
sys_utmp_update(&u, NULL, False); notice the NULL in second argument and
unfortunately strlen() does not like this NULL:)

fix is simple - replace NULL with variable hostname. 

BTW: sys_utmp_claim() uses correctly non NULL argument.

Alden's Laws:
	(1) Giving away baby clothes and furniture is the major cause
	    of pregnancy.
	(2) Always be backlit.
	(3) Sit down whenever possible.

More information about the samba-technical mailing list