TUN-9467: bump coredns to solve CVE

* TUN-9467: bump coredns to solve CVE
This commit is contained in:
João Oliveirinha
2025-06-12 10:46:10 +00:00
committed by João "Pisco" Fernandes
parent f8d12c9d39
commit a408612f26
459 changed files with 30077 additions and 16165 deletions

View File

@@ -1,5 +1,9 @@
THIS IS A FORK OF CADDY v1 - EVERYTHING IS STRIPPED EXCEPT THE PIECES NEEDED IN COREDNS.
Issues are not enabled in this repository. Please raise any issues in coredns/coredns.
---
Caddy is a **production-ready** open-source web server that is fast, easy to use, and makes you more productive.

View File

@@ -1,5 +1,7 @@
// Copyright 2015 Light Code Labs, LLC
//
// Copyright 2024 MWS
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
@@ -218,22 +220,22 @@ func (i *Instance) Restart(newCaddyfile Input) (*Instance, error) {
}
// Add file descriptors of all the sockets that are capable of it
restartFds := make(map[string]restartTriple)
restartFds := make(map[string][]restartTriple)
for _, s := range i.servers {
gs, srvOk := s.server.(GracefulServer)
ln, lnOk := s.listener.(Listener)
pc, pcOk := s.packet.(PacketConn)
if srvOk {
if lnOk && pcOk {
restartFds[gs.Address()] = restartTriple{server: gs, listener: ln, packet: pc}
restartFds[gs.Address()] = append(restartFds[gs.Address()], restartTriple{server: gs, listener: ln, packet: pc})
continue
}
if lnOk {
restartFds[gs.Address()] = restartTriple{server: gs, listener: ln}
restartFds[gs.Address()] = append(restartFds[gs.Address()], restartTriple{server: gs, listener: ln})
continue
}
if pcOk {
restartFds[gs.Address()] = restartTriple{server: gs, packet: pc}
restartFds[gs.Address()] = append(restartFds[gs.Address()], restartTriple{server: gs, packet: pc})
continue
}
}
@@ -484,7 +486,7 @@ func Start(cdyfile Input) (*Instance, error) {
return inst, nil
}
func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string]restartTriple) error {
func startWithListenerFds(cdyfile Input, inst *Instance, restartFds map[string][]restartTriple) error {
// save this instance in the list now so that
// plugins can access it if need be, for example
// the caddytls package, so it can perform cert
@@ -684,7 +686,7 @@ func executeDirectives(inst *Instance, filename string,
return nil
}
func startServers(serverList []Server, inst *Instance, restartFds map[string]restartTriple) error {
func startServers(serverList []Server, inst *Instance, restartFds map[string][]restartTriple) error {
errChan := make(chan error, len(serverList))
// used for signaling to error logging goroutine to terminate
@@ -734,7 +736,16 @@ func startServers(serverList []Server, inst *Instance, restartFds map[string]res
// reuse the listener for a graceful restart.
if gs, ok := s.(GracefulServer); ok && restartFds != nil {
addr := gs.Address()
if old, ok := restartFds[addr]; ok {
// Multiple servers may use the same addr (SO_REUSEPORT option set), so it's important to ensure
// that we don't reuse the same listener/packetconn.
// We'll create new listeners in case there are no more available triples for the same address.
if triples, ok := restartFds[addr]; ok && len(triples) > 0 {
// Take first available triple
old := triples[0]
// Remove reused triple from restartFds
triples[0] = triples[len(triples)-1]
restartFds[addr] = triples[:len(triples)-1]
// listener
if old.listener != nil {
file, err := old.listener.File()

View File

@@ -56,33 +56,13 @@ var (
func DescribePlugins() string {
pl := ListPlugins()
str := "Server types:\n"
for _, name := range pl["server_types"] {
str += " " + name + "\n"
}
str += "\nCaddyfile loaders:\n"
for _, name := range pl["caddyfile_loaders"] {
str += " " + name + "\n"
}
if len(pl["event_hooks"]) > 0 {
str += "\nEvent hook plugins:\n"
for _, name := range pl["event_hooks"] {
str += " hook." + name + "\n"
}
}
if len(pl["clustering"]) > 0 {
str += "\nClustering plugins:\n"
for _, name := range pl["clustering"] {
str += " " + name + "\n"
}
}
str += "\nOther plugins:\n"
str := ""
for _, name := range pl["others"] {
str += " " + name + "\n"
if len(name) > 3 {
str += name[4:] + "\n" // drop dns. prefix caddy adds
} else {
str += name + "\n"
}
}
return str