2021-04-01 17:17:47 +02:00
|
|
|
# apparmor.d - Full set of apparmor profiles
|
|
|
|
# Copyright (C) 2019-2021 Mikhail Morfikov
|
|
|
|
# SPDX-License-Identifier: GPL-2.0-only
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
abi <abi/3.0>,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include <tunables/global>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
@{exec_path} = /{usr/,}bin/f3write
|
|
|
|
profile f3write @{exec_path} {
|
2020-12-10 22:33:39 +01:00
|
|
|
include <abstractions/base>
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# The f3write doesn't have to be started as root, but when it's started as root, the following
|
|
|
|
# CAP is needed in order to write to the user owned USB drives (e.g. mounted via udisks).
|
|
|
|
#capability dac_override,
|
|
|
|
|
|
|
|
@{exec_path} mr,
|
|
|
|
|
|
|
|
# USB drive mount locations
|
2022-06-12 23:51:37 +02:00
|
|
|
@{MOUNTDIRS} r,
|
|
|
|
@{MOUNTS}/ r,
|
2021-04-19 16:20:32 +02:00
|
|
|
@{MOUNTS}/*/ r,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
|
|
|
# To be able to write h2w files
|
2022-06-12 23:51:37 +02:00
|
|
|
owner @{MOUNTDIRS}/[0-9]*.h2w w,
|
|
|
|
owner @{MOUNTS}/[0-9]*.h2w w,
|
2021-04-19 16:20:32 +02:00
|
|
|
owner @{MOUNTS}/*/[0-9]*.h2w w,
|
2020-09-12 17:19:23 +02:00
|
|
|
|
2020-12-10 22:33:39 +01:00
|
|
|
include if exists <local/f3write>
|
2020-09-12 17:19:23 +02:00
|
|
|
}
|
|
|
|
|