From c917eb8207244439595c5dcc14856574940fdd34 Mon Sep 17 00:00:00 2001 From: Andus Yu Date: Wed, 6 Mar 2024 21:54:15 +0000 Subject: [PATCH] Make sure RBE socket address is under character limit Check that socket address paths are less than the character limit - 2 since absolute paths are prefixed with //, which is included in the character limit. b/308986536 Change-Id: I3055b8bb8cdae00aafd66c51fdc8421b9cc5f21f --- ui/build/config.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ui/build/config.go b/ui/build/config.go index 1a2539793..78a1cc3e8 100644 --- a/ui/build/config.go +++ b/ui/build/config.go @@ -1387,7 +1387,9 @@ func (c *configImpl) rbeAuth() (string, string) { } func (c *configImpl) rbeSockAddr(dir string) (string, error) { - maxNameLen := len(syscall.RawSockaddrUnix{}.Path) + // Absolute path socket addresses have a prefix of //. This should + // be included in the length limit. + maxNameLen := len(syscall.RawSockaddrUnix{}.Path) - 2 base := fmt.Sprintf("reproxy_%v.sock", rbeRandPrefix) name := filepath.Join(dir, base)