Summary: | [PATCH] polkit-0.115 fails to build on POSIX platforms (like Linux/musl) due to requiring netgroup support | ||
---|---|---|---|
Product: | PolicyKit | Reporter: | Natanael Copa <natanael.copa> |
Component: | daemon | Assignee: | David Zeuthen (not reading bugmail) <zeuthen> |
Status: | RESOLVED MOVED | QA Contact: | David Zeuthen (not reading bugmail) <zeuthen> |
Severity: | normal | ||
Priority: | medium | CC: | awilfox, freedesktop-bugs, rene.rheaume |
Version: | unspecified | Keywords: | patch |
Hardware: | Other | ||
OS: | Linux (All) | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=561672 | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
Quick and dirty fix
make netgroup support optional make netgroup support optional for version 0.113 Make Netgroup support optional Make Netgroup support optional |
Description
Natanael Copa
2012-05-20 06:31:41 UTC
Created attachment 61878 [details] [review] Quick and dirty fix This quick-and-dirty patch makes it compile and should work. You might want add an --disable-netgroups configure option or similar. Created attachment 73996 [details] [review] make netgroup support optional Updated version of the patch. Created attachment 118753 [details] [review] make netgroup support optional for version 0.113 It also does not work as is with version 0.113 on Lilblue (Gentoo using uclibc as system libc). My patch is a little different from the Natanel's one. Thanks for the patch. 1. If a system administrator does configure the system to use netgroups, polkit should somehow visibly refuse the configuration instead of silently ignoring it. Sadly polkit_unix_netgroup_new() cannot fail, so it might mean tracking down the callers and how they are used. (Then, get_user_in_net_group/js_polkit_user_is_in_netgroup could perhaps be #ifdef-ed to g_assert_not_reached()}. 2. Code-wise, it would be nice to minimize the number of ifdefs/conditions in the code. I guess that would mean having #ifdefs only inside get_users_in_net_group and js_polkit_user_is_in_netgroup instead of removing the functions entirely and then needing more ifdefs in their callers. Sadly I don’t have _that_ much time for polkit and supporting non-glibc systems is honestly quite low on the priority list; still, 1. above does need to be dealt with before shipping support in an upstream release. Created attachment 140555 [details] [review] Make Netgroup support optional This patch has been written entirely from scratch by me from the latest Git master. It takes all of the advice from the last patch's review: - Show an error if configuration includes 'unix-netgroup:'. - Put g_assert_not_reached in polkit_unix_netgroup_new since all callers have been modified to error out before it is reached. - Pass all tests on a glibc/x86_64 machine and a musl/ppc64 machine. Created attachment 140556 [details] [review] Make Netgroup support optional And this one foregoes adding itself as a new file in the root source tree... whoops. Sorry about that. -- GitLab Migration Automatic Message -- This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity. You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/polkit/polkit/issues/14. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.