diff options
author | Luca Boccassi <luca.boccassi@gmail.com> | 2023-03-21 17:18:07 +0000 |
---|---|---|
committer | Jan Rybar <jrybar@redhat.com> | 2023-03-21 17:18:07 +0000 |
commit | e8349b2328f94ffb94bd0fb1b64e7be55900962b (patch) | |
tree | 891b190f46450aabaabddf767d1afecd2ecc15cf | |
parent | bf1549f878821dde4fc0a831cb545298ed7ea861 (diff) | |
download | polkit-e8349b2328f94ffb94bd0fb1b64e7be55900962b.tar.gz |
Stop installing /usr/share/polkit-1/rules.d as 700/polkitd
-rw-r--r-- | meson.build | 1 | ||||
-rw-r--r-- | meson_post_install.py | 31 |
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 |