Bug 84168 - portmanager 0.2.9_4 can't go background
Summary: portmanager 0.2.9_4 can't go background
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-27 13:40 UTC by Thierry BESANCON
Modified: 2005-07-28 23:31 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thierry BESANCON 2005-07-27 13:40:16 UTC
      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.
Comment 1 Thierry BESANCON 2005-07-27 14:49:38 UTC
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
Comment 2 Pav Lucistnik freebsd_committer freebsd_triage 2005-07-28 23:31:29 UTC
State Changed
From-To: open->closed

Committed, thanks!