SIGBUS Panic in smbd

Michael Stockman pgmtekn at algonet.se
Mon Jun 28 20:13:14 GMT 1999


Hello,

I do apologize for the following, but it is motivated.
username.c is crap in regards to _Get_Pwnam and the passwd struct!

The reason for the crashes the this thread started with is that ret->pw_passwd is __most__ likely a pointer to a static area and calling free on that can cause a crash.

After calling free in _Get_Pwnam: ret->pw_passwd = strdup(...); is likely to cause memory bloat and may cause getpwnam to behave unpredictably, at least on linux systems.

This is due to complete confusion in the code as to what is static memory and what is dynamically allocated. I propose that ret as well as the pointers in ret are pointers to static memory. Thus it would be forbidden to free the pointers, reassign the pointers and change their contents while the length of the pointed to memory is unknown. Basically, we need a structure of our own if that is really what we want to do.

Should anyone in charge like me to try to cure this, please send me an e-mail. Regardless, it will need to be fixed.

Best regards
  Michael Stockman
  pgmtekn-micke at algonet.se




More information about the samba-technical mailing list