The application named "portmanager" available in the ports just gives a segmentation fault when run under crontab as "portmanager -s". It is version : "portmanager 0.2.9_4 VERSION info:" The bug is quite simple. In portmanager.c one plays with the TERM environment variable to change the title bar of the xterm the user might use. Unfortunatly under crontab, the TERM variable is unset and getenv() just returns NULL and that makes strncmp() segfaults. > Fix: In portmanager.c, just change : if( !strncmp( getenv("TERM"), "xterm", 5 ) ) to if( getenv("TERM") && !strncmp( getenv("TERM"), "xterm", 5 ) ) How-To-Repeat: Launch "portmanager -s" through crontab. It will report segmentation fault.
Here's a patch against the file portmanager-0.2.9/portmanager/portmanager.c that fixed the bug : *** portmanager.c Mon Jul 25 16:20:50 2005 --- portmanager.c Tue Jul 26 11:25:58 2005 *************** *** 134,140 **** /* * set xterm title */ ! if( !strncmp( getenv("TERM"), "xterm", 5 ) ) { stringSize = strlen( id ) + 1 --- 134,140 ---- /* * set xterm title */ ! if( getenv("TERM") && !strncmp( getenv("TERM"), "xterm", 5 ) ) { stringSize = strlen( id ) + 1
State Changed From-To: open->closed Committed, thanks!