We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents d712533 + 759a16b commit 7d7373eCopy full SHA for 7d7373e
dbus/dbus.go
@@ -18,6 +18,8 @@ limitations under the License.
18
package dbus
19
20
import (
21
+ "os"
22
+ "strconv"
23
"strings"
24
"sync"
25
@@ -73,7 +75,12 @@ func (c *Conn) initConnection() error {
73
75
return err
74
76
}
77
- err = c.sysconn.Auth(nil)
78
+ // Only use EXTERNAL method, and hardcode the uid (not username)
79
+ // to avoid a username lookup (which requires a dynamically linked
80
+ // libc)
81
+ methods := []dbus.Auth{dbus.AuthExternal(strconv.Itoa(os.Getuid()))}
82
+
83
+ err = c.sysconn.Auth(methods)
84
if err != nil {
85
c.sysconn.Close()
86
0 commit comments