Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137682316
D6546.id16925.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6546.id16925.diff
View Options
Index: sys/kern/kern_exec.c
===================================================================
--- sys/kern/kern_exec.c
+++ sys/kern/kern_exec.c
@@ -566,6 +566,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.
@@ -628,6 +641,8 @@
crfree(imgp->newcred);
imgp->newcred = NULL;
}
+ free(imgp->freepath. M_TEMP);
+ imgp->freepath = NULL;
/* set new name to that of the interpreter */
NDINIT(&nd, LOOKUP, LOCKLEAF | FOLLOW | SAVENAME,
UIO_SYSSPACE, imgp->interpreter_name, td);
@@ -641,14 +656,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
Details
Attached
Mime Type
text/plain
Expires
Tue, Nov 25, 9:45 PM (1 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26182718
Default Alt Text
D6546.id16925.diff (1 KB)
Attached To
Mode
D6546: exec: Provide execpath in imgp for the process_exec hook.
Attached
Detach File
Event Timeline
Log In to Comment