mirror of
https://gitlab.alpinelinux.org/alpine/aports.git
synced 2025-04-16 19:16:42 +02:00
22 lines
613 B
Diff
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) {
|