Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

polkit-126: assert on polkitd startup when configured & built with "--prefix=/usr/local" #544

Open
z1atk0 opened this issue Jan 16, 2025 · 0 comments

Comments

@z1atk0
Copy link

z1atk0 commented Jan 16, 2025

Describe the bug
When configured & built with --prefix=/usr/local, polkitd from polkit-126 errors out with an assertion on startup (I reverted to polkit-125 for the time being, that's why I started it using LD_LIBRARY_PATH to make sure it's linking against its matching libs):

[root@disclosure:~/usrlocal/stow]# LD_LIBRARY_PATH=/usr/local/stow/polkit-126-@FDO/lib64 /usr/local/stow/polkit-126-@FDO/lib/polkit-1/polkitd 
Successfully changed to user polkitd
20:49:19.783: Loading rules from directory /usr/local/etc/polkit-1/rules.d
20:49:19.784: Loading rules from directory /run/polkit-1/rules.d
20:49:19.784: Loading rules from directory /usr/local/share/polkit-1/rules.d
20:49:19.784: Loading rules from directory /usr/local/share/polkit-1/rules.d
**
ERROR:../src/polkitbackend/polkitbackendcommon.c:475:polkit_backend_common_rules_file_name_cmp: assertion failed: (ret != 0)
Bail out! ERROR:../src/polkitbackend/polkitbackendcommon.c:475:polkit_backend_common_rules_file_name_cmp: assertion failed: (ret != 0)
Aborted

If I interpret the corresponding code correctly, then this probably originates from

authority->priv->rules_dirs[2] = g_strdup ("/usr/local/share/polkit-1/rules.d");
where /usr/local/share/polkit-1/rules.d gets added to the list of rules_dirs, leading to a duplicate path entry in
authority->priv->rules_dirs[3] = g_strdup (PACKAGE_DATA_DIR "/polkit-1/rules.d");
when configured with --prefix=/usr/local, which ultimately assert()s in
g_assert (ret != 0);
when trying to figure out which entry takes precedence, which is impossible when comparing two exactly identical entries.

Up to and including polkit-125, I used to build with meson setup --prefix=/usr/local -D js_engine=mozjs, and there were no duplicate path entries generated in

if (authority->priv->rules_dirs == NULL)
{
authority->priv->rules_dirs = g_new0 (gchar *, 3);
authority->priv->rules_dirs[0] = g_strdup (PACKAGE_SYSCONF_DIR "/polkit-1/rules.d");
authority->priv->rules_dirs[1] = g_strdup (PACKAGE_DATA_DIR "/polkit-1/rules.d");
}

To Reproduce
Steps to reproduce the behavior:

  1. Configure polkit-126 with meson setup --prefix=/usr/local, then build as usual
  2. Install to /usr/local with ninja install
  3. Wait for polkitd to be activated via d-bus, or ...
  4. ... try to start it manually with /usr/local/lib/polkit-1/polkitd

Expected behavior
I expected polkitd to startup properly as usual, when built with -D js_engine=mozjs in earlier versions. 🤷‍♂️ 😉

Screenshots
N/A, see terminal output above.

Desktop (please complete the following information):

  • OS (including version): Slackware64-15.0
  • Desktop Environment [Gnome, KDE, ...]: GNOME 47 (self-compiled)
  • Version of polkit: 126

Additional context
As I said before, I built against mozjs in previous versions, which didn't exhibit this behavior, as it didn't create duplicate entries in rules_dirs.

There's no output in the logs except for the startup notification ("Jan 15 20:49:19 disclosure polkitd[20392]: Started polkitd version 126").

If you need any additional information, plesae let me know. Thanks for listening! 🙂

Thomas

bob-beck pushed a commit to openbsd/ports that referenced this issue Jan 17, 2025
bob-beck pushed a commit to openbsd/ports that referenced this issue Jan 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant