1From 8fe25b30b6fbb3170705f4468eb4c92eef3a968f Mon Sep 17 00:00:00 2001
2From: Jackie Huang <jackie.huang@windriver.com>
3Date: Mon, 4 Jan 2016 01:44:04 -0500
4Subject: [PATCH] Avoid searching host dirs
5
6Don't search the hardcoded host dirs to avoid
7host contamination.
8
9Upstream-Status: Inappropriate [embedded specific]
10
11Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
13---
14 acinclude.m4                                                | 4 ++--
15 src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac        | 4 ++--
16 src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac   | 4 ++--
17 src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac      | 4 ++--
18 src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac      | 6 +++---
19 src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac     | 2 +-
20 src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac | 4 ++--
21 src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac   | 4 ++--
22 8 files changed, 16 insertions(+), 16 deletions(-)
23
24diff --git a/acinclude.m4 b/acinclude.m4
25index a953d0e1b6..ede143d3c2 100644
26--- a/acinclude.m4
27+++ b/acinclude.m4
28@@ -115,7 +115,7 @@ dnl #
29 dnl #  Try to guess possible locations.
30 dnl #
31 if test "x$smart_lib" = "x"; then
32-  for try in /usr/local/lib /opt/lib; do
33+  for try in $smart_lib_dir; do
34     AC_MSG_CHECKING([for $2 in -l$1 in $try])
35     LIBS="-l$1 $old_LIBS"
36     CPPFLAGS="-L$try -Wl,-rpath,$try $old_CPPFLAGS"
37@@ -155,7 +155,7 @@ ac_safe=`echo "$1" | sed 'y%./+-%__pm%'`
38 old_CPPFLAGS="$CPPFLAGS"
39 smart_include=
40 dnl #  The default directories we search in (in addition to the compilers search path)
41-smart_include_dir="/usr/local/include /opt/include"
42+smart_include_dir=
43
44 dnl #  Our local versions
45 _smart_try_dir=
46diff --git a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
47index 44f84aa27e..23a1899591 100644
48--- a/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
49+++ b/src/modules/rlm_sql/drivers/rlm_sql_db2/configure.ac
50@@ -61,14 +61,14 @@ if test x$with_[]modname != xno; then
51 		esac])
52
53 	dnl Check for SQLConnect in -ldb2
54-	smart_try_dir="$ibmdb2_lib_dir /usr/local/db2/lib /usr/IBMdb2/V7.1/lib"
55+	smart_try_dir="$ibmdb2_lib_dir"
56 	FR_SMART_CHECK_LIB(db2, SQLConnect)
57 	if test "x$ac_cv_lib_db2_SQLConnect" != xyes; then
58 		fail="$fail libdb2"
59 	fi
60
61 	dnl Check for sqlcli.h
62-	smart_try_dir="$ibmdb2_include_dir /usr/local/db2/include /usr/IBMdb2/V7.1/include"
63+	smart_try_dir="$ibmdb2_include_dir"
64 	FR_SMART_CHECK_INCLUDE(sqlcli.h)
65 	if test "x$ac_cv_header_sqlcli_h" != xyes; then
66 		fail="$fail sqlcli.h"
67diff --git a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
68index 4c2fd7ba9e..10c864def5 100644
69--- a/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
70+++ b/src/modules/rlm_sql/drivers/rlm_sql_firebird/configure.ac
71@@ -60,14 +60,14 @@ if test x$with_[]modname != xno; then
72 		esac])
73
74 	dnl Check for isc_attach_database in -lfbclient
75-	smart_try_dir="$firebird_lib_dir /usr/lib/firebird2/lib /usr/local/firebird/lib"
76+	smart_try_dir="$firebird_lib_dir"
77 	FR_SMART_CHECK_LIB(fbclient, isc_attach_database)
78 	if test "x$ac_cv_lib_fbclient_isc_attach_database" != xyes; then
79 		fail="$fail libfbclient"
80 	fi
81
82 	dnl Check for ibase.h
83-	smart_try_dir="$firebird_include_dir /usr/lib/firebird2/include /usr/local/firebird/include"
84+	smart_try_dir="$firebird_include_dir"
85 	FR_SMART_CHECK_INCLUDE(ibase.h)
86 	if test "x$ac_cv_header_ibase_h" != xyes; then
87 		fail="$fail ibase.h"
88diff --git a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
89index d26ac9c431..6e4500e948 100644
90--- a/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
91+++ b/src/modules/rlm_sql/drivers/rlm_sql_iodbc/configure.ac
92@@ -61,14 +61,14 @@ if test x$with_[]modname != xno; then
93 		esac])
94
95 	dnl Check for SQLConnect in -liodbc
96-	smart_try_dir="$iodbc_lib_dir /usr/lib /usr/lib/iodbc /usr/local/lib/iodbc /usr/local/iodbc/lib/iodbc"
97+	smart_try_dir="$iodbc_lib_dir"
98 	FR_SMART_CHECK_LIB(iodbc, SQLConnect)
99 	if test "x$ac_cv_lib_iodbc_SQLConnect" != xyes; then
100 		fail="$fail libiodbc"
101 	fi
102
103 	dnl Check for isql.h
104-	smart_try_dir="$iodbc_include_dir /usr/include /usr/include/iodbc /usr/local/iodbc/include"
105+	smart_try_dir="$iodbc_include_dir"
106 	FR_SMART_CHECK_INCLUDE(isql.h)
107 	if test "x$ac_cv_header_isql_h" != xyes; then
108 		fail="$fail isql.h"
109diff --git a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
110index df36da77bf..31359041c7 100644
111--- a/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
112+++ b/src/modules/rlm_sql/drivers/rlm_sql_mysql/configure.ac
113@@ -140,7 +140,7 @@ if test x$with_[]modname != xno; then
114
115 	dnl # Check for libmysqlclient_r
116 	if test "x$have_a_libmysqlclient" != "xyes"; then
117-	    smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
118+	    smart_try_dir="$mysql_lib_dir"
119 	    FR_SMART_CHECK_LIB(mysqlclient_r, mysql_init)
120 	    if test "x$ac_cv_lib_mysqlclient_r_mysql_init" = "xyes"; then
121 			have_a_libmysqlclient='yes'
122@@ -149,7 +149,7 @@ if test x$with_[]modname != xno; then
123
124 	dnl # Check for libmysqlclient
125 	if test "x$have_a_libmysqlclient" != "xyes"; then
126-	    smart_try_dir="$mysql_lib_dir /usr/lib /usr/lib/mysql /usr/local/lib/mysql /usr/local/mysql/lib/mysql"
127+	    smart_try_dir="$mysql_lib_dir"
128 	    FR_SMART_CHECK_LIB(mysqlclient, mysql_init)
129 	    if test "x$ac_cv_lib_mysqlclient_mysql_init" = "xyes"; then
130 			have_a_libmysqlclient='yes'
131@@ -243,7 +243,7 @@ if test x$with_[]modname != xno; then
132     fi
133
134     if test "x$have_mysql_h" != "xyes"; then
135-		smart_try_dir="$mysql_include_dir /usr/local/include /usr/local/mysql/include"
136+		smart_try_dir="$mysql_include_dir"
137 		FR_SMART_CHECK_INCLUDE(mysql/mysql.h)
138 		if test "x$ac_cv_header_mysql_mysql_h" = "xyes"; then
139 	    	AC_DEFINE(HAVE_MYSQL_MYSQL_H, [], [Define if you have <mysql/mysql.h>])
140diff --git a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
141index 3b45da582a..03e6607d2b 100644
142--- a/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
143+++ b/src/modules/rlm_sql/drivers/rlm_sql_oracle/configure.ac
144@@ -68,7 +68,7 @@ if test x$with_[]modname != xno; then
145     dnl # Check for header files
146     dnl ############################################################
147
148-    smart_try_dir="$oracle_include_dir /usr/local/instaclient/include"
149+    smart_try_dir="$oracle_include_dir"
150
151     if test "x$ORACLE_HOME" != "x"; then
152 	smart_try_dir="${smart_try_dir} ${ORACLE_HOME}/include"
153diff --git a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
154index 8ac1022e89..d46c0f66bf 100644
155--- a/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
156+++ b/src/modules/rlm_sql/drivers/rlm_sql_postgresql/configure.ac
157@@ -45,7 +45,7 @@ if test x$with_[]modname != xno; then
158 	  esac ]
159 	)
160
161-	smart_try_dir="$rlm_sql_postgresql_include_dir /usr/include/postgresql /usr/local/pgsql/include /usr/include/pgsql"
162+	smart_try_dir="$rlm_sql_postgresql_include_dir"
163 	FR_SMART_CHECK_INCLUDE(libpq-fe.h)
164 	if test "x$ac_cv_header_libpqmfe_h" != "xyes"; then
165 		fail="$fail libpq-fe.h"
166@@ -94,7 +94,7 @@ if test x$with_[]modname != xno; then
167 		  ])
168 	fi
169
170-	smart_try_dir="$rlm_sql_postgresql_lib_dir /usr/lib /usr/local/pgsql/lib"
171+	smart_try_dir="$rlm_sql_postgresql_lib_dir"
172 	FR_SMART_CHECK_LIB(pq, PQconnectdb)
173 	if test "x$ac_cv_lib_pq_PQconnectdb" != "xyes"; then
174 		fail="$fail libpq"
175diff --git a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
176index f10279fe1f..0081a338c8 100644
177--- a/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
178+++ b/src/modules/rlm_sql/drivers/rlm_sql_unixodbc/configure.ac
179@@ -61,14 +61,14 @@ if test x$with_[]modname != xno; then
180 		esac])
181
182 	dnl Check for SQLConnect in -lodbc
183-	smart_try_dir="$unixodbc_lib_dir /usr/local/unixodbc/lib"
184+	smart_try_dir="$unixodbc_lib_dir"
185 	FR_SMART_CHECK_LIB(odbc, SQLConnect)
186 	if test "x$ac_cv_lib_odbc_SQLConnect" != xyes; then
187 		fail="$fail libodbc"
188 	fi
189
190 	dnl Check for sql.h
191-	smart_try_dir="$unixodbc_include_dir /usr/local/unixodbc/include"
192+	smart_try_dir="$unixodbc_include_dir"
193 	FR_SMART_CHECK_INCLUDE(sql.h)
194 	if test "x$ac_cv_header_sql_h" != xyes; then
195 		fail="$fail sql.h"
196--
1972.25.1
198
199