From 3abac7805836ae5d0f6e667651fbd2dabba6271d Mon Sep 17 00:00:00 2001 From: benrubson Date: Sun, 25 Jun 2017 15:08:25 +0200 Subject: [PATCH] Detect binaries without xattr support during tests --- encfs/main.cpp | 5 ++++- tests/reverse.t.pl | 5 +++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/encfs/main.cpp b/encfs/main.cpp index 28e2f1c1..cf58815c 100644 --- a/encfs/main.cpp +++ b/encfs/main.cpp @@ -245,7 +245,7 @@ static bool processArgs(int argc, char *argv[], // 'o' : arguments meant for fuse // 't' : syslog tag int res = - getopt_long(argc, argv, "HsSfvdmi:o:t:", long_options, &option_index); + getopt_long(argc, argv, "HsSfvdmi:o:t:V", long_options, &option_index); if (res == -1) break; @@ -355,6 +355,9 @@ static bool processArgs(int argc, char *argv[], case 'V': // xgroup(usage) cerr << autosprintf(_("encfs version %s"), VERSION) << endl; +#if defined(HAVE_XATTR) + cerr << "Compiled with : HAVE_XATTR" << endl; +#endif exit(EXIT_SUCCESS); break; case 'H': diff --git a/tests/reverse.t.pl b/tests/reverse.t.pl index bea37ab3..9fb9fb90 100755 --- a/tests/reverse.t.pl +++ b/tests/reverse.t.pl @@ -26,6 +26,11 @@ # FreeBSD @binattr = ("lsextattr", "user"); } +if(system("./build/encfs -V 2>&1 | grep -q HAVE_XATTR") != 0) +{ + # Workaround for binaries without xattr support so that tests will not fail + @binattr = ("ls", "-l"); +} # Helper function # Create a new empty working directory