mirror of
				https://github.com/k3s-io/kubernetes.git
				synced 2025-11-04 07:49:35 +00:00 
			
		
		
		
	Updating dependency github.com/godbus/dbus to version v0.0.0-20190422162347-ade71ed3457e
This commit is contained in:
		
							
								
								
									
										6
									
								
								vendor/github.com/godbus/dbus/conn.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/godbus/dbus/conn.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -134,6 +134,8 @@ func SystemBus() (conn *Conn, err error) {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SystemBusPrivate returns a new private connection to the system bus.
 | 
			
		||||
// Note: this connection is not ready to use. One must perform Auth and Hello
 | 
			
		||||
// on the connection before it is useable.
 | 
			
		||||
func SystemBusPrivate(opts ...ConnOption) (*Conn, error) {
 | 
			
		||||
	return Dial(getSystemBusPlatformAddress(), opts...)
 | 
			
		||||
}
 | 
			
		||||
@@ -267,7 +269,7 @@ func (conn *Conn) Eavesdrop(ch chan<- *Message) {
 | 
			
		||||
	conn.eavesdroppedLck.Unlock()
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetSerial returns an unused serial.
 | 
			
		||||
// getSerial returns an unused serial.
 | 
			
		||||
func (conn *Conn) getSerial() uint32 {
 | 
			
		||||
	return conn.serialGen.GetSerial()
 | 
			
		||||
}
 | 
			
		||||
@@ -381,8 +383,6 @@ func (conn *Conn) Object(dest string, path ObjectPath) BusObject {
 | 
			
		||||
	return &Object{conn, dest, path}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// outWorker runs in an own goroutine, encoding and sending messages that are
 | 
			
		||||
// sent to conn.out.
 | 
			
		||||
func (conn *Conn) sendMessage(msg *Message) {
 | 
			
		||||
	conn.sendMessageAndIfClosed(msg, func() {})
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								vendor/github.com/godbus/dbus/conn_other.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										6
									
								
								vendor/github.com/godbus/dbus/conn_other.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -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")
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										53
									
								
								vendor/github.com/godbus/dbus/decoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										53
									
								
								vendor/github.com/godbus/dbus/decoder.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -188,8 +188,14 @@ func (dec *decoder) decode(s string, depth int) interface{} {
 | 
			
		||||
		if depth >= 64 {
 | 
			
		||||
			panic(FormatError("input exceeds container depth limit"))
 | 
			
		||||
		}
 | 
			
		||||
		sig := s[1:]
 | 
			
		||||
		length := dec.decode("u", depth).(uint32)
 | 
			
		||||
		v := reflect.MakeSlice(reflect.SliceOf(typeFor(s[1:])), 0, int(length))
 | 
			
		||||
		// capacity can be determined only for fixed-size element types
 | 
			
		||||
		var capacity int
 | 
			
		||||
		if s := sigByteSize(sig); s != 0 {
 | 
			
		||||
			capacity = int(length) / s
 | 
			
		||||
		}
 | 
			
		||||
		v := reflect.MakeSlice(reflect.SliceOf(typeFor(sig)), 0, capacity)
 | 
			
		||||
		// Even for empty arrays, the correct padding must be included
 | 
			
		||||
		align := alignment(typeFor(s[1:]))
 | 
			
		||||
		if len(s) > 1 && s[1] == '(' {
 | 
			
		||||
@@ -227,6 +233,51 @@ func (dec *decoder) decode(s string, depth int) interface{} {
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// sigByteSize tries to calculates size of the given signature in bytes.
 | 
			
		||||
//
 | 
			
		||||
// It returns zero when it can't, for example when it contains non-fixed size
 | 
			
		||||
// types such as strings, maps and arrays that require reading of the transmitted
 | 
			
		||||
// data, for that we would need to implement the unread method for Decoder first.
 | 
			
		||||
func sigByteSize(sig string) int {
 | 
			
		||||
	var total int
 | 
			
		||||
	for offset := 0; offset < len(sig); {
 | 
			
		||||
		switch sig[offset] {
 | 
			
		||||
		case 'y':
 | 
			
		||||
			total += 1
 | 
			
		||||
			offset += 1
 | 
			
		||||
		case 'n', 'q':
 | 
			
		||||
			total += 2
 | 
			
		||||
			offset += 1
 | 
			
		||||
		case 'b', 'i', 'u', 'h':
 | 
			
		||||
			total += 4
 | 
			
		||||
			offset += 1
 | 
			
		||||
		case 'x', 't', 'd':
 | 
			
		||||
			total += 8
 | 
			
		||||
			offset += 1
 | 
			
		||||
		case '(':
 | 
			
		||||
			i := 1
 | 
			
		||||
			depth := 1
 | 
			
		||||
			for i < len(sig[offset:]) && depth != 0 {
 | 
			
		||||
				if sig[offset+i] == '(' {
 | 
			
		||||
					depth++
 | 
			
		||||
				} else if sig[offset+i] == ')' {
 | 
			
		||||
					depth--
 | 
			
		||||
				}
 | 
			
		||||
				i++
 | 
			
		||||
			}
 | 
			
		||||
			s := sigByteSize(sig[offset+1 : offset+i-1])
 | 
			
		||||
			if s == 0 {
 | 
			
		||||
				return 0
 | 
			
		||||
			}
 | 
			
		||||
			total += s
 | 
			
		||||
			offset += i
 | 
			
		||||
		default:
 | 
			
		||||
			return 0
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return total
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// A FormatError is an error in the wire format.
 | 
			
		||||
type FormatError string
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										4
									
								
								vendor/github.com/godbus/dbus/default_handler.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								vendor/github.com/godbus/dbus/default_handler.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -263,13 +263,13 @@ func (sh *defaultSignalHandler) DeliverSignal(intf, name string, signal *Signal)
 | 
			
		||||
		case <-sh.closeChan:
 | 
			
		||||
			return
 | 
			
		||||
		default:
 | 
			
		||||
			go func() {
 | 
			
		||||
			go func(ch chan<- *Signal) {
 | 
			
		||||
				select {
 | 
			
		||||
				case ch <- signal:
 | 
			
		||||
				case <-sh.closeChan:
 | 
			
		||||
					return
 | 
			
		||||
				}
 | 
			
		||||
			}()
 | 
			
		||||
			}(ch)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/github.com/godbus/dbus/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/godbus/dbus/go.mod
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1 +1,3 @@
 | 
			
		||||
module github.com/godbus/dbus
 | 
			
		||||
 | 
			
		||||
go 1.12
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										19
									
								
								vendor/github.com/godbus/dbus/object.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										19
									
								
								vendor/github.com/godbus/dbus/object.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -16,6 +16,7 @@ type BusObject interface {
 | 
			
		||||
	AddMatchSignal(iface, member string, options ...MatchOption) *Call
 | 
			
		||||
	RemoveMatchSignal(iface, member string, options ...MatchOption) *Call
 | 
			
		||||
	GetProperty(p string) (Variant, error)
 | 
			
		||||
	SetProperty(p string, v interface{}) error
 | 
			
		||||
	Destination() string
 | 
			
		||||
	Path() ObjectPath
 | 
			
		||||
}
 | 
			
		||||
@@ -146,7 +147,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch
 | 
			
		||||
	}
 | 
			
		||||
	if msg.Flags&FlagNoReplyExpected == 0 {
 | 
			
		||||
		if ch == nil {
 | 
			
		||||
			ch = make(chan *Call, 10)
 | 
			
		||||
			ch = make(chan *Call, 1)
 | 
			
		||||
		} else if cap(ch) == 0 {
 | 
			
		||||
			panic("dbus: unbuffered channel passed to (*Object).Go")
 | 
			
		||||
		}
 | 
			
		||||
@@ -187,7 +188,7 @@ func (o *Object) createCall(ctx context.Context, method string, flags Flags, ch
 | 
			
		||||
	return call
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// GetProperty calls org.freedesktop.DBus.Properties.GetProperty on the given
 | 
			
		||||
// GetProperty calls org.freedesktop.DBus.Properties.Get on the given
 | 
			
		||||
// object. The property name must be given in interface.member notation.
 | 
			
		||||
func (o *Object) GetProperty(p string) (Variant, error) {
 | 
			
		||||
	idx := strings.LastIndex(p, ".")
 | 
			
		||||
@@ -208,6 +209,20 @@ func (o *Object) GetProperty(p string) (Variant, error) {
 | 
			
		||||
	return result, nil
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// SetProperty calls org.freedesktop.DBus.Properties.Set on the given
 | 
			
		||||
// object. The property name must be given in interface.member notation.
 | 
			
		||||
func (o *Object) SetProperty(p string, v interface{}) error {
 | 
			
		||||
	idx := strings.LastIndex(p, ".")
 | 
			
		||||
	if idx == -1 || idx+1 == len(p) {
 | 
			
		||||
		return errors.New("dbus: invalid property " + p)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	iface := p[:idx]
 | 
			
		||||
	prop := p[idx+1:]
 | 
			
		||||
 | 
			
		||||
	return o.Call("org.freedesktop.DBus.Properties.Set", 0, iface, prop, v).Err
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Destination returns the destination that calls on (o *Object) are sent to.
 | 
			
		||||
func (o *Object) Destination() string {
 | 
			
		||||
	return o.dest
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/github.com/godbus/dbus/transport_tcp.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/godbus/dbus/transport_tcp.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -1,5 +1,3 @@
 | 
			
		||||
//+build !windows
 | 
			
		||||
 | 
			
		||||
package dbus
 | 
			
		||||
 | 
			
		||||
import (
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								vendor/github.com/godbus/dbus/transport_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/github.com/godbus/dbus/transport_unix.go
									
									
									
										generated
									
									
										vendored
									
									
								
							@@ -203,7 +203,7 @@ func (t *unixTransport) SendMessage(msg *Message) error {
 | 
			
		||||
		}
 | 
			
		||||
	} else {
 | 
			
		||||
		if err := msg.EncodeTo(t, nativeEndian); err != nil {
 | 
			
		||||
			return nil
 | 
			
		||||
			return err
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	return nil
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user