From e8349b2328f94ffb94bd0fb1b64e7be55900962b Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Tue, 21 Mar 2023 17:18:07 +0000 Subject: Stop installing /usr/share/polkit-1/rules.d as 700/polkitd --- meson.build | 1 - 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 -- cgit v1.2.1