-
Notifications
You must be signed in to change notification settings - Fork 951
panic on permissions.ls #3833
Description
Describe the bug
When trying to list permissions, govc permissions.ls, I get a panic error.
When troubleshooting this issue, you get the panic when the user account govc uses to authenticate has administrator role assigned at the vCenter level.
There is no panic when it is globaly assigned.
This is weird, because when I do this manually in the UI and authenticate with the same account as govc uses, I can list and set permissions on the vcenter level.
A clear and concise description of what the bug is.
To Reproduce
Steps to reproduce the behavior:
- Setup govc environment variables to connect to vCenter
- the useraccount used should have administrator rights at the vcenter level
- run govc permissions.ls
Expected behavior
I expect to get a list of permissions returned.
Affected version
0.51.0
Screenshots/Debug Output
If applicable, add screenshots or debug output to help explain your problem.
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x8 pc=0xfe20ce]
goroutine 1 [running]:
github.com/vmware/govmomi/cli/permissions.(*List).Write(0xc0000a88c0, {0x18b9120, 0xc000088028})
/home/runner/work/govmomi/govmomi/cli/permissions/permissions.go:126 +0x38e
github.com/vmware/govmomi/cli/flags.(*OutputFlag).WriteResult(0xc000063000, {0x18baaa0?, 0xc0000a88c0?})
/home/runner/work/govmomi/govmomi/cli/flags/output.go:199 +0x316
github.com/vmware/govmomi/cli/permissions.(*ls).Run(0xc000058850, {0x18c8df8, 0x25aa860}, 0xc0001edce0?)
/home/runner/work/govmomi/govmomi/cli/permissions/ls.go:70 +0x353
github.com/vmware/govmomi/cli.Run({0xc00003e050, 0x1, 0x1})
/home/runner/work/govmomi/govmomi/cli/command.go:203 +0x2e2
main.main()
/home/runner/work/govmomi/govmomi/govc/main.go:127 +0x45