godbus / dbus

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

auth: Do not send UID with external auth #346

Closed idleroamer closed 1 year ago

idleroamer commented 1 year ago

Due to mismatch between UID in a user-namespace and out-of-band credential acquired by server on another user-namespace refrain from sending UID with authentication message

https://github.com/godbus/dbus/issues/345

guelfey commented 1 year ago

Thanks. I agree that this is probably better as a default behavior, but wouldn't want to break the API for this (although probably there are not many users that use AuthExternal directly). Could you add this as a separate Auth implementation (which is then used in Conn.Auth as the new default first method)?

idleroamer commented 1 year ago

Somehow I tested with older godbus version, this already fixed in master as part of https://github.com/godbus/dbus/issues/264

nevertheless I added a test-case, can't hurt

guelfey commented 1 year ago

Thanks - could you scope the test to only be compiled on Linux? It doesn't work on FreeBSD for obvious reasons and thus would break the build there

idleroamer commented 1 year ago

@guelfey Thanks for the review, test is conditionalized

guelfey commented 1 year ago

Thanks!