godbus / dbus

Native Go bindings for D-Bus
BSD 2-Clause "Simplified" License
959 stars 222 forks source link

Unable to set up new connection: Failed to read an SELinux context from connection #338

Open Balavva-Mirji opened 1 year ago

Balavva-Mirji commented 1 year ago

Observed one below test case failure on both architectures i.e. Intel and Power for v5.1.0. === RUN TestTcpNonceConnection dbus-daemon[1407687]: [session uid=0 pid=1407687] Unable to set up new connection: Failed to read an SELinux context from connection transport_nonce_tcp_test.go:31: read tcp [::1]:51214->[::1]:44621: read: connection reset by peer --- FAIL: TestTcpNonceConnection (0.02s)

I am trying to build this package on RHEL-8.4, it will be helpful if you provide any input on this test failure. Thanks.

guelfey commented 1 year ago

Seems to come from https://cgit.freedesktop.org/dbus/dbus/tree/bus/selinux.c#n700. I'm not too familiar with SELinux; I could imagine that the dbus-daemon that we spawn inside this test somehow lacks permissions in this regards. You could try running the test with DBUS_VERBOSE=1, then you shoudl get a hint on what is going wrong in more detail