apache-commons-daemon/apache-commons-daemon-1.0.4-execve-path-warning.patch

19 lines
719 B
Diff

--- src/native/unix/native/jsvc-unix.c 2010-10-16 15:09:11.000000000 +0200
+++ src/native/unix/native/jsvc-unix.c-gil 2010-12-12 05:55:08.000000000 +0100
@@ -966,6 +966,15 @@
char *tmp = NULL;
char *p1 = NULL;
char *p2 = NULL;
+
+ /* We don't want to use a form of exec() that searches the
+ PATH, so require that argv[0] be either an absolute or
+ relative path. Error out if this isn't the case. */
+ tmp=strchr(oldpath,'/');
+ if (tmp==NULL) {
+ log_error("JSVC re-exec requires execution with an absolute or relative path");
+ return(1);
+ }
/*
* There is no need to change LD_LIBRARY_PATH