Date: Thu, 28 Jun 2007 13:01:45 GMT From: Roman Divacky <rdivacky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 122487 for review Message-ID: <200706281301.l5SD1jhl064451@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
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); + } } p->p_comm[len] = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706281301.l5SD1jhl064451>