aports/testing/adguardhome/cap_check.patch
Fabricio Silva f4eafccf8c testing/adguardhome: new aport
https://adguard.com/adguard-home.html
Network-wide ads & trackers blocking DNS server
2024-09-30 10:47:41 +00:00

22 lines
613 B
Diff

Fix correctly check can bind to privileged ports
https://github.com/AdguardTeam/AdGuardHome/pull/4728
---
diff --git a/internal/aghnet/net_linux.go b/internal/aghnet/net_linux.go
index 0c0784c6..00c5997a 100644
--- a/internal/aghnet/net_linux.go
+++ b/internal/aghnet/net_linux.go
@@ -23,11 +23,11 @@ const dhcpcdConf = "etc/dhcpcd.conf"
func canBindPrivilegedPorts() (can bool, err error) {
res, err := unix.PrctlRetInt(
- unix.PR_CAP_AMBIENT,
- unix.PR_CAP_AMBIENT_IS_SET,
+ unix.PR_CAPBSET_READ,
unix.CAP_NET_BIND_SERVICE,
0,
0,
+ 0,
)
if err != nil {
if errors.Is(err, unix.EINVAL) {