Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ConnectUnix and DialUnix #399

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

anonymix007
Copy link

@anonymix007 anonymix007 commented Dec 12, 2024

These allow creating D-Bus connections from *net.UnixConn on Unix systems.

File descriptors may be wrapped with

func fdToUnixConn(fd dbus.UnixFD, name string) (*net.UnixConn, error) {
	c, err := net.FileConn(os.NewFile(uintptr(fd), name))
	if err != nil {
		return nil, err
	}
    return c.(*net.UnixConn), nil
}

and will work as well.

This also technically introduces some sort of peer-to-peer support if only auth client is needed (i.e. QEMU).

Fixes #76
Partially fixes #384

These can be used to create D-Bus connections from already existing *net.UnixConn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why does the peer-to-peer branch seem to be deprecated? Allow creating connections from *net.UnixConn
1 participant