os/user: Lookup fails to find users when running as root on darwin-arm64 cross compiled from darwin-amd64 #43543
Labels
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
OS-Darwin
Milestone
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
)?Compiled using darwin, amd64. Executed on darwin, arm64
Build env:
go env
OutputExecution env:
go env
Outputcross compile code on darwin amd64 then execute on darwin arm64.
Compile on darwin amd64 for arm64
GOOS=darwin GOARCH=arm64 go build main.go
Download to darwin arm64 computer then execute without and with
sudo
.What did you expect to see?
I expected the user
user-es
found by the functionuser.Lookup(string)
when running as root, same as it does without root.I also expected the same error when the code is compiled on darwin-arm64 and executed on darwin-arm64. However if compiled on the target machine the function
user.Lookup(string)
works as expected when ran as both user and root.What did you see instead?
The function
user.Lookup(string)
fails to find the useruser-es
when running as root, when cross compiled from darwin-amd64.The text was updated successfully, but these errors were encountered: