Error out if systemd sockets are used with the user_name option
This commit is contained in:
parent
1019428ca0
commit
4dc756be4d
|
@ -11,6 +11,10 @@ import (
|
||||||
func (proxy *Proxy) SystemDListeners() error {
|
func (proxy *Proxy) SystemDListeners() error {
|
||||||
files := activation.Files(true)
|
files := activation.Files(true)
|
||||||
|
|
||||||
|
if len(files) > 0 && (len(proxy.userName) > 0 || proxy.child) {
|
||||||
|
dlog.Fatal("Systemd activated sockets are incompatible with privilege dropping. Remove activated sockets and fill `listen_addresses` in the dnscrypt-proxy configuration file instead.")
|
||||||
|
}
|
||||||
|
|
||||||
for i, file := range files {
|
for i, file := range files {
|
||||||
if listener, err := net.FileListener(file); err == nil {
|
if listener, err := net.FileListener(file); err == nil {
|
||||||
dlog.Noticef("Wiring systemd TCP socket #%d, %s, %s", i, file.Name(), listener.Addr())
|
dlog.Noticef("Wiring systemd TCP socket #%d, %s, %s", i, file.Name(), listener.Addr())
|
||||||
|
|
Loading…
Reference in New Issue