Merge lp:~dobey/whoopsie-preferences/no-get-ui into lp:whoopsie-preferences

Proposed by dobey
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~dobey/whoopsie-preferences/no-get-ui
Merge into: lp:whoopsie-preferences
Diff against target: 41 lines (+15/-1)
2 files modified
debian/changelog (+6/-0)
src/whoopsie-preferences.c (+9/-1)
To merge this branch: bzr merge lp:~dobey/whoopsie-preferences/no-get-ui
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
Evan (community) Approve
Review via email: mp+275056@code.launchpad.net

Commit message

Don't require UI for GetIdentifier method call.

To post a comment you must log in.
Revision history for this message
Evan (ev) wrote :

Looks good. 👍 I'd add a comment to explain the problem inline, but I suspect we'll be coming back to this quickly to drop ALLOW_USER_AUTH entirely.

review: Approve
73. By dobey

Use g_ascii_strcasecmp instead of g_strcmp0

Revision history for this message
dobey (dobey) wrote :

Changing this to rejected, because I was misunderstanding what the issue was with policykit here. This change doesn't fix the problem I was having, though the code does work as written.

review: Disapprove

Unmerged revisions

73. By dobey

Use g_ascii_strcasecmp instead of g_strcmp0

72. By dobey

Don't require UI for GetIdentifier method call. (LP: #1508104)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2015-09-10 14:00:51 +0000
3+++ debian/changelog 2015-10-20 18:54:25 +0000
4@@ -1,3 +1,9 @@
5+whoopsie-preferences (0.19) UNRELEASED; urgency=medium
6+
7+ * Don't require UI for GetIdentifier method call. (LP: #1508104)
8+
9+ -- Rodney Dawes <rodney.dawes@canonical.com> Tue, 20 Oct 2015 11:15:28 -0400
10+
11 whoopsie-preferences (0.18) wily; urgency=medium
12
13 * Truncate the file manually if update-rc.d fails (e.g. on an r/o phone).
14
15=== modified file 'src/whoopsie-preferences.c'
16--- src/whoopsie-preferences.c 2015-09-10 13:19:51 +0000
17+++ src/whoopsie-preferences.c 2015-10-20 18:54:25 +0000
18@@ -451,14 +451,22 @@
19 PolkitAuthorizationResult* result = NULL;
20 GError* error = NULL;
21 const char* sender = NULL;
22+ const char* method = NULL;
23 gboolean ret = FALSE;
24+ PolkitCheckAuthorizationFlags flags;
25
26+ method = g_dbus_method_invocation_get_method_name (invocation);
27+ if (!g_ascii_strcasecmp(method, "GetIdentifier")) {
28+ flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_NONE;
29+ } else {
30+ flags = POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION;
31+ }
32 sender = g_dbus_method_invocation_get_sender (invocation);
33 subject = polkit_system_bus_name_new (sender);
34 result = polkit_authority_check_authorization_sync (authority, subject,
35 "com.ubuntu.whoopsiepreferences.change",
36 NULL,
37- POLKIT_CHECK_AUTHORIZATION_FLAGS_ALLOW_USER_INTERACTION,
38+ flags,
39 NULL, &error);
40 if (result == NULL) {
41 g_dbus_method_invocation_return_error (invocation, G_DBUS_ERROR,

Subscribers

People subscribed via source and target branches

to all changes: