SA Bugzilla – Bug 3441
spamc segfaults when -u is used
Last modified: 2004-05-28 07:22:04 UTC
i just installed a new build today, i was running 19XXX before and didnt have a problem... its exiting 139, which may or may not mean anything to anyone. [root@dev spamc]# spamassassin -V SpamAssassin version 3.0.0-r20200 running on Perl version 5.6.1 [root@dev spamc]# echo | spamc -u root Segmentation fault [root@dev spamc]# STATUS=$? [root@dev spamc]# echo $STATUS 139
moving to 3.0.0 queue. this needs to be fixed ASAP...
This tWO line patch makes the segfault go away. I don't have time right now to look at it carefully enough to say that it is the right fix, but if somebody else has a chance this should point directly to the problem and may be all that is needed. I'm pasting it in here instead of attaching because it is so small: --- spamc.c (revision 20551) +++ spamc.c (working copy) @@ -479,6 +479,8 @@ ret = get_current_user(&username); if ( ret != EX_OK ) goto finish; + } else { + username = strdup(username); } if ((flags & SPAMC_RANDOMIZE_HOSTS) != 0) {
Takin' as this is my fault.
Done, r20552 has a similar fix.
Are you sure it is fixed correctly? It looks to me as if get_current_user unconditionally overwrites the -u parameter with the statement *username = strdup(curr_user->pw_name); I didn't try to run it... Am I missing something?
You're right. I guess I hit the wrong key combination in vi. r20554 is better.