Page MenuHomeFreeBSD

D6546.id16822.diff
No OneTemporary

D6546.id16822.diff

Index: sys/kern/kern_exec.c
===================================================================
--- sys/kern/kern_exec.c
+++ sys/kern/kern_exec.c
@@ -568,6 +568,19 @@
/* The new credentials are installed into the process later. */
/*
+ * Do the best to calculate the full path to the image file.
+ */
+ if (args->fname != NULL && args->fname[0] == '/')
+ imgp->execpath = args->fname;
+ else {
+ VOP_UNLOCK(imgp->vp, 0);
+ if (vn_fullpath(td, imgp->vp, &imgp->execpath,
+ &imgp->freepath) != 0)
+ imgp->execpath = args->fname;
+ vn_lock(imgp->vp, LK_EXCLUSIVE | LK_RETRY);
+ }
+
+ /*
* If the current process has a special image activator it
* wants to try first, call it. For example, emulating shell
* scripts differently.
@@ -637,14 +650,6 @@
*/
VOP_UNLOCK(imgp->vp, 0);
- /*
- * Do the best to calculate the full path to the image file.
- */
- if (imgp->auxargs != NULL &&
- ((args->fname != NULL && args->fname[0] == '/') ||
- vn_fullpath(td, imgp->vp, &imgp->execpath, &imgp->freepath) != 0))
- imgp->execpath = args->fname;
-
if (disallow_high_osrel &&
P_OSREL_MAJOR(p->p_osrel) > P_OSREL_MAJOR(__FreeBSD_version)) {
error = ENOEXEC;

File Metadata

Mime Type
text/plain
Expires
Sun, Mar 8, 9:34 PM (16 h, 1 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29418706
Default Alt Text
D6546.id16822.diff (1 KB)

Event Timeline