Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 8ff1f6a

Browse files
committed
Adjust configure's probe for libselinux so it rejects too-old versions.
We need at least version 2.0.93, so probe for a function that was added in that version. Kaigai Kohei
1 parent f506559 commit 8ff1f6a

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

configure

+12-12
Original file line numberDiff line numberDiff line change
@@ -9389,9 +9389,9 @@ fi
93899389
# for contrib/sepgsql
93909390
if test "$with_selinux" = yes; then
93919391

9392-
{ $as_echo "$as_me:$LINENO: checking for getpeercon_raw in -lselinux" >&5
9393-
$as_echo_n "checking for getpeercon_raw in -lselinux... " >&6; }
9394-
if test "${ac_cv_lib_selinux_getpeercon_raw+set}" = set; then
9392+
{ $as_echo "$as_me:$LINENO: checking for selinux_sepgsql_context_path in -lselinux" >&5
9393+
$as_echo_n "checking for selinux_sepgsql_context_path in -lselinux... " >&6; }
9394+
if test "${ac_cv_lib_selinux_selinux_sepgsql_context_path+set}" = set; then
93959395
$as_echo_n "(cached) " >&6
93969396
else
93979397
ac_check_lib_save_LIBS=$LIBS
@@ -9409,11 +9409,11 @@ cat >>conftest.$ac_ext <<_ACEOF
94099409
#ifdef __cplusplus
94109410
extern "C"
94119411
#endif
9412-
char getpeercon_raw ();
9412+
char selinux_sepgsql_context_path ();
94139413
int
94149414
main ()
94159415
{
9416-
return getpeercon_raw ();
9416+
return selinux_sepgsql_context_path ();
94179417
;
94189418
return 0;
94199419
}
@@ -9439,31 +9439,31 @@ $as_echo "$ac_try_echo") >&5
94399439
test "$cross_compiling" = yes ||
94409440
$as_test_x conftest$ac_exeext
94419441
}; then
9442-
ac_cv_lib_selinux_getpeercon_raw=yes
9442+
ac_cv_lib_selinux_selinux_sepgsql_context_path=yes
94439443
else
94449444
$as_echo "$as_me: failed program was:" >&5
94459445
sed 's/^/| /' conftest.$ac_ext >&5
94469446

9447-
ac_cv_lib_selinux_getpeercon_raw=no
9447+
ac_cv_lib_selinux_selinux_sepgsql_context_path=no
94489448
fi
94499449

94509450
rm -rf conftest.dSYM
94519451
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
94529452
conftest$ac_exeext conftest.$ac_ext
94539453
LIBS=$ac_check_lib_save_LIBS
94549454
fi
9455-
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_getpeercon_raw" >&5
9456-
$as_echo "$ac_cv_lib_selinux_getpeercon_raw" >&6; }
9457-
if test "x$ac_cv_lib_selinux_getpeercon_raw" = x""yes; then
9455+
{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_selinux_selinux_sepgsql_context_path" >&5
9456+
$as_echo "$ac_cv_lib_selinux_selinux_sepgsql_context_path" >&6; }
9457+
if test "x$ac_cv_lib_selinux_selinux_sepgsql_context_path" = x""yes; then
94589458
cat >>confdefs.h <<_ACEOF
94599459
#define HAVE_LIBSELINUX 1
94609460
_ACEOF
94619461

94629462
LIBS="-lselinux $LIBS"
94639463

94649464
else
9465-
{ { $as_echo "$as_me:$LINENO: error: library 'libselinux' is required for SELinux support" >&5
9466-
$as_echo "$as_me: error: library 'libselinux' is required for SELinux support" >&2;}
9465+
{ { $as_echo "$as_me:$LINENO: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&5
9466+
$as_echo "$as_me: error: library 'libselinux', version 2.0.93 or newer, is required for SELinux support" >&2;}
94679467
{ (exit 1); exit 1; }; }
94689468
fi
94699469

configure.in

+2-2
Original file line numberDiff line numberDiff line change
@@ -960,8 +960,8 @@ fi
960960

961961
# for contrib/sepgsql
962962
if test "$with_selinux" = yes; then
963-
AC_CHECK_LIB(selinux, getpeercon_raw, [],
964-
[AC_MSG_ERROR([library 'libselinux' is required for SELinux support])])
963+
AC_CHECK_LIB(selinux, selinux_sepgsql_context_path, [],
964+
[AC_MSG_ERROR([library 'libselinux', version 2.0.93 or newer, is required for SELinux support])])
965965
fi
966966

967967
# for contrib/uuid-ossp

0 commit comments

Comments
 (0)