Skip to content

Commit 03ea5b5

Browse files
committed
updated for version 7.4.254
Problem: Smack support detection is incomplete. Solution: Check for attr/xattr.h and specific macro.
1 parent 77567a8 commit 03ea5b5

3 files changed

Lines changed: 52 additions & 13 deletions

File tree

src/auto/configure

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4611,13 +4611,41 @@ fi
46114611

46124612

46134613
else
4614-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4614+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
4615+
$as_echo "yes" >&6; }
4616+
fi
4617+
if test "$enable_smack" = "yes"; then
4618+
ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default"
4619+
if test "x$ac_cv_header_attr_xattr_h" = xyes; then :
4620+
true
4621+
else
4622+
enable_smack="no"
4623+
fi
4624+
4625+
4626+
fi
4627+
if test "$enable_smack" = "yes"; then
4628+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for XATTR_NAME_SMACKEXEC in linux/xattr.h" >&5
4629+
$as_echo_n "checking for XATTR_NAME_SMACKEXEC in linux/xattr.h... " >&6; }
4630+
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
4631+
/* end confdefs.h. */
4632+
#include <linux/xattr.h>
4633+
_ACEOF
4634+
if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
4635+
$EGREP "XATTR_NAME_SMACKEXEC" >/dev/null 2>&1; then :
4636+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
46154637
$as_echo "yes" >&6; }
4638+
else
4639+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
4640+
$as_echo "no" >&6; }; enable_smack = "no"
4641+
fi
4642+
rm -f conftest*
4643+
46164644
fi
46174645
if test "$enable_smack" = "yes"; then
4618-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for llistxattr in -lattr" >&5
4619-
$as_echo_n "checking for llistxattr in -lattr... " >&6; }
4620-
if ${ac_cv_lib_attr_llistxattr+:} false; then :
4646+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for setxattr in -lattr" >&5
4647+
$as_echo_n "checking for setxattr in -lattr... " >&6; }
4648+
if ${ac_cv_lib_attr_setxattr+:} false; then :
46214649
$as_echo_n "(cached) " >&6
46224650
else
46234651
ac_check_lib_save_LIBS=$LIBS
@@ -4631,27 +4659,27 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
46314659
#ifdef __cplusplus
46324660
extern "C"
46334661
#endif
4634-
char llistxattr ();
4662+
char setxattr ();
46354663
int
46364664
main ()
46374665
{
4638-
return llistxattr ();
4666+
return setxattr ();
46394667
;
46404668
return 0;
46414669
}
46424670
_ACEOF
46434671
if ac_fn_c_try_link "$LINENO"; then :
4644-
ac_cv_lib_attr_llistxattr=yes
4672+
ac_cv_lib_attr_setxattr=yes
46454673
else
4646-
ac_cv_lib_attr_llistxattr=no
4674+
ac_cv_lib_attr_setxattr=no
46474675
fi
46484676
rm -f core conftest.err conftest.$ac_objext \
46494677
conftest$ac_exeext conftest.$ac_ext
46504678
LIBS=$ac_check_lib_save_LIBS
46514679
fi
4652-
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_llistxattr" >&5
4653-
$as_echo "$ac_cv_lib_attr_llistxattr" >&6; }
4654-
if test "x$ac_cv_lib_attr_llistxattr" = xyes; then :
4680+
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_attr_setxattr" >&5
4681+
$as_echo "$ac_cv_lib_attr_setxattr" >&6; }
4682+
if test "x$ac_cv_lib_attr_setxattr" = xyes; then :
46554683
LIBS="$LIBS -lattr"
46564684
found_smack="yes"
46574685
$as_echo "#define HAVE_SMACK 1" >>confdefs.h

src/configure.in

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,19 @@ if test "$enable_smack" = "yes"; then
396396
AC_MSG_RESULT(no)
397397
AC_CHECK_HEADER([linux/xattr.h], true, enable_smack="no")
398398
else
399-
AC_MSG_RESULT(yes)
399+
AC_MSG_RESULT(yes)
400+
fi
401+
if test "$enable_smack" = "yes"; then
402+
AC_CHECK_HEADER([attr/xattr.h], true, enable_smack="no")
403+
fi
404+
if test "$enable_smack" = "yes"; then
405+
AC_MSG_CHECKING(for XATTR_NAME_SMACKEXEC in linux/xattr.h)
406+
AC_EGREP_CPP(XATTR_NAME_SMACKEXEC, [#include <linux/xattr.h>],
407+
AC_MSG_RESULT(yes),
408+
AC_MSG_RESULT(no); enable_smack = "no")
400409
fi
401410
if test "$enable_smack" = "yes"; then
402-
AC_CHECK_LIB(attr, llistxattr,
411+
AC_CHECK_LIB(attr, setxattr,
403412
[LIBS="$LIBS -lattr"
404413
found_smack="yes"
405414
AC_DEFINE(HAVE_SMACK)])

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
254,
737739
/**/
738740
253,
739741
/**/

0 commit comments

Comments
 (0)