From owner-freebsd-questions@FreeBSD.ORG Wed Oct 12 21:03:57 2005 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3FB6016A43E for ; Wed, 12 Oct 2005 21:03:57 +0000 (GMT) (envelope-from list-freebsd-2004@morbius.sent.com) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.FreeBSD.org (Postfix) with ESMTP id D430043D66 for ; Wed, 12 Oct 2005 21:03:52 +0000 (GMT) (envelope-from list-freebsd-2004@morbius.sent.com) Received: from frontend1.internal (mysql-sessions.internal [10.202.2.149]) by frontend1.messagingengine.com (Postfix) with ESMTP id 0B1ADCD4337; Wed, 12 Oct 2005 17:03:51 -0400 (EDT) Received: from frontend2.messagingengine.com ([10.202.2.151]) by frontend1.internal (MEProxy); Wed, 12 Oct 2005 17:03:51 -0400 X-Sasl-enc: EyW8Q/V2XXApranjNQLZVq6TNp186/EAoaLYlMtrWb0N 1129151028 Received: from gumby.localdomain (88-104-201-140.dynamic.dsl.as9105.com [88.104.201.140]) by frontend2.messagingengine.com (Postfix) with ESMTP id 6284A5703A8; Wed, 12 Oct 2005 17:03:48 -0400 (EDT) From: RW To: freebsd-questions@freebsd.org Date: Wed, 12 Oct 2005 22:03:43 +0100 User-Agent: KMail/1.8.2 References: <629544090.20051009185315@reaper.hn.org> <200510121242.55482.ringworm01@gmail.com> In-Reply-To: <200510121242.55482.ringworm01@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200510122203.45229.list-freebsd-2004@morbius.sent.com> Cc: "Michael C. Shultz" Subject: Re: portmanager X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2005 21:03:57 -0000 On Wednesday 12 October 2005 20:42, Michael C. Shultz wrote: > On Sunday 09 October 2005 07:53, Michael Lednev wrote: > > Hello, freebsd-questions. > > > > anyone tried to run portmanager from crontab? as for me it just > > coredumps, what am i doing wrong? its simply 0 0 * * * portmanager -s > > I'm not sure how to fix it but I've found where portmanager crashes > when run from cron, the code is: > > > if( !strncmp( getenv("TERM"), "xterm", 5 ) && isatty(fileno(stdout)) > ) { > stringSize = strlen( id ) > + 1 > + strlen( VERSION ) > + 1; > xtermTitle = malloc( stringSize ); > xtermTitle[0] = 0; > strcat( xtermTitle, id ); > strcat( xtermTitle, " " ); > strcat( xtermTitle, VERSION ); > printf( "%c]0;%s%c", '\033', xtermTitle, '\007' ); > free( xtermTitle ); > } > > > This is used to put information in the xterm title screen while portmanager > is running, I don't know enough about cron to have a clue how to fix this > except to remove it and I don't want to do that. Anyone have any ideas? I think getenv() returns NULL if a variable isn't defined, and strncmp() will try to dereference any pointer it's given without checking.