Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions data/selinux/snappy.fc
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ ifdef(`distro_debian',`
/lib/systemd/system/snapd.* -- gen_context(system_u:object_r:snappy_unit_file_t,s0)
')

/tmp/snap-private-tmp -d gen_context(system_u:object_r:snappy_tmp_t,s0)

/var/run/snapd(/.*)? gen_context(system_u:object_r:snappy_var_run_t,s0)
/var/run/snapd\.socket -s gen_context(system_u:object_r:snappy_var_run_t,s0)
/var/run/snapd-snap\.socket -s gen_context(system_u:object_r:snappy_var_run_t,s0)
Expand Down
2 changes: 2 additions & 0 deletions data/selinux/snappy.te
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,8 @@ snappy_stream_connect(snappy_cli_t)
userdom_search_user_tmp_dirs(snappy_cli_t)
# create /run/user/<uid>/snap.<name> directories
userdom_manage_tmp_dirs(snappy_cli_t)
# the snap command probes for /tmp/snap-private-tmp presence
allow snappy_cli_t snappy_tmp_t:dir getattr;

# allow snappy_cli_t to exec() into the snapd binary which implements
# snap CLI handler and other internal snapd tools
Expand Down
4 changes: 4 additions & 0 deletions packaging/fedora/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,10 @@ fi
%post selinux
%selinux_modules_install %{_datadir}/selinux/packages/snappy.pp.bz2
%selinux_relabel_post
# Ensure the private tmp directory for snap-confine exists and has the correct
# SELinux label now that the policy module is loaded
install -d -m 0700 /tmp/snap-private-tmp
restorecon /tmp/snap-private-tmp || :

%posttrans selinux
%selinux_relabel_post
Expand Down
4 changes: 4 additions & 0 deletions packaging/opensuse/snapd.spec
Original file line number Diff line number Diff line change
Expand Up @@ -514,6 +514,10 @@ fi

%post selinux
%selinux_modules_install -s %{selinuxtype} %{_datadir}/selinux/packages/snappy.pp.bz2
# Ensure the private tmp directory for snap-confine exists and has the correct
# SELinux label now that the policy module is loaded
install -d -m 0700 /tmp/snap-private-tmp
restorecon /tmp/snap-private-tmp || :

%preun selinux
%selinux_relabel_pre -s %{selinuxtype}
Expand Down
Loading