From owner-freebsd-hackers@FreeBSD.ORG Wed Oct 12 20:43:34 2005 Return-Path: X-Original-To: hackers@freebsd.org Delivered-To: freebsd-hackers@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0A98A16A41F for ; Wed, 12 Oct 2005 20:43:34 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from mx1a.swcp.com (mx1a.swcp.com [216.184.2.64]) by mx1.FreeBSD.org (Postfix) with ESMTP id 32A4A43D48 for ; Wed, 12 Oct 2005 20:43:32 +0000 (GMT) (envelope-from msommer@argotsoft.com) Received: from taka.swcp.com (taka-216.swcp.com [216.184.2.3]) by mx1a.swcp.com (8.13.3/8.13.3/Debian-6) with ESMTP id j9CKhV3x013508; Wed, 12 Oct 2005 14:43:31 -0600 Received: from argotsoft.com (argotsoft.com [198.59.115.127]) by taka.swcp.com (8.13.3/8.13.1) with ESMTP id j9CKgmu2013320; Wed, 12 Oct 2005 14:43:07 -0600 (MDT) (envelope-from msommer@argotsoft.com) Received: from ATHABASCA (athabasca.argotsoft.com [192.168.3.104]) by argotsoft.com (8.12.3/8.12.3) with ESMTP id j9CKX5uo040708; Wed, 12 Oct 2005 14:33:09 -0600 (MDT) Message-Id: <200510122033.j9CKX5uo040708@argotsoft.com> From: "Mark J. Sommer" To: "'Michael C. Shultz'" , "'Michael Lednev'" , Date: Wed, 12 Oct 2005 14:33:05 -0600 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook, Build 11.0.5510 Thread-Index: AcXPZ8yI4Yij+ZRqR8ywNewbpS/MgQABAPKg In-Reply-To: <200510121242.55482.ringworm01@gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 X-Scanned-By: MIMEDefang 2.9 (www dot roaringpenguin dot com slash mimedefang) X-Virus-Scanned: ClamAV version 0.87, clamav-milter version 0.87 on av2.swcp.com X-Virus-Status: Clean X-Spam-Checker-Version: SpamAssassin 3.0.4 (2005-06-05) on kaimen.swcp.com X-Spam-Status: No, hits=-2.4 required=10.0 tests=ALL_TRUSTED autolearn=failed version=3.0.4 X-Spam-Level: X-Mailman-Approved-At: Thu, 13 Oct 2005 13:04:20 +0000 Cc: Subject: RE: portmanager X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 12 Oct 2005 20:43:34 -0000 Just a comment from an on-looker to this post. From the getenv The getenv() function obtains the current value of the environment vari- able, name. If the variable name is not in the current environment, a null pointer is returned. So it could potentially be passing in a null pointer to strncmp which is not good. Is that the problem you're seeing. Easy enough to test the return from getenv before using it. -----Original Message----- From: owner-freebsd-questions@freebsd.org [mailto:owner-freebsd-questions@freebsd.org] On Behalf Of Michael C. Shultz Sent: 10/12/2005 1:43 PM To: Michael Lednev; freebsd-questions@freebsd.org; hackers@freebsd.org Subject: Re: portmanager 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? This particualr code snippet is from portmanager/portmanager.c around line 137.... -Mike ps. I've cross posted this to freebsd-hackers because it is a coding problem, so you may want to remove freebsd-questions from any replies. . _______________________________________________ freebsd-questions@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "freebsd-questions-unsubscribe@freebsd.org"