Date: Fri, 29 Jun 2007 20:53:24 -0400 From: John Baldwin <jhb@freebsd.org> To: Roman Divacky <rdivacky@freebsd.org> Cc: Perforce Change Reviews <perforce@freebsd.org> Subject: Re: PERFORCE change 122487 for review Message-ID: <200706292053.24548.jhb@freebsd.org> In-Reply-To: <200706281301.l5SD1jhl064451@repoman.freebsd.org> References: <200706281301.l5SD1jhl064451@repoman.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706292053.24548.jhb>