Fix bug 669259 (execve warning segfault)

This commit is contained in:
Stanislav Ochotnicky 2011-02-01 16:45:24 +01:00
parent 7f7e9775db
commit 7e45a75f96
2 changed files with 11 additions and 9 deletions

View File

@ -1,17 +1,17 @@
From d4ac1b866785a0fd69abca5422b647453e96f7c3 Mon Sep 17 00:00:00 2001
From 3c89eec3132a924721882f38b8ab06ab81ad2ee8 Mon Sep 17 00:00:00 2001
From: Stanislav Ochotnicky <sochotnicky@redhat.com>
Date: Tue, 18 Jan 2011 14:46:21 +0100
Subject: [PATCH 1/3] execve path warning
---
src/native/unix/native/jsvc-unix.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
src/native/unix/native/jsvc-unix.c | 9 +++++++++
1 files changed, 9 insertions(+), 0 deletions(-)
diff --git a/src/native/unix/native/jsvc-unix.c b/src/native/unix/native/jsvc-unix.c
index e3d9e89..7d50ea9 100644
index e3d9e89..72d53c2 100644
--- a/src/native/unix/native/jsvc-unix.c
+++ b/src/native/unix/native/jsvc-unix.c
@@ -966,6 +966,16 @@ int main(int argc, char *argv[])
@@ -966,6 +966,15 @@ int main(int argc, char *argv[])
char *tmp = NULL;
char *p1 = NULL;
char *p2 = NULL;
@ -19,8 +19,7 @@ index e3d9e89..7d50ea9 100644
+ /* 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) {
+ if (strchr(argv[0],'/') == NULL) {
+ log_error("JSVC re-exec requires execution with an absolute or relative path");
+ return(1);
+ }
@ -29,5 +28,5 @@ index e3d9e89..7d50ea9 100644
/*
* There is no need to change LD_LIBRARY_PATH
--
1.7.3.4
1.7.3.5

View File

@ -4,7 +4,7 @@
Name: apache-%{short_name}
Version: 1.0.5
Release: 1%{?dist}
Release: 2%{?dist}
Summary: Defines API to support an alternative invocation mechanism
License: ASL 2.0
Group: Applications/System
@ -148,6 +148,9 @@ rm -rf $(readlink -f %{_javadocdir}/%{name}) %{_javadocdir}/%{name} || :
%changelog
* Tue Feb 1 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.5-2
- Fix bug 669259 (execve warning segfault)
* Tue Jan 18 2011 Stanislav Ochotnicky <sochotnicky@redhat.com> - 1.0.5-1
- Update to latest version
- Use maven 3 to build