summaryrefslogtreecommitdiff
path: root/test/integration
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2025-10-20 16:11:37 +0000
committerJulian Andres Klode <jak@debian.org>2025-10-20 16:11:37 +0000
commit683214eed4aced71f94f12a0cc70509bdb473c82 (patch)
treecd51616b1f6b42c7d3e53a39f1400e292b6ea476 /test/integration
parent86be82f9877e29cb27de98c8680026df28e99af4 (diff)
parent6aca3716f051b5b6bff63d51fff68b9c7ebc7474 (diff)
Merge branch 'close-range' into 'main'
ExecFork: Use close_range() if available See merge request apt-team/apt!524
Diffstat (limited to 'test/integration')
-rwxr-xr-xtest/integration/test-close-range25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/integration/test-close-range b/test/integration/test-close-range
new file mode 100755
index 000000000..977c4cf0a
--- /dev/null
+++ b/test/integration/test-close-range
@@ -0,0 +1,25 @@
+#!/bin/sh
+set -e
+
+TESTDIR="$(readlink -f "$(dirname "$0")")"
+. "$TESTDIR/framework"
+
+setupenvironment
+configarchitecture 'amd64'
+
+
+testsuccessequal "close_range(3, 4294967295)" apthelper drop-privs -o Debug::CloseRange=1 true
+
+
+testsuccessequal "close_range(4, 4294967295)" apthelper drop-privs -o APT::Keep-Fds::=3 -o Debug::CloseRange=1 true
+
+
+testsuccessequal "close_range(3, 4)
+close_range(6, 4294967295)" apthelper drop-privs -o APT::Keep-Fds::=5 -o Debug::CloseRange=1 true
+
+
+testsuccessequal "close_range(4, 4)
+close_range(6, 4294967295)" apthelper drop-privs -o APT::Keep-Fds::=3 -o APT::Keep-Fds::=5 -o Debug::CloseRange=1 true
+
+testsuccessequal "close_range(4, 4)
+close_range(7, 4294967295)" apthelper drop-privs -o APT::Keep-Fds::=3 -o APT::Keep-Fds::=5 -o APT::Keep-Fds::=6 -o Debug::CloseRange=1 true