service: fix typo in variable name (#3575)

This commit is contained in:
Oleksandr Redko 2023-11-19 08:32:03 +02:00 committed by GitHub
parent 650f2d5e23
commit c17e258895
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -111,18 +111,18 @@ func CanAccept(listenAddr, localAddr, remoteAddr net.Addr) bool {
if !ok || !laddr.IP.IsLoopback() { if !ok || !laddr.IP.IsLoopback() {
return true return true
} }
remoteaAddrTCP := remoteAddr.(*net.TCPAddr) remoteAddrTCP := remoteAddr.(*net.TCPAddr)
localAddrTCP := localAddr.(*net.TCPAddr) localAddrTCP := localAddr.(*net.TCPAddr)
same, err := sameUserForRemoteAddr(localAddrTCP, remoteaAddrTCP) same, err := sameUserForRemoteAddr(localAddrTCP, remoteAddrTCP)
if err != nil { if err != nil {
log.Printf("cannot check remote address: %v", err) log.Printf("cannot check remote address: %v", err)
} }
if !same { if !same {
if logflags.Any() { if logflags.Any() {
log.Printf("closing connection from different user (%v): connections to localhost are only accepted from the same UNIX user for security reasons", remoteaAddrTCP) log.Printf("closing connection from different user (%v): connections to localhost are only accepted from the same UNIX user for security reasons", remoteAddrTCP)
} else { } else {
fmt.Fprintf(os.Stderr, "closing connection from different user (%v): connections to localhost are only accepted from the same UNIX user for security reasons\n", remoteaAddrTCP) fmt.Fprintf(os.Stderr, "closing connection from different user (%v): connections to localhost are only accepted from the same UNIX user for security reasons\n", remoteAddrTCP)
} }
return false return false
} }