summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@gmail.com>2023-03-21 17:18:07 +0000
committerJan Rybar <jrybar@redhat.com>2023-03-21 17:18:07 +0000
commite8349b2328f94ffb94bd0fb1b64e7be55900962b (patch)
tree891b190f46450aabaabddf767d1afecd2ecc15cf
parentbf1549f878821dde4fc0a831cb545298ed7ea861 (diff)
downloadpolkit-e8349b2328f94ffb94bd0fb1b64e7be55900962b.tar.gz
Stop installing /usr/share/polkit-1/rules.d as 700/polkitd
-rw-r--r--meson.build1
-rw-r--r--meson_post_install.py31
2 files changed, 13 insertions, 19 deletions
diff --git a/meson.build b/meson.build
index f3a8588..10b17eb 100644
--- a/meson.build
+++ b/meson.build
@@ -370,7 +370,6 @@ if not libs_only
meson.add_install_script(
'meson_post_install.py',
get_option('bindir'),
- pk_pkgdatadir,
pk_libprivdir,
pk_pkgsysconfdir,
polkitd_user,
diff --git a/meson_post_install.py b/meson_post_install.py
index e742310..6188cbb 100644
--- a/meson_post_install.py
+++ b/meson_post_install.py
@@ -17,10 +17,9 @@ def destdir_path(p):
return os.path.join(prefix, p)
bindir = destdir_path(sys.argv[1])
-pkgdatadir = destdir_path(sys.argv[2])
-pkglibdir = destdir_path(sys.argv[3])
-pkgsysconfdir = destdir_path(sys.argv[4])
-polkitd_user = sys.argv[5]
+pkglibdir = destdir_path(sys.argv[2])
+pkgsysconfdir = destdir_path(sys.argv[3])
+polkitd_user = sys.argv[4]
try:
polkitd_uid = pwd.getpwnam(polkitd_user).pw_uid
@@ -40,22 +39,18 @@ else:
)
)
-dst_dirs = [
- os.path.join(pkgsysconfdir, 'rules.d'),
- os.path.join(pkgdatadir, 'rules.d')
-]
+dst = os.path.join(pkgsysconfdir, 'rules.d')
-for dst in dst_dirs:
- if not os.path.exists(dst):
- os.makedirs(dst, mode=0o700)
- if os.geteuid() == 0 and polkitd_uid is not None:
- os.chown(dst, polkitd_uid, -1)
- else:
- print(
- 'Owner of {} needs to be set to {} after installation'.format(
- dst, polkitd_user,
- )
+if not os.path.exists(dst):
+ os.makedirs(dst, mode=0o700)
+ if os.geteuid() == 0 and polkitd_uid is not None:
+ os.chown(dst, polkitd_uid, -1)
+ else:
+ print(
+ 'Owner of {} needs to be set to {} after installation'.format(
+ dst, polkitd_user,
)
+ )
# polkit-agent-helper-1 need to be setuid root because it's used to
# authenticate not only the invoking user, but possibly also root