github.com/rigado/snapd@v2.42.5-go-mod+incompatible/interfaces/builtin/locale_control.go (about)

     1  // -*- Mode: Go; indent-tabs-mode: t -*-
     2  
     3  /*
     4   * Copyright (C) 2016 Canonical Ltd
     5   *
     6   * This program is free software: you can redistribute it and/or modify
     7   * it under the terms of the GNU General Public License version 3 as
     8   * published by the Free Software Foundation.
     9   *
    10   * This program is distributed in the hope that it will be useful,
    11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    13   * GNU General Public License for more details.
    14   *
    15   * You should have received a copy of the GNU General Public License
    16   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
    17   *
    18   */
    19  
    20  package builtin
    21  
    22  const localeControlSummary = `allows control over system locale`
    23  
    24  const localeControlBaseDeclarationSlots = `
    25    locale-control:
    26      allow-installation:
    27        slot-snap-type:
    28          - core
    29      deny-auto-connection: true
    30  `
    31  
    32  // http://bazaar.launchpad.net/~ubuntu-security/ubuntu-core-security/trunk/view/head:/data/apparmor/policygroups/ubuntu-core/16.04/locale-control
    33  const localeControlConnectedPlugAppArmor = `
    34  # Description: Can manage locales directly separate from 'config ubuntu-core'.
    35  
    36  # TODO: this won't work until snappy exposes this configurability
    37  /etc/default/locale rw,
    38  `
    39  
    40  func init() {
    41  	registerIface(&commonInterface{
    42  		name:                  "locale-control",
    43  		summary:               localeControlSummary,
    44  		implicitOnClassic:     true,
    45  		baseDeclarationSlots:  localeControlBaseDeclarationSlots,
    46  		connectedPlugAppArmor: localeControlConnectedPlugAppArmor,
    47  		reservedForOS:         true,
    48  	})
    49  }