Rebase to 0.7.6
- removed usbguard-applet-qt subpackage - because it is not supported on upstream anymore
This commit is contained in:
parent
f64e73a5d4
commit
9bd7d56f11
1
.gitignore
vendored
1
.gitignore
vendored
@ -12,3 +12,4 @@
|
||||
/usbguard-0.7.0.tar.gz
|
||||
/usbguard-0.7.1.tar.gz
|
||||
/usbguard-0.7.2.tar.gz
|
||||
/usbguard-0.7.6.tar.gz
|
||||
|
||||
@ -1,567 +0,0 @@
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index a135e01..f565b87 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -290,54 +290,28 @@ AC_SUBST([catch_LIBS])
|
||||
#
|
||||
AC_ARG_WITH([bundled-pegtl], AS_HELP_STRING([--with-bundled-pegtl], [Build using the bundled PEGTL library]), [with_bundled_pegtl=$withval], [with_bundled_pegtl=no])
|
||||
if test "x$with_bundled_pegtl" = xyes; then
|
||||
- pegtl_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/PEGTL"
|
||||
- pegtl_AC_CFLAGS="-I$srcdir/src/ThirdParty/PEGTL"
|
||||
+ pegtl_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/PEGTL/include"
|
||||
+ pegtl_AC_CFLAGS="-I$srcdir/src/ThirdParty/PEGTL/include"
|
||||
pegtl_LIBS=""
|
||||
AC_MSG_NOTICE([Using bundled PEGTL library])
|
||||
pegtl_summary="bundled; $pegtl_CFLAGS $pegtl_LIBS"
|
||||
else
|
||||
- SAVE_CPPFLAGS=$CPPFLAGS
|
||||
- CPPFLAGS="-std=c++11 $CPPFLAGS"
|
||||
- AC_LANG_PUSH([C++])
|
||||
- AC_CHECK_HEADER([pegtl.hh], [], [AC_MSG_FAILURE(pegtl.hh not found or not usable. Re-run with --with-bundled-pegtl to use the bundled library.)])
|
||||
- AC_LANG_POP
|
||||
pegtl_CFLAGS=""
|
||||
pegtl_AC_CFLAGS=""
|
||||
pegtl_LIBS=""
|
||||
- CPPFLAGS=$SAVE_CPPFLAGS
|
||||
pegtl_summary="system-wide; $pegtl_CFLAGS $pegtl_LIBS"
|
||||
fi
|
||||
AC_SUBST([pegtl_CFLAGS])
|
||||
AC_SUBST([pegtl_AC_CFLAGS])
|
||||
AC_SUBST([pegtl_LIBS])
|
||||
|
||||
-#
|
||||
-# Check whether the available PEGTL library is compatible
|
||||
-# with version 1.3.1 or older.
|
||||
-#
|
||||
SAVE_CPPFLAGS=$CPPFLAGS
|
||||
-CPPFLAGS="-std=c++11 $pegtl_AC_CFLAGS"
|
||||
+CPPFLAGS="-std=c++11 $CPPFLAGS $pegtl_AC_CFLAGS"
|
||||
AC_LANG_PUSH([C++])
|
||||
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
|
||||
-#include <pegtl.hh>
|
||||
-#include <string>
|
||||
-int main(void)
|
||||
-{
|
||||
- struct grammar
|
||||
- : pegtl::one<'g'> {};
|
||||
- try {
|
||||
- pegtl::parse_string<grammar>(std::string(), std::string());
|
||||
- } catch(const pegtl::parse_error& ex) {
|
||||
- auto b = ex.positions[0].byte_in_line;
|
||||
- }
|
||||
- return 0;
|
||||
-}
|
||||
-]])],
|
||||
-[have_pegtl_lte_131=no], [have_pegtl_lte_131=yes])
|
||||
+AC_CHECK_HEADER([tao/pegtl.hpp],
|
||||
+ [AC_DEFINE([HAVE_TAO_PEGTL_HPP], [1], [PEGTL header file with .hpp extension is present])],
|
||||
+ [AC_MSG_FAILURE(PEGTL header file not found or not usable. Re-run with --with-bundled-pegtl to use the bundled library.)])
|
||||
AC_LANG_POP
|
||||
-if test "x$have_pegtl_lte_131" = xyes; then
|
||||
- AC_DEFINE([HAVE_PEGTL_LTE_1_3_1], [1], [PEGTL version less than or equal to 1.3.1])
|
||||
-fi
|
||||
CPPFLAGS=$SAVE_CPPFLAGS
|
||||
|
||||
#
|
||||
diff --git a/src/Library/RuleParser/Actions.hpp b/src/Library/RuleParser/Actions.hpp
|
||||
index 3e185f4..2b21bd2 100644
|
||||
--- a/src/Library/RuleParser/Actions.hpp
|
||||
+++ b/src/Library/RuleParser/Actions.hpp
|
||||
@@ -24,7 +24,7 @@
|
||||
#include "Utility.hpp"
|
||||
#include "Common/Utility.hpp"
|
||||
|
||||
-#include <pegtl.hh>
|
||||
+#include <tao/pegtl.hpp>
|
||||
|
||||
namespace usbguard
|
||||
{
|
||||
@@ -47,7 +47,7 @@ namespace usbguard
|
||||
struct str_if;
|
||||
|
||||
template<typename Rule>
|
||||
- struct rule_parser_actions : pegtl::nothing<Rule> {};
|
||||
+ struct rule_parser_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct rule_parser_actions<target> {
|
||||
@@ -58,7 +58,7 @@ namespace usbguard
|
||||
rule.setTarget(Rule::targetFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -75,7 +75,7 @@ namespace usbguard
|
||||
rule.setDeviceID(device_id);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -87,7 +87,7 @@ namespace usbguard
|
||||
}
|
||||
|
||||
template<typename Rule>
|
||||
- struct name_actions : pegtl::nothing<Rule> {};
|
||||
+ struct name_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct name_actions<str_name> {
|
||||
@@ -95,7 +95,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeName().empty()) {
|
||||
- throw pegtl::parse_error("name attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("name attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -109,7 +109,7 @@ namespace usbguard
|
||||
rule.attributeName().append(stringValueFromRule(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -123,13 +123,13 @@ namespace usbguard
|
||||
rule.attributeName().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct id_actions : pegtl::nothing<Rule> {};
|
||||
+ struct id_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct id_actions<str_id> {
|
||||
@@ -137,7 +137,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeDeviceID().empty()) {
|
||||
- throw pegtl::parse_error("id attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("id attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -154,7 +154,7 @@ namespace usbguard
|
||||
rule.attributeDeviceID().append(device_id);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -168,13 +168,13 @@ namespace usbguard
|
||||
rule.attributeDeviceID().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct hash_actions : pegtl::nothing<Rule> {};
|
||||
+ struct hash_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct hash_actions<str_hash> {
|
||||
@@ -182,7 +182,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeHash().empty()) {
|
||||
- throw pegtl::parse_error("hash attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("hash attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -196,7 +196,7 @@ namespace usbguard
|
||||
rule.attributeHash().append(stringValueFromRule(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -210,13 +210,13 @@ namespace usbguard
|
||||
rule.attributeHash().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct parent_hash_actions : pegtl::nothing<Rule> {};
|
||||
+ struct parent_hash_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct parent_hash_actions<str_parent_hash> {
|
||||
@@ -224,7 +224,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeParentHash().empty()) {
|
||||
- throw pegtl::parse_error("parent-hash attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("parent-hash attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -238,7 +238,7 @@ namespace usbguard
|
||||
rule.attributeParentHash().append(stringValueFromRule(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -252,13 +252,13 @@ namespace usbguard
|
||||
rule.attributeParentHash().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct serial_actions : pegtl::nothing<Rule> {};
|
||||
+ struct serial_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct serial_actions<str_serial> {
|
||||
@@ -266,7 +266,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeSerial().empty()) {
|
||||
- throw pegtl::parse_error("serial attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("serial attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -280,7 +280,7 @@ namespace usbguard
|
||||
rule.attributeSerial().append(stringValueFromRule(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -294,13 +294,13 @@ namespace usbguard
|
||||
rule.attributeSerial().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct via_port_actions : pegtl::nothing<Rule> {};
|
||||
+ struct via_port_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct via_port_actions<str_via_port> {
|
||||
@@ -308,7 +308,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeViaPort().empty()) {
|
||||
- throw pegtl::parse_error("via-port attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("via-port attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -322,7 +322,7 @@ namespace usbguard
|
||||
rule.attributeViaPort().append(stringValueFromRule(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -336,13 +336,13 @@ namespace usbguard
|
||||
rule.attributeViaPort().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct with_interface_actions : pegtl::nothing<Rule> {};
|
||||
+ struct with_interface_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct with_interface_actions<str_with_interface> {
|
||||
@@ -350,7 +350,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeWithInterface().empty()) {
|
||||
- throw pegtl::parse_error("with-interface attribute already defined", in);
|
||||
+ throw tao::pegtl::parse_error("with-interface attribute already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -365,7 +365,7 @@ namespace usbguard
|
||||
rule.attributeWithInterface().append(interface_type);
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -379,13 +379,13 @@ namespace usbguard
|
||||
rule.attributeWithInterface().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
template<typename Rule>
|
||||
- struct condition_actions : pegtl::nothing<Rule> {};
|
||||
+ struct condition_actions : tao::pegtl::nothing<Rule> {};
|
||||
|
||||
template<>
|
||||
struct condition_actions<str_if> {
|
||||
@@ -393,7 +393,7 @@ namespace usbguard
|
||||
static void apply(const Input& in, Rule& rule)
|
||||
{
|
||||
if (!rule.attributeConditions().empty()) {
|
||||
- throw pegtl::parse_error("conditions already defined", in);
|
||||
+ throw tao::pegtl::parse_error("conditions already defined", in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -407,7 +407,7 @@ namespace usbguard
|
||||
rule.attributeConditions().append(RuleCondition(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -421,7 +421,7 @@ namespace usbguard
|
||||
rule.attributeConditions().setSetOperator(Rule::setOperatorFromString(in.string()));
|
||||
}
|
||||
catch (const std::exception& ex) {
|
||||
- throw pegtl::parse_error(ex.what(), in);
|
||||
+ throw tao::pegtl::parse_error(ex.what(), in);
|
||||
}
|
||||
}
|
||||
};
|
||||
diff --git a/src/Library/RuleParser/Grammar.hpp b/src/Library/RuleParser/Grammar.hpp
|
||||
index 9bd4a15..4d785c0 100644
|
||||
--- a/src/Library/RuleParser/Grammar.hpp
|
||||
+++ b/src/Library/RuleParser/Grammar.hpp
|
||||
@@ -22,37 +22,37 @@
|
||||
#endif
|
||||
|
||||
#include "Actions.hpp"
|
||||
-#include <pegtl.hh>
|
||||
|
||||
-using namespace pegtl;
|
||||
+#include <tao/pegtl.hpp>
|
||||
|
||||
namespace usbguard
|
||||
{
|
||||
namespace RuleParser
|
||||
{
|
||||
+ using namespace tao::pegtl;
|
||||
/*
|
||||
* Rule language keywords
|
||||
*/
|
||||
- struct str_allow : pegtl_string_t("allow") {};
|
||||
- struct str_block : pegtl_string_t("block") {};
|
||||
- struct str_reject : pegtl_string_t("reject") {};
|
||||
- struct str_match : pegtl_string_t("match") {};
|
||||
- struct str_device : pegtl_string_t("device") {};
|
||||
-
|
||||
- struct str_name : pegtl_string_t("name") {};
|
||||
- struct str_hash : pegtl_string_t("hash") {};
|
||||
- struct str_parent_hash : pegtl_string_t("parent-hash") {};
|
||||
- struct str_via_port : pegtl_string_t("via-port") {};
|
||||
- struct str_with_interface : pegtl_string_t("with-interface") {};
|
||||
- struct str_serial : pegtl_string_t("serial") {};
|
||||
- struct str_if : pegtl_string_t("if") {};
|
||||
- struct str_id : pegtl_string_t("id") {};
|
||||
-
|
||||
- struct str_all_of : pegtl_string_t("all-of") {};
|
||||
- struct str_one_of : pegtl_string_t("one-of") {};
|
||||
- struct str_none_of : pegtl_string_t("none-of") {};
|
||||
- struct str_equals : pegtl_string_t("equals") {};
|
||||
- struct str_equals_ordered : pegtl_string_t("equals-ordered") {};
|
||||
+ struct str_allow : TAOCPP_PEGTL_STRING("allow") {};
|
||||
+ struct str_block : TAOCPP_PEGTL_STRING("block") {};
|
||||
+ struct str_reject : TAOCPP_PEGTL_STRING("reject") {};
|
||||
+ struct str_match : TAOCPP_PEGTL_STRING("match") {};
|
||||
+ struct str_device : TAOCPP_PEGTL_STRING("device") {};
|
||||
+
|
||||
+ struct str_name : TAOCPP_PEGTL_STRING("name") {};
|
||||
+ struct str_hash : TAOCPP_PEGTL_STRING("hash") {};
|
||||
+ struct str_parent_hash : TAOCPP_PEGTL_STRING("parent-hash") {};
|
||||
+ struct str_via_port : TAOCPP_PEGTL_STRING("via-port") {};
|
||||
+ struct str_with_interface : TAOCPP_PEGTL_STRING("with-interface") {};
|
||||
+ struct str_serial : TAOCPP_PEGTL_STRING("serial") {};
|
||||
+ struct str_if : TAOCPP_PEGTL_STRING("if") {};
|
||||
+ struct str_id : TAOCPP_PEGTL_STRING("id") {};
|
||||
+
|
||||
+ struct str_all_of : TAOCPP_PEGTL_STRING("all-of") {};
|
||||
+ struct str_one_of : TAOCPP_PEGTL_STRING("one-of") {};
|
||||
+ struct str_none_of : TAOCPP_PEGTL_STRING("none-of") {};
|
||||
+ struct str_equals : TAOCPP_PEGTL_STRING("equals") {};
|
||||
+ struct str_equals_ordered : TAOCPP_PEGTL_STRING("equals-ordered") {};
|
||||
|
||||
/*
|
||||
* Generic rule attribute
|
||||
diff --git a/src/Library/UEventParser.cpp b/src/Library/UEventParser.cpp
|
||||
index 2e0ce39..aebe948 100644
|
||||
--- a/src/Library/UEventParser.cpp
|
||||
+++ b/src/Library/UEventParser.cpp
|
||||
@@ -27,7 +27,9 @@
|
||||
#include "usbguard/Logger.hpp"
|
||||
|
||||
#include <fstream>
|
||||
-#include <pegtl/trace.hh>
|
||||
+
|
||||
+#include <tao/pegtl/contrib/tracer.hpp>
|
||||
+using namespace tao;
|
||||
|
||||
namespace usbguard
|
||||
{
|
||||
@@ -114,25 +116,14 @@ namespace usbguard
|
||||
void parseUEventFromString(const std::string& uevent_string, UEvent& uevent, bool trace)
|
||||
{
|
||||
try {
|
||||
-#if HAVE_PEGTL_LTE_1_3_1
|
||||
+ tao::pegtl::string_input<> in(uevent_string, std::string());
|
||||
|
||||
if (!trace) {
|
||||
- pegtl::parse<G, UEventParser::actions>(uevent_string, std::string(), uevent);
|
||||
+ tao::pegtl::parse<G, UEventParser::actions>(in, uevent);
|
||||
}
|
||||
else {
|
||||
- pegtl::parse<G, UEventParser::actions, pegtl::tracer>(uevent_string, std::string(), uevent);
|
||||
- }
|
||||
-
|
||||
-#else
|
||||
-
|
||||
- if (!trace) {
|
||||
- pegtl::parse_string<G, UEventParser::actions>(uevent_string, std::string(), uevent);
|
||||
+ tao::pegtl::parse<G, UEventParser::actions, tao::pegtl::tracer>(in, uevent);
|
||||
}
|
||||
- else {
|
||||
- pegtl::parse_string<G, UEventParser::actions, pegtl::tracer>(uevent_string, std::string(), uevent);
|
||||
- }
|
||||
-
|
||||
-#endif
|
||||
}
|
||||
catch (...) {
|
||||
throw;
|
||||
diff --git a/src/Library/UEventParser.hpp b/src/Library/UEventParser.hpp
|
||||
index 856d5ff..4261bd5 100644
|
||||
--- a/src/Library/UEventParser.hpp
|
||||
+++ b/src/Library/UEventParser.hpp
|
||||
@@ -23,9 +23,7 @@
|
||||
|
||||
#include "usbguard/Typedefs.hpp"
|
||||
|
||||
-#include <pegtl.hh>
|
||||
-
|
||||
-using namespace pegtl;
|
||||
+#include <tao/pegtl.hpp>
|
||||
|
||||
namespace usbguard
|
||||
{
|
||||
@@ -33,6 +31,8 @@ namespace usbguard
|
||||
|
||||
namespace UEventParser
|
||||
{
|
||||
+ using namespace tao::pegtl;
|
||||
+
|
||||
struct value
|
||||
: seq<not_one<'\0', '\n'>, star<not_one<'\0', '\n'>>> {};
|
||||
|
||||
diff --git a/src/Library/public/usbguard/RuleParser.cpp b/src/Library/public/usbguard/RuleParser.cpp
|
||||
index 4061e01..140bf14 100644
|
||||
--- a/src/Library/public/usbguard/RuleParser.cpp
|
||||
+++ b/src/Library/public/usbguard/RuleParser.cpp
|
||||
@@ -34,7 +34,7 @@
|
||||
#include <stdexcept>
|
||||
#include <stdlib.h>
|
||||
|
||||
-#include <pegtl/trace.hh>
|
||||
+#include <tao/pegtl/contrib/tracer.hpp>
|
||||
|
||||
namespace usbguard
|
||||
{
|
||||
@@ -42,35 +42,21 @@ namespace usbguard
|
||||
{
|
||||
try {
|
||||
Rule rule;
|
||||
-#if HAVE_PEGTL_LTE_1_3_1
|
||||
+ tao::pegtl::string_input<> input(rule_spec, file);
|
||||
|
||||
if (!trace) {
|
||||
- pegtl::parse<RuleParser::rule_grammar, RuleParser::rule_parser_actions>(rule_spec, file, rule);
|
||||
+ tao::pegtl::parse<RuleParser::rule_grammar, RuleParser::rule_parser_actions>(input, rule);
|
||||
}
|
||||
else {
|
||||
- pegtl::parse<RuleParser::rule_grammar, RuleParser::rule_parser_actions, pegtl::tracer>(rule_spec, file, rule);
|
||||
+ tao::pegtl::parse<RuleParser::rule_grammar, RuleParser::rule_parser_actions, tao::pegtl::tracer>(input, rule);
|
||||
}
|
||||
|
||||
-#else
|
||||
-
|
||||
- if (!trace) {
|
||||
- pegtl::parse_string<RuleParser::rule_grammar, RuleParser::rule_parser_actions>(rule_spec, file, rule);
|
||||
- }
|
||||
- else {
|
||||
- pegtl::parse_string<RuleParser::rule_grammar, RuleParser::rule_parser_actions, pegtl::tracer>(rule_spec, file, rule);
|
||||
- }
|
||||
-
|
||||
-#endif
|
||||
return rule;
|
||||
}
|
||||
- catch (const pegtl::parse_error& ex) {
|
||||
+ catch (const tao::pegtl::parse_error& ex) {
|
||||
RuleParserError error(rule_spec);
|
||||
error.setHint(ex.what());
|
||||
-#if HAVE_PEGTL_LTE_1_3_1
|
||||
- error.setOffset(ex.positions[0].column);
|
||||
-#else
|
||||
error.setOffset(ex.positions[0].byte_in_line);
|
||||
-#endif
|
||||
|
||||
if (!file.empty() || line != 0) {
|
||||
error.setFileInfo(file, line);
|
||||
--
|
||||
2.13.6
|
||||
|
||||
2
sources
2
sources
@ -1 +1 @@
|
||||
SHA512 (usbguard-0.7.2.tar.gz) = 2b2e0e2cb93f22c2e4111b4afe4e0d81e198e4540a6260f3f376bdd6dc4b5d062f3c20708f458ea5992b77742685c59e7e965ef42af49891547170ebb3f8cd61
|
||||
SHA512 (usbguard-0.7.6.tar.gz) = 0b0d42276e48baac2dc1f9031eec25e3f622a8d6178cb0400b97c7d32005bfa158b60fd286fdc66206a8684658fefaf6389ef93511e942f025e75671d7455628
|
||||
|
||||
@ -1,11 +1,6 @@
|
||||
%global _hardened_build 1
|
||||
|
||||
%define with_gui_qt5 1
|
||||
%define with_dbus 1
|
||||
|
||||
Name: usbguard
|
||||
Version: 0.7.2
|
||||
Release: 8%{?dist}
|
||||
Version: 0.7.6
|
||||
Release: 1%{?dist}
|
||||
Summary: A tool for implementing USB device usage policy
|
||||
License: GPLv2+
|
||||
## Not installed
|
||||
@ -14,8 +9,6 @@ URL: https://usbguard.github.io/
|
||||
Source0: https://github.com/USBGuard/usbguard/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
|
||||
Source1: usbguard-daemon.conf
|
||||
|
||||
Patch0: 0001-Update-to-latest-PEGTL-API.patch
|
||||
|
||||
Requires: systemd
|
||||
Requires(post): systemd
|
||||
Requires(preun): systemd
|
||||
@ -23,6 +16,8 @@ Requires(postun): systemd
|
||||
Requires(post): /sbin/ldconfig
|
||||
Requires(postun): /sbin/ldconfig
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: libqb-devel
|
||||
BuildRequires: libgcrypt-devel
|
||||
BuildRequires: libstdc++-devel
|
||||
@ -31,23 +26,19 @@ BuildRequires: PEGTL-static
|
||||
BuildRequires: catch1-devel
|
||||
BuildRequires: autoconf automake libtool
|
||||
BuildRequires: bash-completion
|
||||
BuildRequires: asciidoctor
|
||||
BuildRequires: asciidoc
|
||||
BuildRequires: audit-libs-devel
|
||||
# For `pkg-config systemd` only
|
||||
BuildRequires: systemd
|
||||
|
||||
%if 0%{with_gui_qt5}
|
||||
BuildRequires: qt5-qtbase-devel qt5-qtsvg-devel qt5-linguist
|
||||
%endif
|
||||
|
||||
%if 0%{with_dbus}
|
||||
# dbus
|
||||
BuildRequires: dbus-glib-devel
|
||||
BuildRequires: dbus-devel
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: polkit-devel
|
||||
BuildRequires: libxslt
|
||||
BuildRequires: libxml2
|
||||
%endif
|
||||
|
||||
|
||||
%description
|
||||
The USBGuard software framework helps to protect your computer against rogue USB
|
||||
@ -72,21 +63,8 @@ Requires: %{name} = %{version}-%{release}
|
||||
The %{name}-tools package contains optional tools from the USBGuard
|
||||
software framework.
|
||||
|
||||
%if 0%{with_gui_qt5}
|
||||
###
|
||||
%package applet-qt
|
||||
Summary: USBGuard Qt 5.x Applet
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
Obsoletes: usbguard-applet-qt <= 0.3
|
||||
|
||||
%description applet-qt
|
||||
The %{name}-applet-qt package contains an optional Qt 5.x desktop applet
|
||||
for interacting with the USBGuard daemon component.
|
||||
###
|
||||
%endif
|
||||
|
||||
%if 0%{with_dbus}
|
||||
###
|
||||
# dbus
|
||||
%package dbus
|
||||
Summary: USBGuard D-Bus Service
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
@ -96,12 +74,10 @@ Requires: polkit
|
||||
%description dbus
|
||||
The %{name}-dbus package contains an optional component that provides
|
||||
a D-Bus interface to the USBGuard daemon component.
|
||||
###
|
||||
%endif
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p1
|
||||
|
||||
# Remove bundled library sources before build
|
||||
rm -rf src/ThirdParty/{Catch,PEGTL}
|
||||
@ -114,16 +90,8 @@ autoreconf -i -v --no-recursive ./
|
||||
--without-bundled-catch \
|
||||
--without-bundled-pegtl \
|
||||
--enable-systemd \
|
||||
%if 0%{with_gui_qt5}
|
||||
--with-gui-qt=qt5 \
|
||||
%endif
|
||||
%if 0%{with_dbus}
|
||||
--with-dbus \
|
||||
--with-polkit \
|
||||
%else
|
||||
--without-dbus \
|
||||
--without-polkit \
|
||||
%endif
|
||||
--with-crypto-library=gcrypt
|
||||
|
||||
make %{?_smp_mflags}
|
||||
@ -179,23 +147,12 @@ find %{buildroot} \( -name '*.la' -o -name '*.a' \) -exec rm -f {} ';'
|
||||
%files tools
|
||||
%{_bindir}/usbguard-rule-parser
|
||||
|
||||
%if 0%{with_gui_qt5}
|
||||
###
|
||||
%files applet-qt
|
||||
%{_bindir}/usbguard-applet-qt
|
||||
%{_mandir}/man1/usbguard-applet-qt.1.gz
|
||||
%{_datadir}/applications/usbguard-applet-qt.desktop
|
||||
%{_datadir}/icons/hicolor/scalable/apps/usbguard-icon.svg
|
||||
###
|
||||
%endif
|
||||
|
||||
%if 0%{with_dbus}
|
||||
###
|
||||
# dbus
|
||||
%files dbus
|
||||
%{_sbindir}/usbguard-dbus
|
||||
%{_datadir}/dbus-1/system-services/org.usbguard.service
|
||||
%{_datadir}/dbus-1/system.d/org.usbguard.conf
|
||||
%{_datadir}/polkit-1/actions/org.usbguard.policy
|
||||
%{_datadir}/dbus-1/system-services/org.usbguard1.service
|
||||
%{_datadir}/dbus-1/system.d/org.usbguard1.conf
|
||||
%{_datadir}/polkit-1/actions/org.usbguard1.policy
|
||||
%{_unitdir}/usbguard-dbus.service
|
||||
%{_mandir}/man8/usbguard-dbus.8.gz
|
||||
|
||||
@ -207,10 +164,13 @@ find %{buildroot} \( -name '*.la' -o -name '*.a' \) -exec rm -f {} ';'
|
||||
|
||||
%postun dbus
|
||||
%systemd_postun_with_restart usbguard-dbus.service
|
||||
###
|
||||
%endif
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Nov 11 2019 Radovan Sroka <rsroka@redhat.com> - 0.7.6-1
|
||||
- rebase to 0.7.6
|
||||
- removed usbguard-applet subpackage which is not in upstream anymore
|
||||
|
||||
* Sat Jul 27 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.7.2-8
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user