summaryrefslogtreecommitdiff
path: root/vendor/github.com/godbus/dbus/conn_other.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-11-13 20:19:54 +0100
committerGitHub <noreply@github.com>2019-11-13 20:19:54 +0100
commit225f22b9d5dfd0d1582a56530142fe8ffb960a91 (patch)
tree4dcc994bb1e48602e5be5f42b7599abdc0cc7937 /vendor/github.com/godbus/dbus/conn_other.go
parent15220af08ce2346686e54851a6d498ec573e950c (diff)
parent6003033adae775f1d725b05231a246a4462ae669 (diff)
downloadpodman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.gz
podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.tar.bz2
podman-225f22b9d5dfd0d1582a56530142fe8ffb960a91.zip
Merge pull request #4506 from TomSweeneyRedHat/dev/tsweeney/bump_buildah1.11.5
Bump to Buildah v1.11.5
Diffstat (limited to 'vendor/github.com/godbus/dbus/conn_other.go')
-rw-r--r--vendor/github.com/godbus/dbus/conn_other.go6
1 files changed, 4 insertions, 2 deletions
diff --git a/vendor/github.com/godbus/dbus/conn_other.go b/vendor/github.com/godbus/dbus/conn_other.go
index 289044a44..616dcf664 100644
--- a/vendor/github.com/godbus/dbus/conn_other.go
+++ b/vendor/github.com/godbus/dbus/conn_other.go
@@ -14,8 +14,10 @@ import (
"strings"
)
+var execCommand = exec.Command
+
func getSessionBusPlatformAddress() (string, error) {
- cmd := exec.Command("dbus-launch")
+ cmd := execCommand("dbus-launch")
b, err := cmd.CombinedOutput()
if err != nil {
@@ -25,7 +27,7 @@ func getSessionBusPlatformAddress() (string, error) {
i := bytes.IndexByte(b, '=')
j := bytes.IndexByte(b, '\n')
- if i == -1 || j == -1 {
+ if i == -1 || j == -1 || i > j {
return "", errors.New("dbus: couldn't determine address of session bus")
}