x/sys: trimmed string socket opt on linux #63217
Labels
FrozenDueToAge
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Bug description
Func
GetsockoptString
from x/sys/unix package always removes the last byte from the buffer, which in some cases leads to a truncated option value.From
unix
man page:But the implementation (this patch) always cuts the last byte without checking it for the null character.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?I'm using intel mac, but building for arm linux (GOARCH=arm64 GOOS=linux)
go env
OutputWhat did you do?
The service code is running on the linux with apparmor enabled. It just reads the app armor label from the Unix socket connection by calling:
What did you expect to see?
unconfined
appname (complain)
What did you see instead?
unconfine
appname (complain
The text was updated successfully, but these errors were encountered: