|
|
@@ -181,56 +181,56 @@ const bluezPermanentSlotDBus = ` |
|
|
</policy>
|
|
|
`
|
|
|
|
|
|
-type BluezInterface struct{}
|
|
|
+type bluezInterface struct{}
|
|
|
|
|
|
-func (iface *BluezInterface) Name() string {
|
|
|
+func (iface *bluezInterface) Name() string {
|
|
|
return "bluez"
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) DBusPermanentSlot(spec *dbus.Specification, slot *interfaces.Slot) error {
|
|
|
+func (iface *bluezInterface) DBusPermanentSlot(spec *dbus.Specification, slot *interfaces.Slot) error {
|
|
|
spec.AddSnippet(bluezPermanentSlotDBus)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) AppArmorConnectedPlug(spec *apparmor.Specification, plug *interfaces.Plug, plugAttrs map[string]interface{}, slot *interfaces.Slot, slotAttrs map[string]interface{}) error {
|
|
|
+func (iface *bluezInterface) AppArmorConnectedPlug(spec *apparmor.Specification, plug *interfaces.Plug, plugAttrs map[string]interface{}, slot *interfaces.Slot, slotAttrs map[string]interface{}) error {
|
|
|
old := "###SLOT_SECURITY_TAGS###"
|
|
|
new := slotAppLabelExpr(slot)
|
|
|
snippet := strings.Replace(bluezConnectedPlugAppArmor, old, new, -1)
|
|
|
spec.AddSnippet(snippet)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) AppArmorConnectedSlot(spec *apparmor.Specification, plug *interfaces.Plug, plugAttrs map[string]interface{}, slot *interfaces.Slot, slotAttrs map[string]interface{}) error {
|
|
|
+func (iface *bluezInterface) AppArmorConnectedSlot(spec *apparmor.Specification, plug *interfaces.Plug, plugAttrs map[string]interface{}, slot *interfaces.Slot, slotAttrs map[string]interface{}) error {
|
|
|
old := "###PLUG_SECURITY_TAGS###"
|
|
|
new := plugAppLabelExpr(plug)
|
|
|
snippet := strings.Replace(bluezConnectedSlotAppArmor, old, new, -1)
|
|
|
spec.AddSnippet(snippet)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) AppArmorPermanentSlot(spec *apparmor.Specification, slot *interfaces.Slot) error {
|
|
|
+func (iface *bluezInterface) AppArmorPermanentSlot(spec *apparmor.Specification, slot *interfaces.Slot) error {
|
|
|
spec.AddSnippet(bluezPermanentSlotAppArmor)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) SecCompPermanentSlot(spec *seccomp.Specification, slot *interfaces.Slot) error {
|
|
|
+func (iface *bluezInterface) SecCompPermanentSlot(spec *seccomp.Specification, slot *interfaces.Slot) error {
|
|
|
spec.AddSnippet(bluezPermanentSlotSecComp)
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) SanitizePlug(plug *interfaces.Plug) error {
|
|
|
+func (iface *bluezInterface) SanitizePlug(plug *interfaces.Plug) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) SanitizeSlot(slot *interfaces.Slot) error {
|
|
|
+func (iface *bluezInterface) SanitizeSlot(slot *interfaces.Slot) error {
|
|
|
return nil
|
|
|
}
|
|
|
|
|
|
-func (iface *BluezInterface) AutoConnect(*interfaces.Plug, *interfaces.Slot) bool {
|
|
|
+func (iface *bluezInterface) AutoConnect(*interfaces.Plug, *interfaces.Slot) bool {
|
|
|
// allow what declarations allowed
|
|
|
return true
|
|
|
}
|
|
|
|
|
|
func init() {
|
|
|
- registerIface(&BluezInterface{})
|
|
|
+ registerIface(&bluezInterface{})
|
|
|
}
|