From owner-p4-projects@FreeBSD.ORG Sat Jun 30 00:54:21 2007 Return-Path: X-Original-To: p4-projects@freebsd.org Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9E7416A5B7; Sat, 30 Jun 2007 00:54:20 +0000 (UTC) X-Original-To: perforce@freebsd.org Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id B826A16A5B5 for ; Sat, 30 Jun 2007 00:54:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 62B3A13C458 for ; Sat, 30 Jun 2007 00:54:20 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.8/8.13.8) with ESMTP id l5U0sCfN070369; Fri, 29 Jun 2007 20:54:18 -0400 (EDT) (envelope-from jhb@freebsd.org) From: John Baldwin To: Roman Divacky Date: Fri, 29 Jun 2007 20:53:24 -0400 User-Agent: KMail/1.9.6 References: <200706281301.l5SD1jhl064451@repoman.freebsd.org> In-Reply-To: <200706281301.l5SD1jhl064451@repoman.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200706292053.24548.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Fri, 29 Jun 2007 20:54:18 -0400 (EDT) X-Virus-Scanned: ClamAV 0.88.3/3559/Fri Jun 29 19:24:17 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Perforce Change Reviews Subject: Re: PERFORCE change 122487 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Jun 2007 00:54:21 -0000 On Thursday 28 June 2007 09:01:45 am Roman Divacky wrote: > http://perforce.freebsd.org/chv.cgi?CH=122487 > > Change 122487 by rdivacky@rdivacky_witten on 2007/06/28 13:01:09 > > Use vn_fullpath to get the name of the binary and stuff that into p_comm. > > Affected files ... > > .. //depot/projects/soc2007/rdivacky/linux_at/sys/kern/kern_exec.c#6 edit > > Differences ... > > ==== //depot/projects/soc2007/rdivacky/linux_at/sys/kern/kern_exec.c#6 (text+ko) ==== > > @@ -304,7 +304,7 @@ > struct ucred *newcred = NULL, *oldcred; > struct uidinfo *euip; > register_t *stack_base; > - int error, len, i; > + int error, len = 0, i; > struct image_params image_params, *imgp; > struct vattr attr; > int (*img_first)(struct image_params *); > @@ -560,8 +560,16 @@ > len = min(ndp->ni_cnd.cn_namelen,MAXCOMLEN); > bcopy(ndp->ni_cnd.cn_nameptr, p->p_comm, len); > } else { > - len = 10; > - bcopy("fexec neco", p->p_comm, 10); > + char *freepath; > + char *fullpath = NULL; > + > + error = vn_fullpath(td, binvp, &fullpath, &freepath); > + if (error == 0) { > + len = min(strlen(fullpath), MAXCOMLEN); > + bcopy(fullpath, p->p_comm, len); > + if (freepath) > + free(freepath, M_TEMP); > + } > } What if vn_fullpath() fails? What does p_comm[] contain then? -- John Baldwin