Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usbguard: update to 1.1.2. #39944

Merged
merged 1 commit into from Jun 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
73 changes: 0 additions & 73 deletions srcpkgs/usbguard/patches/musl.patch
@@ -1,18 +1,5 @@
--- a/src/CLI/usbguard.cpp 2019-06-13 11:51:53.787863657 +0000
+++ b/src/CLI/usbguard.cpp 2019-08-23 01:52:34.233056882 +0000
@@ -26,10 +26,8 @@
#include <map>
#include <iostream>

-#ifndef _GNU_SOURCE
- #define _GNU_SOURCE
-#endif
-#include <cstring> /* GNU version of basename(3) */
+#include <cstring>
+#include <libgen.h>

#include "usbguard.hpp"
#include "usbguard-get-parameter.hpp"
@@ -99,7 +97,7 @@

static int usbguard_cli(int argc, char* argv[])
Expand All @@ -22,63 +9,3 @@

if (argc == 1) {
showTopLevelHelp();
--- a/src/CLI/usbguard-rule-parser.cpp 2019-06-13 11:51:53.783863704 +0000
+++ b/src/CLI/usbguard-rule-parser.cpp 2019-08-23 01:52:34.234056870 +0000
@@ -24,10 +24,8 @@
#include "RuleParser.hpp"

#include <iostream>
-#ifndef _GNU_SOURCE
- #define _GNU_SOURCE
-#endif
#include <cstring>
+#include <libgen.h>
#include <fstream>

#include <getopt.h>
@@ -43,8 +41,10 @@

static void showHelp(std::ostream& stream, const char* usbguard_arg0)
{
- stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS] <rule_spec>" << std::endl;
- stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS] -f <file>" << std::endl;
+ char *usbguard_arg0_copy = strdup(usbguard_arg0);
+ stream << " Usage: " << ::basename(usbguard_arg0_copy) << " [OPTIONS] <rule_spec>" << std::endl;
+ stream << " Usage: " << ::basename(usbguard_arg0_copy) << " [OPTIONS] -f <file>" << std::endl;
+ free(usbguard_arg0_copy);
stream << std::endl;
stream << " Options:" << std::endl;
stream << " -f, --file Interpret the argument as a path to a file that should be parsed." << std::endl;
--- a/src/DBus/gdbus-server.cpp 2019-06-28 08:45:27.616687137 +0000
+++ b/src/DBus/gdbus-server.cpp 2019-08-23 01:52:34.274056367 +0000
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <iostream>
#include <getopt.h>
+#include <libgen.h>
#include "DBusBridge.hpp"

static usbguard::DBusBridge* dbus_bridge = nullptr;
@@ -208,7 +209,9 @@

static void showHelp(std::ostream& stream)
{
- stream << " Usage: " << ::basename(usbguard_arg0) << " [OPTIONS]" << std::endl;
+ char *usbguard_arg0_copy = strdup(usbguard_arg0);
+ stream << " Usage: " << ::basename(usbguard_arg0_copy) << " [OPTIONS]" << std::endl;
+ free(usbguard_arg0_copy);
stream << std::endl;
stream << " Options:" << std::endl;
stream << " -s, --system Listen on the system bus." << std::endl;
--- a/src/Library/public/usbguard/Exception.hpp 2019-06-28 08:45:27.620687089 +0000
+++ b/src/Library/public/usbguard/Exception.hpp 2019-08-23 01:52:34.323055751 +0000
@@ -116,7 +116,8 @@
static std::string reasonFromErrno(const int errno_value)
{
char buffer[1024];
- return std::string(strerror_r(errno_value, buffer, sizeof buffer));
+ strerror_r(errno_value, buffer, sizeof buffer);
+ return std::string(buffer);
}
};

8 changes: 5 additions & 3 deletions srcpkgs/usbguard/template
@@ -1,7 +1,7 @@
# Template file for 'usbguard'
pkgname=usbguard
version=1.0.0
revision=8
version=1.1.2
revision=1
build_style=gnu-configure
configure_args="--with-crypto-library=sodium --with-bundled-catch --with-bundled-pegtl"
conf_files="/etc/usbguard/*"
Expand All @@ -14,11 +14,13 @@ short_desc="Tool for whitelisting and blacklisting USB devices"
maintainer="Philoponus Bindle <philoponus-bindle@protonmail.com>"
license="GPL-2.0-or-later"
homepage="https://usbguard.github.io"
RunningDroid marked this conversation as resolved.
Show resolved Hide resolved
changelog="https://raw.githubusercontent.com/USBGuard/usbguard/main/CHANGELOG.md"
distfiles="https://github.com/USBGuard/usbguard/releases/download/usbguard-$version/usbguard-$version.tar.gz"
checksum=5617986cd5dd1a2d311041648a1977d836cf4e33a4121d7f82599f21496abc42
checksum=dcf5c90f3f93030e04df1baeb8d388b678c40dd48b135ea12a7be7dee8944934

post_install() {
vsv usbguard
vcompletion scripts/usbguard-zsh-completion zsh
}

usbguard-devel_package() {
Expand Down