Bug 36

Summary: segfault if hostname mis configured
Product: Sudo Reporter: Bdale Garbee <bdale>
Component: SudoAssignee: Todd C. Miller <Todd.Miller>
Status: RESOLVED FIXED    
Severity: normal    
Priority: normal    
Version: 1.6.3   
Hardware: PC   
OS: Linux   
URL: http://bugs.debian.org/86062
Attachments: diff to force bug to show up
my fix to avoid crash in log_error when sending email

Description Bdale Garbee 2001-04-12 17:28:59 MDT
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.
Comment 1 Todd C. Miller 2001-04-12 17:55:59 MDT
I fixed this a while ago in my source tree so sudo 1.6.4 will have this fixed.
Comment 2 Len Lattanzi 2001-12-12 16:24:59 MST
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.
Comment 3 Len Lattanzi 2001-12-12 16:31:59 MST
Created attachment 6 [details]
diff to force bug to show up
Comment 4 Len Lattanzi 2001-12-12 16:33:59 MST
Created attachment 7 [details]
my fix to avoid crash in log_error when sending email
Comment 5 Todd C. Miller 2001-12-12 18:27:59 MST
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.