auth-manager: always compile D-Bus calls to polkit

Supporting PolicyKit required no additional library, just extra code
to handle the D-Bus calls. For that, there was a compile time option
to even stip out that code. Note, that you could (and still can)
configure the system not to use policy-kit. The point was to reduce
the binary size in case you don't need it.

Remove this. I guess, we we aim for such aggressive optimization of
the binary size, we should instead make all device types disablable
at configuration time. We don't do that either and other low hanging
fruits, because it's better to always enable features, unless they
require external dependencies.

Also, the next commit will make more use of NMAuthManager. So, having
it disabled at compile time, makes even less sense.
This commit is contained in:
Thomas Haller
2018-04-09 18:13:28 +02:00
parent 2ea2df3184
commit 41abf9f8e8
5 changed files with 8 additions and 57 deletions

View File

@@ -72,10 +72,8 @@ _ASSERT_call (AuthCall *call)
static void
auth_call_free (AuthCall *call)
{
#if WITH_POLKIT
if (call->call_id)
nm_auth_manager_check_authorization_cancel (call->call_id);
#endif
nm_clear_g_source (&call->call_idle_id);
c_list_unlink_stale (&call->auth_call_lst);
@@ -255,7 +253,6 @@ auth_call_complete_idle_cb (gpointer user_data)
return G_SOURCE_REMOVE;
}
#if WITH_POLKIT
static void
pk_call_cb (NMAuthManager *auth_manager,
NMAuthManagerCallId *call_id,
@@ -295,7 +292,6 @@ pk_call_cb (NMAuthManager *auth_manager,
auth_call_complete (call);
}
#endif
void
nm_auth_chain_add_call (NMAuthChain *self,
@@ -324,21 +320,12 @@ nm_auth_chain_add_call (NMAuthChain *self,
call->call_idle_id = g_idle_add (auth_call_complete_idle_cb, call);
} else {
/* Non-root always gets authenticated when using polkit */
#if WITH_POLKIT
call->call_id = nm_auth_manager_check_authorization (auth_manager,
self->subject,
permission,
allow_interaction,
pk_call_cb,
call);
#else
if (!call->chain->error) {
call->chain->error = g_error_new_literal (NM_MANAGER_ERROR,
NM_MANAGER_ERROR_FAILED,
"Polkit support is disabled at compile time");
}
call->call_idle_id = g_idle_add (auth_call_complete_idle_cb, call);
#endif
}
}