Merge aa-notify: rename polkit files and template info from com.ubuntu

We should be using apparmor controlled domains for these files.

Rename the template file from
  com.ubuntu.pkexec.aa-notify.policy
to
  net.apparmor.pkexec.aa-notify.policy

And update the template file and the install file so that the files
that are generated use net.apparmor instead of com.ubuntu

Signed-off-by: John Johansen <john.johansen@canonical.com>

Closes #486
MR: https://gitlab.com/apparmor/apparmor/-/merge_requests/1541
Approved-by: Ryan Lee <rlee287@yahoo.com>
Merged-by: John Johansen <john@jjmx.net>
This commit is contained in:
John Johansen 2025-02-15 01:23:40 +00:00
commit e085a23b40
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<action id="com.ubuntu.pkexec.aa-notify.modify_profile">
<action id="net.apparmor.pkexec.aa-notify.modify_profile">
<description>AppArmor: modifying security profile</description>
<message>To modify an AppArmor security profile, you need to authenticate.</message>
<defaults>
@ -15,7 +15,7 @@
<annotate key="org.freedesktop.policykit.exec.path">{LIB_PATH}apparmor/update_profile.py</annotate>
<annotate key="org.freedesktop.policykit.exec.argv1">add_rule</annotate>
</action>
<action id="com.ubuntu.pkexec.aa-notify.create_userns">
<action id="net.apparmor.pkexec.aa-notify.create_userns">
<description>AppArmor: adding userns profile</description>
<message>To allow a program to use unprivileged user namespaces, you need to authenticate.</message>
<defaults>
@ -26,7 +26,7 @@
<annotate key="org.freedesktop.policykit.exec.path">{LIB_PATH}apparmor/update_profile.py</annotate>
<annotate key="org.freedesktop.policykit.exec.argv1">create_userns</annotate>
</action>
<action id="com.ubuntu.pkexec.aa-notify.from_file">
<action id="net.apparmor.pkexec.aa-notify.from_file">
<description>AppArmor: Modifying profile from file</description>
<message>To modify an AppArmor security profile from file, you need to authenticate.</message>
<defaults>

View file

@ -68,7 +68,7 @@ class Install(_install):
print('changing mode of {} to 755'.format(update_profile_path))
os.chmod(update_profile_path, 0o755)
pkexec_action_name = 'com.ubuntu.pkexec.aa-notify.policy'
pkexec_action_name = 'net.apparmor.pkexec.aa-notify.policy'
print('Installing {} to /usr/share/polkit-1/actions/ mode 644'.format(pkexec_action_name))
with open(pkexec_action_name, 'r') as f:
polkit_template = f.read()