freebsd: Remove the cgo dependency from transport_unixcred_freebsd.go#332
freebsd: Remove the cgo dependency from transport_unixcred_freebsd.go#332guelfey merged 1 commit intogodbus:masterfrom
Conversation
This also stops the code from wrongly using sizeof(struct ucred) which is unrelated to SCM_CREDS. The size of the correct cmsgcreds structure is hard-coded here - this ABI has not changed for ~25 years. The added dependency on golang.org/x/sys/unix could be avoided if necessary, e.g. by using unsafe.Sizeof(uintptr). Fixes godbus#331
|
Rebased |
|
@guelfey PTAL |
|
Sorry for the delay. Also see #318. As mentioned there, IMO the details of this struct should be handled in |
|
No worries about the delay - thanks for taking a look. I agree that it would be best to have the struct definition in x/sys but as I mentioned above, this ABI is extremely stable and is the same across 32bit and 64bit platforms so perhaps that doesn't have to block? Reading the golang issue, I have a very slight preference to call the struct Cmsgcreds - while the APIs are similar, they are not the same as you point out and Cmsgcreds additionally gives access to all the user's groups. I can comment there if that helps and I'm happy to make a PR along the lines suggested using whichever name consensus prefers. |
|
Hm fair point, unless some future architecture will switch to 64 bits for process IDs or similar 😄 but that really rather seems unlikely to me |
This pulls in godbus/dbus#332 allowing dbus to build without cgo on FreeBSD. This will allow freebsd targets in the cross build. [NO NEW TESTS NEEDED] Signed-off-by: Doug Rabson <[email protected]>
Coder fails to build [1] on FreeBSD:
transport_unix.go:52:10: cannot use t (variable of type *unixTransport) as type transport in return statement:
*unixTransport does not implement transport (missing SendNullByte method)
Update godbus dependency to latest, post upstream PR #332 [2] via #237
Fixes: #4516
[1] #4516
[2] godbus/dbus#332
[3] godbus/dbus#237
This also stops the code from wrongly using sizeof(struct ucred) which
is unrelated to SCM_CREDS. The size of the correct cmsgcreds structure
is hard-coded here - this ABI has not changed for ~25 years.
The added dependency on golang.org/x/sys/unix could be avoided if
necessary, e.g. by using unsafe.Sizeof(uintptr).
Fixes #331