diff options
author | Thomas Haller <thaller@redhat.com> | 2014-08-14 13:34:57 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2014-09-29 13:51:11 +0200 |
commit | eabe7d856c243673bbaba3295ce74d72e188596d (patch) | |
tree | 3c85e2d33dace5f644d8e605fd47f02d3367372c /configure.ac | |
parent | 63a8c6a184a58176b656d9e22f99a280682e0e5f (diff) | |
download | NetworkManager-eabe7d856c243673bbaba3295ce74d72e188596d.tar.gz |
auth: rework polkit autorization to use DBUS interface directly
This makes NetworkManager independent of <polkit/polkit.h>
development headers and libpolkit-gobject-1.so library.
Instead communicate directly with polkit using its DBUS
interface.
PolicyKit support is now always compiled in. You can control
polkit authorization with the configuration option
[main]
auth-polkit=yes|no
If the configure option is omitted, a build time default
value is used. This default value can be set with the
configure option --enable-polkit.
This commit adds a new class NMAuthManager that reimplements the
relevant DBUS client parts. It takes source code from the polkit
library.
https://bugzilla.gnome.org/show_bug.cgi?id=734146
Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 34 |
1 files changed, 12 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac index 1a1cc28412..93fc135265 100644 --- a/configure.ac +++ b/configure.ac @@ -457,27 +457,21 @@ else fi AM_CONDITIONAL(WITH_TEAMDCTL, test "${enable_teamdctl}" = "yes") -PKG_CHECK_MODULES(POLKIT, [polkit-gobject-1 >= 0.97], [have_polkit=yes],[have_polkit=no]) -AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit], [enable PolicyKit support]), - [enable_polkit=${enableval}], [enable_polkit=${have_polkit}]) -if (test "${enable_polkit}" = "yes"); then - if test x"$have_polkit" = x"no"; then - AC_MSG_ERROR(PolicyKit development headers are required) - fi - AC_SUBST(POLKIT_CFLAGS) - AC_SUBST(POLKIT_LIBS) - AC_DEFINE(WITH_POLKIT, 1, [Define if you have PolicyKit support]) +AC_ARG_ENABLE(polkit, AS_HELP_STRING([--enable-polkit], [set default value for auth-polkit configuration option]), + [enable_polkit=${enableval}], [enable_polkit=yes]) +if (test "${enable_polkit}" != "no"); then + enable_polkit=yes + AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, TRUE, [The default value of the auth-polkit configuration option]) + NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='true' else - AC_DEFINE(WITH_POLKIT, 0, [Define if you have PolicyKit support]) + AC_DEFINE(NM_CONFIG_DEFAULT_AUTH_POLKIT, FALSE, [The default value of the auth-polkit configuration option]) + NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT='false' fi -AM_CONDITIONAL(WITH_POLKIT, test "${enable_polkit}" = "yes") +AC_SUBST(NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT) AC_ARG_ENABLE(modify-system, AS_HELP_STRING([--enable-modify-system], [Allow users to modify system connections])) if test "${enable_modify_system}" = "yes"; then - if ! test "${enable_polkit}" = "yes"; then - AC_MSG_ERROR([--enable-modify-system requires --enable-polkit]) - fi NM_MODIFY_SYSTEM_POLICY="yes" else NM_MODIFY_SYSTEM_POLICY="auth_admin_keep" @@ -967,14 +961,10 @@ echo echo "Platform:" echo " session tracking: $with_session_tracking" echo " suspend/resume: $with_suspend_resume" -if test "${enable_polkit}" = "yes"; then - if test "${enable_modify_system}" = "yes"; then - echo " policykit: yes (permissive modify.system)" - else - echo " policykit: yes (restrictive modify.system)" - fi +if test "${enable_modify_system}" = "yes"; then + echo " policykit: yes (permissive modify.system) (default=${enable_polkit})" else - echo " policykit: no" + echo " policykit: yes (restrictive modify.system) (default=${enable_polkit})" fi echo " selinux: $have_selinux" echo |