refractor(profile): merge swapon & swapoff

This commit is contained in:
Alexandre Pujol 2023-09-05 19:09:11 +01:00
parent 9a614a3502
commit 73ff7efe60
Failed to generate hash of commit
2 changed files with 2 additions and 31 deletions

View file

@ -1,29 +0,0 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/swapoff
profile swapoff @{exec_path} {
include <abstractions/base>
include <abstractions/disks-write>
capability sys_admin,
@{exec_path} mr,
/etc/fstab r,
@{PROC}/swaps r,
# SWAP file common locations
owner /swapfile rw,
/dev/pts/@{int} rw,
include if exists <local/swapoff>
}

View file

@ -1,13 +1,13 @@
# apparmor.d - Full set of apparmor profiles
# Copyright (C) 2019-2021 Mikhail Morfikov
# Copyright (C) 2023 Alexandre Pujol <alexandre@pujol.io>
# Copyright (C) 2021-2023 Alexandre Pujol <alexandre@pujol.io>
# SPDX-License-Identifier: GPL-2.0-only
abi <abi/3.0>,
include <tunables/global>
@{exec_path} = @{bin}/swapon
@{exec_path} = @{bin}/swapon @{bin}/swapoff
profile swapon @{exec_path} {
include <abstractions/base>
include <abstractions/disks-write>