Just looking at the ucred bits (I'm not sure about go-serial/openinternal) ..

This relates to a mechanism for fetching information about the process other side of a unix socket connection. Most common Unix-like OS can give some information about this (usually at least user/group credentials, sometimes also pretty information including PID), the mechanisms are slightly different (various names are used for the relevant sockopt, and the structures vary, though for basic credentials they're close enough that C programs handling this often just use #defines for the names).

It seems that getting this to work would need changes to add wider OS support for socket credentials to the go "sys" package (go.dbus is currently using "syscall" but it seems this is frozen for development), and go.dbus would need changes to use it.

--
Sent from a phone, apologies for poor formatting.

On 9 May 2019 05:16:26 J Sisson <sisso...@gmail.com> wrote:

Hey Ports,


With go-1.12.4 in OpenBSD-CURRENT/amd64, I'm running across some
undefined symbols, and wanted to see if this is expected/known
behavior:


test$ git clone https://github.com/muesli/beehive.git
test$ cd beehive
test$ gmake
<snip>
# github.com/guelfey/go.dbus
../go/pkg/mod/github.com/guelfey/go.dbus@v0.0.0-20131113121618-f6a3a2366cc3/transport_unixcred.go:12:12:
undefined: syscall.Ucred
../go/pkg/mod/github.com/guelfey/go.dbus@v0.0.0-20131113121618-f6a3a2366cc3/transport_unixcred.go:13:7:
undefined: syscall.UnixCredentials
# github.com/jacobsa/go-serial/serial
../go/pkg/mod/github.com/jacobsa/go-serial@v0.0.0-20180131005756-15cf729a72d4/serial/serial.go:165:9:
undefined: openInternal
gmake: *** [Makefile:20: build] Error 2
test$


Are these linuxisms in the go packages?  They appear to be to my untrained eye:


test$ pwd
/usr/local/go/src/syscall
test$ egrep 'UnixCredentials|UCred' *
creds_test.go:                  oob := syscall.UnixCredentials(&ucred)
creds_test.go:          oob := syscall.UnixCredentials(&ucred)
creds_test.go:          newUcred, err := syscall.ParseUnixCredentials(&scm[0])
creds_test.go:                  t.Fatalf("ParseUnixCredentials: %v", err)
creds_test.go:                  t.Fatalf("ParseUnixCredentials = %+v,
want %+v", newUcred, ucred)
sockcmsg_linux.go:// UnixCredentials encodes credentials into a socket
control message
sockcmsg_linux.go:func UnixCredentials(ucred *Ucred) []byte {
sockcmsg_linux.go:// ParseUnixCredentials decodes a socket control
message that contains
sockcmsg_linux.go:func ParseUnixCredentials(m *SocketControlMessage)
(*Ucred, error) {




Regards,
Jonathon



Reply via email to