PKGBUILDs/extra/memcached/0001-tests-enable-drop_privileges-by-default-for-better-s.patch

29 lines
851 B
Diff
Raw Normal View History

2023-05-05 23:26:20 +00:00
From 5647bec11c166707eaf348830bc2f5da11d554c0 Mon Sep 17 00:00:00 2001
From: Levente Polyak <levente@leventepolyak.net>
Date: Fri, 5 May 2023 18:13:57 +0200
Subject: [PATCH] tests: enable drop_privileges by default for better seccomp
coverage
---
t/lib/MemcachedTest.pm | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/t/lib/MemcachedTest.pm b/t/lib/MemcachedTest.pm
index a9557e5..4a63913 100644
--- a/t/lib/MemcachedTest.pm
+++ b/t/lib/MemcachedTest.pm
@@ -298,7 +298,9 @@ sub new_memcached {
if ($< == 0) {
$args .= " -u root";
}
- $args .= " -o relaxed_privileges";
+ if (supports_drop_priv()) {
+ $args .= " -o drop_privileges,relaxed_privileges";
+ }
my $udpport;
if ($args =~ /-l (\S+)/ || (($ssl_enabled || $unix_socket_disabled) && ($args !~ /-s (\S+)/))) {
--
2.40.1