Files
arca/vendor/github.com/godbus/dbus/v5/conn_unix.go
Kyle Isom c835358829 Initial implementation of arca, a LUKS volume manager.
Go CLI using cobra with mount, unmount, status, and init subcommands.
Unlocks via udisks2 D-Bus (passphrase/keyfile) or cryptsetup (FIDO2/TPM2)
with ordered method fallback. Includes NixOS-specific LD_LIBRARY_PATH
injection for systemd cryptsetup token plugins.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 07:42:38 -07:00

41 lines
894 B
Go

//go:build !windows && !solaris && !darwin
package dbus
import (
"net"
"os"
)
const defaultSystemBusAddress = "unix:path=/var/run/dbus/system_bus_socket"
func getSystemBusPlatformAddress() string {
address := os.Getenv("DBUS_SYSTEM_BUS_ADDRESS")
if address != "" {
return address
}
return defaultSystemBusAddress
}
// DialUnix establishes a new private connection to the message bus specified by UnixConn.
func DialUnix(conn *net.UnixConn, opts ...ConnOption) (*Conn, error) {
tr := newUnixTransportFromConn(conn)
return newConn(tr, opts...)
}
func ConnectUnix(uconn *net.UnixConn, opts ...ConnOption) (*Conn, error) {
conn, err := DialUnix(uconn, opts...)
if err != nil {
return nil, err
}
if err = conn.Auth(conn.auth); err != nil {
_ = conn.Close()
return nil, err
}
if err = conn.Hello(); err != nil {
_ = conn.Close()
return nil, err
}
return conn, nil
}