Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 330600 Details for
Bug 407195
net-misc/openvpn: path to network tools get hardcoded at build time
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
use execvpe if available
openvpn-execvpe.patch (text/plain), 3.36 KB, created by
SpanKY
on 2012-11-26 10:01:44 UTC
(
hide
)
Description:
use execvpe if available
Filename:
MIME Type:
Creator:
SpanKY
Created:
2012-11-26 10:01:44 UTC
Size:
3.36 KB
patch
obsolete
>if the system supports execvpe, use it so we don't have to hardcode the >paths to tools (which might move around) > >https://bugs.gentoo.org/407195 > >--- a/configure.ac >+++ b/configure.ac >@@ -252,32 +252,19 @@ AC_ARG_WITH(pkcs11-helper-lib, > > AC_ARG_WITH(ifconfig-path, > [ --with-ifconfig-path=PATH Path to ifconfig tool], >- [IFCONFIG="$withval"], >- [AC_PATH_PROG([IFCONFIG], [ifconfig], [ifconfig], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])] > ) >-AC_DEFINE_UNQUOTED(IFCONFIG_PATH, "$IFCONFIG", [Path to ifconfig tool]) > > AC_ARG_WITH(iproute-path, > [ --with-iproute-path=PATH Path to iproute tool], >- [IPROUTE="$withval"], >- [AC_PATH_PROG([IPROUTE], [ip], [ip], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])] > ) >-AC_DEFINE_UNQUOTED(IPROUTE_PATH, "$IPROUTE", [Path to iproute tool]) >- > > AC_ARG_WITH(route-path, > [ --with-route-path=PATH Path to route tool], >- [ROUTE="$withval"], >- [AC_PATH_PROG([ROUTE], [route], [route], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])] > ) >-AC_DEFINE_UNQUOTED(ROUTE_PATH, "$ROUTE", [Path to route tool]) > > AC_ARG_WITH(netstat-path, > [ --with-netstat-path=PATH Path to netstat tool], >- [NETSTAT="$withval"], >- [AC_PATH_PROG([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc])] > ) >-AC_DEFINE_UNQUOTED(NETSTAT_PATH, "$NETSTAT", [Path to netstat tool]) > > AC_ARG_WITH(mem-check, > [ --with-mem-check=TYPE Build with debug memory checking, TYPE = dmalloc or valgrind], >@@ -499,7 +486,7 @@ AC_CHECK_FUNCS(daemon chroot getpwnam setuid nice system getpid dup dup2 dnl > getpass strerror syslog openlog mlockall getgrnam setgid dnl > setgroups stat flock readv writev time dnl > setsid chdir putenv getpeername unlink dnl >- chsize ftruncate execve getpeereid umask) >+ chsize ftruncate execve execvpe getpeereid umask) > > # Windows use stdcall for winsock so we cannot auto detect these > m4_define([SOCKET_FUNCS], [socket recv recvfrom send sendto listen dnl >@@ -880,6 +867,26 @@ if test "$SELINUX" = "yes"; then > ) > fi > >+dnl >+dnl setup paths to tools as need be >+dnl >+AC_DEFUN([NET_TOOL],[dnl >+ AS_IF([test "x${with_$2_path}" != x],[dnl >+ $1=${with_$2_path} >+ ],[dnl >+ AS_IF([test "x${ac_cv_func_execvpe}" = "xyes"],[dnl >+ $1=$2 >+ ],[dnl >+ AC_PATH_PROG($1, $2, $2, [$PATH:/usr/local/sbin:/usr/sbin:/sbin]) >+ ]) >+ ]) >+ AC_DEFINE_UNQUOTED($1_PATH, "[$]$1", [Path to $2 tool]) >+]) >+NET_TOOL([IFCONFIG], [ifconfig]) >+NET_TOOL([IPROUTE], [ip]) >+NET_TOOL([ROUTE], [route]) >+NET_TOOL([NETSTAT], [netstat]) >+ > TAP_ID="PRODUCT_TAP_ID" > TAP_WIN32_MIN_MAJOR="PRODUCT_TAP_WIN32_MIN_MAJOR" > TAP_WIN32_MIN_MINOR="PRODUCT_TAP_WIN32_MIN_MINOR" >--- a/misc.c >+++ b/misc.c >@@ -521,7 +521,7 @@ openvpn_execve (const struct argv *a, const struct env_set *es, const unsigned i > pid = fork (); > if (pid == (pid_t)0) /* child side */ > { >- execve (cmd, argv, envp); >+ ENABLE_EXECVE (cmd, argv, envp); > exit (127); > } > else if (pid < (pid_t)0) /* fork failed */ >--- a/syshead.h >+++ b/syshead.h >@@ -460,8 +460,12 @@ socket_defined (const socket_descriptor_t sd) > * Should we enable the use of execve() for calling subprocesses, > * instead of system()? > */ >-#if defined(HAVE_EXECVE) && defined(HAVE_FORK) >-#define ENABLE_EXECVE >+#if defined(HAVE_FORK) >+# if defined(HAVE_EXECVPE) >+# define ENABLE_EXECVE execvpe >+# elif defined(HAVE_EXECVE) >+# define ENABLE_EXECVE execve >+# endif > #endif > > /*
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 407195
: 330600 |
345840