Stanislav Ochotnicky dc9f7d7
From 0de57c78cbe1666fdf78ff6522b3b0ce18f12716 Mon Sep 17 00:00:00 2001
Stanislav Ochotnicky 7f7e977
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Stanislav Ochotnicky 7f7e977
Date: Tue, 18 Jan 2011 14:46:21 +0100
Stanislav Ochotnicky 7f7e977
Subject: [PATCH 1/3] execve path warning
Stanislav Ochotnicky 7f7e977
Stanislav Ochotnicky 7f7e977
---
Stanislav Ochotnicky 7e45a75
 src/native/unix/native/jsvc-unix.c |    9 +++++++++
Stanislav Ochotnicky 7e45a75
 1 files changed, 9 insertions(+), 0 deletions(-)
Stanislav Ochotnicky 7f7e977
Stanislav Ochotnicky 7f7e977
diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c
Stanislav Ochotnicky dc9f7d7
index 1967f09..22967f1 100644
Stanislav Ochotnicky 7f7e977
--- a/src/native/unix/native/jsvc-unix.c
Stanislav Ochotnicky 7f7e977
+++ b/src/native/unix/native/jsvc-unix.c
Stanislav Ochotnicky dc9f7d7
@@ -1015,6 +1015,15 @@ int main(int argc, char *argv[])
dd810d2
         char *tmp = NULL;
dd810d2
         char *p1  = NULL;
dd810d2
         char *p2  = NULL;
dd810d2
+	
ca084ff
+        /* We don't want to use a form of exec() that searches the
ca084ff
+           PATH, so require that argv[0] be either an absolute or
ca084ff
+           relative path.  Error out if this isn't the case.  */
Stanislav Ochotnicky 7e45a75
+        if (strchr(argv[0],'/') == NULL) {
ca084ff
+          log_error("JSVC re-exec requires execution with an absolute or relative path");
ca084ff
+          return(1);
ca084ff
+        }
ca084ff
+
dd810d2
 
ca084ff
         /*
ca084ff
          * There is no need to change LD_LIBRARY_PATH
Stanislav Ochotnicky 7f7e977
-- 
Stanislav Ochotnicky dc9f7d7
1.7.6
Stanislav Ochotnicky 7f7e977