Bugzilla – Bug 36
segfault if hostname mis configured
Last modified: 2001-12-12 22:27:09 MST
There have been persistent, sporadic reports from users of my Debian GNU/Linux sudo packages that sudo segfaults if the 'hostname' is set wrong, resulting in a gethostbyname failure. Fumitoshi UKAI <ukai@debian.or.jp> has submitted a patch which he claims resolves this problem, which is available for your review at the attached URL. It'd be good to have this fixed in a future release.
I fixed this a while ago in my source tree so sudo 1.6.4 will have this fixed.
This bug is still reproducible in CVS sources as of 2001-Dec-12 To reproduce do something like user_host = "IdonotExist"; just before gethostbyname in set_fqdn() and configure --with-fqdn Fix is to move sudo_user.pw initialization before set_fqdn and its call to log_error. Send e-mail if you want the diffs, bugzilla is not letting me attach them.
Created attachment 6 [details] diff to force bug to show up
Created attachment 7 [details] my fix to avoid crash in log_error when sending email
Hmm, I thought I had fixed that but apparently not. I just committed a fix to the cvs tree to defer the call to set_fqdn() until after log_error() is safe. Thanks for re-opening this.